[][src]Module opentelemetry::api::trace::span_context

OpenTelemetry SpanContext interface

A SpanContext represents the portion of a Span which must be serialized and propagated along side of a distributed context. SpanContexts are immutable.

The OpenTelemetry SpanContext representation conforms to the w3c TraceContext specification. It contains two identifiers - a TraceId and a SpanId - along with a set of common TraceFlags and system-specific TraceState values.

The spec can be viewed here: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-tracing.md#spancontext

Structs

SpanContext

Immutable portion of a Span which can be serialized and propagated.

SpanId

SpanId is an 8-byte value which uniquely identifies a given span within a trace The actual u64 value is wrapped in a tuple struct in order to leverage the newtype pattern

TraceId

TraceId is an 16-byte value which uniquely identifies a given trace The actual u128 value is wrapped in a tuple struct in order to leverage the newtype pattern

Constants

TRACE_FLAGS_UNUSED

Useful for extracting trace context

TRACE_FLAG_SAMPLED

TraceFlagsSampled is a byte with sampled bit set. It is a convenient value initializer for SpanContext TraceFlags field when a trace is sampled.