Introduction and Use
TraceID global
SpanID each service
Guide package:
Zipkin imports the JAR package, adds @enableZipkinServer to the startup class, and accesses port 9411 to get to the home page
Call link
Zipkin can be integrated with EL to store data in EL.
The core concept
The basic elements include events, nodes, times, and relationships
The principle of event capture: AOP buried point, bytecode peg capture
Event concatenation: Through tranceID and spanID (id generated when an event occurs)
1) Generate an ID
Generate event ID, Tid:
In the httpservlet. service method -, the classloader is applied and the dispatchservlet. dispatch method is re-invoked when forwardCopy the code
2) Pass id (privacy parameter)
RPC, Dubbo, setAttachment, buried HTTP, request header socket, JMS in the filterCopy the code
Added: HTTP, RPC
In microservices, most of them use external REST and internal RPC. Rest uses HTTP protocol, which needs to be serialized twice and has a large volume. Only strings can be unlimited in transmission across firewalls (multiple lans). RPC uses TCP and IP protocols for high efficiency only once, and is small in size, but does not cross firewalls.
3) How to ensure data consistency under concurrent conditions
Data is stored in ThreadLocal