Struct TraceContextPropagator
pub struct TraceContextPropagator { /* private fields */ }Expand description
Propagates SpanContexts 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§
§impl TraceContextPropagator
impl TraceContextPropagator
pub fn new() -> TraceContextPropagator
pub fn new() -> TraceContextPropagator
Create a new TraceContextPropagator.
Trait Implementations§
§impl Clone for TraceContextPropagator
impl Clone for TraceContextPropagator
§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 more§impl Debug for TraceContextPropagator
impl Debug for TraceContextPropagator
§impl Default for TraceContextPropagator
impl Default for TraceContextPropagator
§fn default() -> TraceContextPropagator
fn default() -> TraceContextPropagator
§impl TextMapPropagator for TraceContextPropagator
impl TextMapPropagator for TraceContextPropagator
§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.
§fn extract_with_context(
&self,
cx: &Context,
extractor: &dyn Extractor,
) -> Context
fn extract_with_context( &self, cx: &Context, extractor: &dyn Extractor, ) -> Context
Retrieves encoded SpanContexts 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.
§fn fields(&self) -> FieldIter<'_> ⓘ
fn fields(&self) -> FieldIter<'_> ⓘ
TextMapPropagatorAuto Trait Implementations§
impl Freeze for TraceContextPropagator
impl RefUnwindSafe for TraceContextPropagator
impl Send for TraceContextPropagator
impl Sync for TraceContextPropagator
impl Unpin for TraceContextPropagator
impl UnwindSafe for TraceContextPropagator
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more