[][src]Trait opentelemetry::api::trace::sampler::Sampler

pub trait Sampler: Send + Sync + Debug {
    fn should_sample(
        &self,
        parent_context: Option<&SpanContext>,
        trace_id: TraceId,
        span_id: SpanId,
        name: &str,
        span_kind: &SpanKind,
        attributes: &[KeyValue],
        links: &[Link]
    ) -> SamplingResult; }

The Sampler interface allows implementations to provide samplers which will return a sampling SamplingResult based on information that is typically available just before the Span was created.

Required methods

fn should_sample(
    &self,
    parent_context: Option<&SpanContext>,
    trace_id: TraceId,
    span_id: SpanId,
    name: &str,
    span_kind: &SpanKind,
    attributes: &[KeyValue],
    links: &[Link]
) -> SamplingResult

Returns the SamplingDecision for a Span to be created.

Loading content...

Implementors

impl Sampler for Sampler[src]

Loading content...