logo
pub enum Sampler {
    AlwaysOn,
    AlwaysOff,
    ParentBased(Box<Sampler>),
    TraceIdRatioBased(f64),
}
Expand description

Sampling options

Variants

AlwaysOn

Always sample the trace

AlwaysOff

Never sample the trace

ParentBased(Box<Sampler>)

Respects the parent span’s sampling decision or delegates a delegate sampler for root spans.

TraceIdRatioBased(f64)

Sample a given fraction of traces. Fractions >= 1 will always sample. If the parent span is sampled, then it’s child spans will automatically be sampled. Fractions < 0 are treated as zero, but spans may still be sampled if their parent is.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the SamplingDecision for a Span to be created.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.