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 filter_traces_v1<T: TraceData>(
&self,
traces: &mut Vec<TraceChunk<T>>,
) -> usize
pub fn filter_traces_v1<T: TraceData>( &self, traces: &mut Vec<TraceChunk<T>>, ) -> usize
V1 counterpart of Self::filter_traces: removes chunks that fail filter checks
in-place. Returns the number of chunks 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.