This is supported on crate feature
trace
only.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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
fn should_sample(
&self,
parent_context: Option<&Context>,
trace_id: TraceId,
name: &str,
span_kind: &SpanKind,
attributes: &[KeyValue],
links: &[Link],
instrumentation_library: &InstrumentationLibrary
) -> SamplingResult
fn should_sample(
&self,
parent_context: Option<&Context>,
trace_id: TraceId,
name: &str,
span_kind: &SpanKind,
attributes: &[KeyValue],
links: &[Link],
instrumentation_library: &InstrumentationLibrary
) -> SamplingResult
Returns the SamplingDecision
for a Span
to be created.
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
Mutably borrows from an owned value. Read more