pub trait Sampler<T>: Debug {
// Required method
fn is_sampled(&self, span: &CandidateSpan<'_, T>) -> bool;
// Provided methods
fn or<U>(self, other: U) -> OrSampler<Self, U>
where Self: Sized,
U: Sampler<T> { ... }
fn and<U>(self, other: U) -> AndSampler<Self, U>
where Self: Sized,
U: Sampler<T> { ... }
fn boxed(self) -> BoxSampler<T>
where Self: Sized + Send + Sync + 'static { ... }
}Expand description
Sampler decides whether a new trace should be sampled or not.
Required Methods§
Sourcefn is_sampled(&self, span: &CandidateSpan<'_, T>) -> bool
fn is_sampled(&self, span: &CandidateSpan<'_, T>) -> bool
This method decides whether a trace with given span should be sampled.
Provided Methods§
Sourcefn or<U>(self, other: U) -> OrSampler<Self, U>
fn or<U>(self, other: U) -> OrSampler<Self, U>
Returns the sampler that samples a trace if self or other decides to sample it.
Sourcefn and<U>(self, other: U) -> AndSampler<Self, U>
fn and<U>(self, other: U) -> AndSampler<Self, U>
Returns the sampler that samples a trace if both of self and other decides to sample it.