pub struct Tracer { /* private fields */ }Expand description
Implementations§
Source§impl Tracer
impl Tracer
pub fn pipeline(&self) -> &Pipeline
pub fn scope(&self) -> &InstrumentationScope
Sourcepub fn build_with_root(
&self,
builder: SpanBuilder,
parent_cx: &Context,
root: TraceRoot<'_>,
) -> Span
pub fn build_with_root( &self, builder: SpanBuilder, parent_cx: &Context, root: TraceRoot<'_>, ) -> Span
build_with_context,
a new trace’s sampled flag decided by the rule for root.
Sourcepub fn build_sampled(&self, builder: SpanBuilder, parent_cx: &Context) -> Span
pub fn build_sampled(&self, builder: SpanBuilder, parent_cx: &Context) -> Span
build_with_context,
a new trace sampled whatever the head sampler’s rules say. Under a
valid parent the span follows the parent’s flags all the same.
Sourcepub fn build_with_sampling(
&self,
builder: SpanBuilder,
parent_cx: &Context,
sampled: bool,
) -> Span
pub fn build_with_sampling( &self, builder: SpanBuilder, parent_cx: &Context, sampled: bool, ) -> Span
A new trace with the chosen sampled bit, ignoring head rules. A valid parent still supplies its context and flags.
Trait Implementations§
Source§impl Tracer for Tracer
impl Tracer for Tracer
Source§fn build_with_context(&self, builder: SpanBuilder, parent_cx: &Context) -> Span
fn build_with_context(&self, builder: SpanBuilder, parent_cx: &Context) -> Span
Starts a span under parent_cx. An unsampled span is non-recording
but has IDs, so context propagates. A new trace is sampled by the
rule for the endpoint of the service this process hosts (see
HeadSampler::with_service).
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.Source§fn in_span<T, F, N>(&self, name: N, f: F) -> T
fn in_span<T, F, N>(&self, name: N, f: F) -> T
Start a new span and execute the given closure with reference to the context
in which the span is active. Read more
Source§fn in_span_with_context<T, F, N>(&self, name: N, parent_cx: &Context, f: F) -> T
fn in_span_with_context<T, F, N>(&self, name: N, parent_cx: &Context, f: F) -> T
Start a new span with a given parent context and execute the given closure with
reference to the context in which the span is active. Read more
Source§fn in_span_with_builder<T, F>(&self, builder: SpanBuilder, f: F) -> T
fn in_span_with_builder<T, F>(&self, builder: SpanBuilder, f: F) -> T
Start a new span from a
SpanBuilder and execute the given closure with
reference to the context in which the span is active. Read moreSource§fn in_span_with_builder_and_context<T, F>(
&self,
builder: SpanBuilder,
parent_cx: &Context,
f: F,
) -> T
fn in_span_with_builder_and_context<T, F>( &self, builder: SpanBuilder, parent_cx: &Context, f: F, ) -> T
Start a new span from a
SpanBuilder with a given parent context and execute the
given closure with reference to the context in which the span is active. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Tracer
impl !UnwindSafe for Tracer
impl Forget for Tracer
impl Freeze for Tracerwhere
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<InstrumentationScope> is !null: Freeze,
PhantomData<ArcInner<InstrumentationScope>>: Freeze,
impl Move for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl UnsafeUnpin for Tracerwhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<InstrumentationScope> is !null: UnsafeUnpin,
PhantomData<ArcInner<InstrumentationScope>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§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::RequestCreates a shared type from an unshared type.
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.