Struct opentelemetry::sdk::trace::Tracer
source · pub struct Tracer { /* private fields */ }
Expand description
Tracer
implementation to create and manage spans
Implementations§
source§impl Tracer
impl Tracer
sourcepub fn provider(&self) -> Option<TracerProvider>
pub fn provider(&self) -> Option<TracerProvider>
TracerProvider associated with this tracer.
sourcepub fn instrumentation_library(&self) -> &InstrumentationLibrary
pub fn instrumentation_library(&self) -> &InstrumentationLibrary
instrumentation library information of this tracer.
Trait Implementations§
source§impl Tracer for Tracer
impl Tracer for Tracer
source§fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Spanwhere
T: Into<Cow<'static, str>>,
fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Spanwhere T: Into<Cow<'static, str>>,
Starts a new Span
with a given context.
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 span_builder<T>(&self, name: T) -> SpanBuilderwhere
T: Into<Cow<'static, str>>,
fn span_builder<T>(&self, name: T) -> SpanBuilderwhere T: Into<Cow<'static, str>>,
Creates a span builder
An ergonomic way for attributes to be configured before the Span
is started.
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<T>(&self, name: T) -> Self::Spanwhere
T: Into<Cow<'static, str>>,
fn start<T>(&self, name: T) -> Self::Spanwhere T: Into<Cow<'static, str>>,
Span
. Read moresource§fn build(&self, builder: SpanBuilder) -> Self::Span
fn build(&self, builder: SpanBuilder) -> Self::Span
Auto Trait Implementations§
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
source§impl<S, T> ObjectSafeTracer for Twhere
S: Span + Send + Sync + 'static,
T: Tracer<Span = S>,
impl<S, T> ObjectSafeTracer for Twhere S: Span + Send + Sync + 'static, T: Tracer<Span = S>,
source§fn start_with_context_boxed(
&self,
name: Cow<'static, str>,
parent_cx: &Context
) -> Box<dyn ObjectSafeSpan + Send + Sync>
fn start_with_context_boxed( &self, name: Cow<'static, str>, parent_cx: &Context ) -> Box<dyn ObjectSafeSpan + Send + Sync>
Returns a trait object so the underlying implementation can be swapped out at runtime.
source§fn build_with_context_boxed(
&self,
builder: SpanBuilder,
parent_cx: &Context
) -> Box<dyn ObjectSafeSpan + Send + Sync>
fn build_with_context_boxed( &self, builder: SpanBuilder, parent_cx: &Context ) -> Box<dyn ObjectSafeSpan + Send + Sync>
Returns a trait object so the underlying implementation can be swapped out at runtime.