feat(data-pipeline)!: CSS Trace Filters#1985
Conversation
📚 Documentation Check Results📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🔒 Cargo Deny Results📦
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1985 +/- ##
==========================================
+ Coverage 72.75% 72.94% +0.18%
==========================================
Files 458 460 +2
Lines 75827 76737 +910
==========================================
+ Hits 55169 55974 +805
- Misses 20658 20763 +105
🚀 New features to boost your workflow:
|
|
✨ Fix all issues with BitsAI or with Cursor
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
test: sort stats by resource for deterministic snapshot
…s-trace-filtering
…s-trace-filtering
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e0ff40bf4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // FIXME: when client_computed_top_level is true, looking twice for the root span here is | ||
| // inefficient and just below in process_traces_for_stats. | ||
| // Also, only do it when css is on | ||
| self.trace_filterer.filter_traces(&mut traces); |
There was a problem hiding this comment.
Preserve filtered traces for agent export
When the agent advertises filter_tags or ignore_resources, this mutates the only traces vector before it is passed to stats processing and then serialized/sent to the agent below. These filters are described in this change as client-side-stats filters, so a trace that should be excluded only from stats (for example matching ignore_resources) is now removed from the payload entirely and never reaches the agent/OTLP endpoint, causing trace data loss whenever CSS filters are configured. Apply the filter only to a stats-only copy/path, not the export path.
Useful? React with 👍 / 👎.
| fn check_agent_info(&self) { | ||
| if let Some(agent_info) = agent_info::get_agent_info() { | ||
| if self.has_agent_info_state_changed(&agent_info) { | ||
| // FIXME: trace_filterer should only be enabled when CSS is on. (why ?) |
There was a problem hiding this comment.
To my understanding this feature is a pre-requisite for filtering of stats to work, but it's a standalone feature, per se?
There was a problem hiding this comment.
I agree but it increases the risk in case the implementation is wrong: if we drop more trace than what the agent would have dropped it would affect everyone but if we apply filters only with CSS this only affects a small subset of users.
What does this PR do?
Implements the CSS trace-level filtering mechanism, that is applied before stats computation.
Motivation
It's un unmet requirement from the spec.
Additional Notes
Please Ctrl+F
FIXMEwhen reviewing, I let some questions in the code that I'd like answers for before mergingTODO:
APMSP-2763