pub struct TraceContextPropagator { /* private fields */ }
Expand description
Propagates SpanContext
s in W3C TraceContext format under traceparent
and tracestate
header.
The traceparent
header represents the incoming request in a
tracing system in a common format, understood by all vendors.
Here’s an example of a traceparent
header.
traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
The traceparent
HTTP header field identifies the incoming request in a
tracing system. It has four fields:
- version
- trace-id
- parent-id
- trace-flags
The tracestate
header provides additional vendor-specific trace
identification information across different distributed tracing systems.
Here’s an example of a tracestate
header
tracestate: vendorname1=opaqueValue1,vendorname2=opaqueValue2
See the w3c trace-context docs for more details.
Implementations§
Trait Implementations§
Source§impl Clone for TraceContextPropagator
impl Clone for TraceContextPropagator
Source§fn clone(&self) -> TraceContextPropagator
fn clone(&self) -> TraceContextPropagator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TraceContextPropagator
impl Debug for TraceContextPropagator
Source§impl Default for TraceContextPropagator
impl Default for TraceContextPropagator
Source§fn default() -> TraceContextPropagator
fn default() -> TraceContextPropagator
Source§impl TextMapPropagator for TraceContextPropagator
impl TextMapPropagator for TraceContextPropagator
Source§fn inject_context(&self, cx: &Context, injector: &mut dyn Injector)
fn inject_context(&self, cx: &Context, injector: &mut dyn Injector)
Properly encodes the values of the SpanContext
and injects them
into the Injector
.
Source§fn extract_with_context(
&self,
cx: &Context,
extractor: &dyn Extractor,
) -> Context
fn extract_with_context( &self, cx: &Context, extractor: &dyn Extractor, ) -> Context
Retrieves encoded SpanContext
s using the Extractor
. It decodes
the SpanContext
and returns it. If no SpanContext
was retrieved
OR if the retrieved SpanContext is invalid then an empty SpanContext
is returned.
Source§fn fields(&self) -> FieldIter<'_>
fn fields(&self) -> FieldIter<'_>
TextMapPropagator