pub struct TracingContext(Context);
Expand description
Context for tracing used for propagating tracing information in a distributed system.
Generally, the caller of a service should create a tracing context from the current tracing span and pass it to the callee through the network. The callee will then attach its local tracing span as a child of the tracing context, so that the external tracing service can associate them in a single trace.
The tracing context must be serialized into the W3C trace context format and passed in rpc message headers when communication of frontend, datanode and meta.
See Trace Context for more information.
Tuple Fields§
§0: Context
Implementations§
source§impl TracingContext
impl TracingContext
sourcepub fn from_current_span() -> Self
pub fn from_current_span() -> Self
Create a new tracing context from the current tracing span considered by the subscriber.
sourcepub fn attach(&self, span: Span) -> Span
pub fn attach(&self, span: Span) -> Span
Attach the given span as a child of the context. Returns the attached span.
sourcepub fn from_w3c(fields: &W3cTrace) -> Self
pub fn from_w3c(fields: &W3cTrace) -> Self
Create a new tracing context from the W3C trace context format.
Trait Implementations§
source§impl Clone for TracingContext
impl Clone for TracingContext
source§fn clone(&self) -> TracingContext
fn clone(&self) -> TracingContext
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TracingContext
impl Debug for TracingContext
Auto Trait Implementations§
impl Freeze for TracingContext
impl !RefUnwindSafe for TracingContext
impl Send for TracingContext
impl Sync for TracingContext
impl Unpin for TracingContext
impl !UnwindSafe for TracingContext
Blanket Implementations§
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request