https://github.com/openzipkin/b3-propagation
B3 Propagation is a specification for the header "b3" and those that start with "x-b3-". These headers are used for trace context propagation across service boundaries.
https://opentracing.io/docs/overview/spans/
The “span” is the primary building block of a distributed trace, representing an individual unit of work done in a distributed system.
These are key:value
pairs that cross process-boundaries.
Sleuth provides distributed tracing mechanism.
- Trace data reported to Zipkin server
- Traces connect from service to service using header propagation. The default format is B3
Sampling only applies to tracing backends
, such as Zipkin. Trace IDs appear in logs regardless of sample rate. Sampling is a way to prevent overloading the system, by consistently tracing some, but not all requests.
- Start
- Close
- Continue
- Detach
- Create with explicit parent
Picking a span name is not a trivial task. A span name should depict an operation name. The name should be low cardinality, so it should not include identifiers.
Use @SpanName
annotation
By default, if you add spring-cloud-starter-zipkin
as a dependency to your project, when the span is closed, it is sent to Zipkin over HTTP.
Easy integration with OpenTracing
https://cloud.spring.io/spring-cloud-sleuth/reference/html/#span-lifecycle