- Vertices are components.
- Edges are ownership relationships between components. Each edge is labeled by the kind of "smart pointer" that could implement that kind of relationship.
- Components containing a padlock are protected by a mutex.
- Span has a beginning, end, and tags. It is associated with a TraceSegment.
- TraceSegment is part of a trace. It makes sampling decisions, detects when it is finished, and sends itself to the Collector.
- Collector receives trace segments. It provides a callback to deliver sampler modifications, if applicable.
- Tracer is responsible for creating trace segments. It contains the instances of, and configuration for, the Collector, TraceSampler, and SpanSampler. A tracer is created from a TracerConfig.
- TraceSampler is used by trace segments to decide when to keep or drop themselves.
- SpanSampler is used by trace segments to decide which spans to keep when the segment is dropped.
- TracerConfig contains all of the information needed to configure the collector, trace sampler, and span sampler, as well as defaults for span properties.
Intended usage is:
- Create a
TracerConfig
. - Use the
TracerConfig
to create aTracer
. - Use the
Tracer
to create and/or extract local rootSpan
s. - Use
Span
to create children and/or inject context. - Use a
Span
'sTraceSegment
to perform trace-wide operations. - When all
Span
s inTraceSegment
are finished, the segment is sent to theCollector
.
Different instances of Tracer
are independent of each other. If an
application wishes to reconfigure tracing at runtime, it can create another
Tracer
using the new configuration.