Struct mz_ore::tracing::OpenTelemetryContext
source · pub struct OpenTelemetryContext {
inner: BTreeMap<String, String>,
}
Available on crate feature
tracing_
only.Expand description
An OpenTelemetry context.
Allows associating tracing
spans across task or thread boundaries.
Fields§
§inner: BTreeMap<String, String>
Implementations§
source§impl OpenTelemetryContext
impl OpenTelemetryContext
sourcepub fn attach_as_parent(&self)
pub fn attach_as_parent(&self)
Attaches this Context
to the current tracing
span,
as its parent.
If there is not enough information in this OpenTelemetryContext
to create a context, then the current thread’s Context
is used
defaulting to the default Context
.
sourcepub fn attach_as_parent_to(&self, span: &Span)
pub fn attach_as_parent_to(&self, span: &Span)
Attaches this Context
to the given tracing
Span, as its parent.
as its parent.
If there is not enough information in this OpenTelemetryContext
to create a context, then the current thread’s Context
is used
defaulting to the default Context
.
Trait Implementations§
source§impl Clone for OpenTelemetryContext
impl Clone for OpenTelemetryContext
source§fn clone(&self) -> OpenTelemetryContext
fn clone(&self) -> OpenTelemetryContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OpenTelemetryContext
impl Debug for OpenTelemetryContext
source§impl<'de> Deserialize<'de> for OpenTelemetryContext
impl<'de> Deserialize<'de> for OpenTelemetryContext
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Extractor for OpenTelemetryContext
impl Extractor for OpenTelemetryContext
source§impl From<OpenTelemetryContext> for BTreeMap<String, String>
impl From<OpenTelemetryContext> for BTreeMap<String, String>
source§fn from(ctx: OpenTelemetryContext) -> Self
fn from(ctx: OpenTelemetryContext) -> Self
Converts to this type from the input type.
source§impl Injector for OpenTelemetryContext
impl Injector for OpenTelemetryContext
source§impl PartialEq for OpenTelemetryContext
impl PartialEq for OpenTelemetryContext
source§impl Serialize for OpenTelemetryContext
impl Serialize for OpenTelemetryContext
impl StructuralPartialEq for OpenTelemetryContext
Auto Trait Implementations§
impl Freeze for OpenTelemetryContext
impl RefUnwindSafe for OpenTelemetryContext
impl Send for OpenTelemetryContext
impl Sync for OpenTelemetryContext
impl Unpin for OpenTelemetryContext
impl UnwindSafe for OpenTelemetryContext
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Wrap the input message
T
in a tonic::Request