pub struct DatadogSampler { /* private fields */ }Expand description
A composite sampler that applies rules in order of precedence
Implementations§
Source§impl DatadogSampler
impl DatadogSampler
Sourcepub fn new(rules: Vec<SamplingRule>, rate_limit: i32) -> Self
pub fn new(rules: Vec<SamplingRule>, rate_limit: i32) -> Self
Creates a new DatadogSampler with the given rules
pub fn on_agent_response(&self) -> Box<dyn for<'a> Fn(&'a str) + Send + Sync>
Sourcepub fn on_rules_update(&self) -> SamplingRulesCallback
pub fn on_rules_update(&self) -> SamplingRulesCallback
Creates a callback for updating sampling rules from remote configuration.
§Returns
A boxed function that takes a slice of SamplingRuleConfig and updates the sampling rules.
Sourcepub fn sample(&self, data: &impl SamplingData) -> DdSamplingResult
pub fn sample(&self, data: &impl SamplingData) -> DdSamplingResult
Sample an incoming span based on the parent context and attributes.
If a parent sampling decision is present it is inherited; otherwise the root-span
sampling pipeline is run via Self::sample_root.
Trait Implementations§
Source§impl Clone for DatadogSampler
impl Clone for DatadogSampler
Source§fn clone(&self) -> DatadogSampler
fn clone(&self) -> DatadogSampler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DatadogSampler
impl RefUnwindSafe for DatadogSampler
impl Send for DatadogSampler
impl Sync for DatadogSampler
impl Unpin for DatadogSampler
impl UnsafeUnpin for DatadogSampler
impl UnwindSafe for DatadogSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more