Struct opentelemetry_sdk::trace::Tracer
source · pub struct Tracer { /* private fields */ }
Available on crate feature
trace
only.Expand description
Tracer
implementation to create and manage spans
Trait Implementations§
source§impl Tracer for Tracer
impl Tracer for Tracer
source§fn build_with_context(
&self,
builder: SpanBuilder,
parent_cx: &Context,
) -> Self::Span
fn build_with_context( &self, builder: SpanBuilder, parent_cx: &Context, ) -> Self::Span
Starts a span from a SpanBuilder
.
Each span has zero or one parent spans and zero or more child spans, which represent causally related operations. A tree of related spans comprises a trace. A span is said to be a root span if it does not have a parent. Each trace includes a single root span, which is the shared ancestor of all other spans in the trace.
source§fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Span
fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Span
source§fn span_builder<T>(&self, name: T) -> SpanBuilder
fn span_builder<T>(&self, name: T) -> SpanBuilder
Creates a span builder. Read more
source§fn build(&self, builder: SpanBuilder) -> Self::Span
fn build(&self, builder: SpanBuilder) -> Self::Span
Start a
Span
from a SpanBuilder
.Auto Trait Implementations§
impl Freeze for Tracer
impl !RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl !UnwindSafe for Tracer
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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<S, T> ObjectSafeTracer for T
impl<S, T> ObjectSafeTracer for T
source§fn build_with_context_boxed(
&self,
builder: SpanBuilder,
parent_cx: &Context,
) -> Box<dyn ObjectSafeSpan + Sync + Send>
fn build_with_context_boxed( &self, builder: SpanBuilder, parent_cx: &Context, ) -> Box<dyn ObjectSafeSpan + Sync + Send>
Returns a trait object so the underlying implementation can be swapped out at runtime.