tracing_distributed

Trait Telemetry

Source
pub trait Telemetry {
    type Visitor: Visit;
    type TraceId: Send + Sync + Clone;
    type SpanId: Send + Sync + Clone;

    // Required methods
    fn mk_visitor(&self) -> Self::Visitor;
    fn report_span(
        &self,
        span: Span<Self::Visitor, Self::SpanId, Self::TraceId>,
    );
    fn report_event(
        &self,
        event: Event<Self::Visitor, Self::SpanId, Self::TraceId>,
    );
}
Expand description

Represents the ability to publish events and spans to some arbitrary backend.

Required Associated Types§

Source

type Visitor: Visit

Type used to record tracing fields.

Source

type TraceId: Send + Sync + Clone

Globally unique identifier, uniquely identifies a trace.

Source

type SpanId: Send + Sync + Clone

Identifies spans within a trace.

Required Methods§

Source

fn mk_visitor(&self) -> Self::Visitor

Initialize a visitor, used to record values from spans and events as they are observed

Source

fn report_span(&self, span: Span<Self::Visitor, Self::SpanId, Self::TraceId>)

Report a Span to this Telemetry instance’s backend.

Source

fn report_event(&self, event: Event<Self::Visitor, Self::SpanId, Self::TraceId>)

Report an Event to this Telemetry instance’s backend.

Implementors§

Source§

impl<SpanId, TraceId> Telemetry for BlackholeTelemetry<SpanId, TraceId>
where SpanId: 'static + Clone + Send + Sync, TraceId: 'static + Clone + Send + Sync,

Source§

type Visitor = BlackholeVisitor

Source§

type TraceId = TraceId

Source§

type SpanId = SpanId