[][src]Struct opentelemetry::global::BoxedTracer

pub struct BoxedTracer(_);

Wraps the GlobalProvider's Tracer so it can be used generically by applications without knowing the underlying type.

Trait Implementations

impl Debug for BoxedTracer[src]

impl Tracer for BoxedTracer[src]

type Span = BoxedSpan

Global tracer uses BoxedSpans so that it can be a global singleton, which is not possible if it takes generic type parameters.

fn invalid(&self) -> Self::Span[src]

Returns a span with an inactive SpanContext. Used by functions that need to return a default span like get_active_span if no span is present.

fn start(&self, name: &str, parent_span: Option<SpanContext>) -> Self::Span[src]

Starts a new Span.

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.

fn span_builder(&self, name: &str) -> SpanBuilder[src]

Creates a span builder

An ergonomic way for attributes to be configured before the Span is started.

fn build(&self, builder: SpanBuilder) -> Self::Span[src]

Create a span from a SpanBuilder

fn get_active_span(&self) -> Self::Span[src]

Returns the current active span.

When getting the current Span, the Tracer will return a placeholder Span with an invalid SpanContext if there is no currently active Span.

fn mark_span_as_active(&self, span: &Self::Span)[src]

Mark a given Span as active.

fn mark_span_as_inactive(&self, span_id: SpanId)[src]

Mark a given Span as inactive.

fn clone_span(&self, span: &Self::Span) -> Self::Span[src]

Clone span

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<S, T> GenericTracer for T where
    S: Span,
    T: Tracer<Span = S>, 
[src]

fn invalid_boxed(&Self) -> Box<dyn Span + 'static>[src]

Create a new invalid span for use in cases where there are no active spans.

fn start_boxed(&Self, &str, Option<SpanContext>) -> Box<dyn Span + 'static>[src]

Returns a trait object so the underlying implementation can be swapped out at runtime.

fn build_boxed(&Self, SpanBuilder) -> Box<dyn Span + 'static>[src]

Returns a trait object so the underlying implementation can be swapped out at runtime.

fn get_active_span_boxed(&Self) -> Box<dyn Span + 'static>[src]

Returns the current active span.

fn mark_span_as_active_boxed(&Self, &(dyn Span + 'static))[src]

Mark span as active.

fn mark_span_as_inactive_boxed(&Self, SpanId)[src]

Mark span as inactive.

fn clone_span_boxed(&Self, &(dyn Span + 'static)) -> Box<dyn Span + 'static>[src]

Clone span

impl<F> Instrument for F[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S> TracerGenerics for S where
    S: Tracer
[src]

fn with_span<T, F>(&Self, &'static str, F) -> T where
    F: FnOnce(&<S as Tracer>::Span) -> T, 
[src]

Wraps the execution of the function body with a span. It starts a new span and sets it as the active span for the given function. It then executes the body. It closes the span before returning the execution result.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,