pub struct TraceFilterer { /* private fields */ }Expand description
Applies trace-level filters derived from the agent’s /info endpoint configuration:
filter_tags, filter_tags_regex, and ignore_resources.
Filtering is evaluated on the root span of each trace.
Implementations§
Source§impl TraceFilterer
impl TraceFilterer
Sourcepub fn new(
filter_tags_require: &[String],
filter_tags_reject: &[String],
filter_tags_regex_require: &[String],
filter_tags_regex_reject: &[String],
ignore_resources: &[String],
) -> Self
pub fn new( filter_tags_require: &[String], filter_tags_reject: &[String], filter_tags_regex_require: &[String], filter_tags_regex_reject: &[String], ignore_resources: &[String], ) -> Self
Creates a new filterer from the agent’s /info configuration fields.
Invalid regex patterns are logged and skipped rather than causing an error.
Sourcepub fn with_empty_conf() -> Self
pub fn with_empty_conf() -> Self
Creates a no-op filterer that keeps all traces.
Sourcepub fn filter_traces(
&self,
traces: &mut Vec<Vec<Span<impl TraceData>>>,
) -> usize
pub fn filter_traces( &self, traces: &mut Vec<Vec<Span<impl TraceData>>>, ) -> usize
Removes traces that fail filter checks in-place. Returns the number of traces dropped.
Sourcepub fn should_drop<'a>(&self, root_span: &'a impl Span<'a>) -> bool
pub fn should_drop<'a>(&self, root_span: &'a impl Span<'a>) -> bool
Checks if the trace with root span root_span should be dropped based on filter
configuration.
Applies a subset of trace normalization logic from libdd-trace-normalization before
checking.
Trait Implementations§
Source§impl Debug for TraceFilterer
impl Debug for TraceFilterer
Source§impl Default for TraceFilterer
impl Default for TraceFilterer
Source§fn default() -> TraceFilterer
fn default() -> TraceFilterer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TraceFilterer
impl RefUnwindSafe for TraceFilterer
impl Send for TraceFilterer
impl Sync for TraceFilterer
impl Unpin for TraceFilterer
impl UnsafeUnpin for TraceFilterer
impl UnwindSafe for TraceFilterer
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