fix!: css obfuscation logic#2203
Conversation
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. |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: ef49c67 | Docs | Datadog PR Page | Give us feedback! |
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
|
This reverts commit a0bfe8c.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85eaf0cd6f
ℹ️ 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".
it got introduced by mistake in 3d8ec6c
There was a problem hiding this comment.
Pull request overview
This PR updates client-side trace-stats obfuscation to be CSS-spec compliant by tightening the agent-version gate and ensuring obfuscated and non-obfuscated stats are never mixed within the same bucket or payload (including during forced flush/shutdown).
Changes:
- Require an exact obfuscation-version match (instead of a supported range) before enabling client-side obfuscation.
- Track obfuscation state per stats bucket and prevent flushing mixed obfuscation states in a single payload; force-flush may emit up to two payloads to drain both states.
- Adjust exporter/header behavior and update concentrator APIs/callers accordingly (including SHM and OTLP paths), plus remove an unused
results.xml.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libdd-trace-stats/src/stats_exporter.rs | Flush/send logic updated to potentially emit two payloads on force flush; obfuscation header now driven by bucket state. |
| libdd-trace-stats/src/span_concentrator/mod.rs | Adds per-bucket obfuscation state and changes flushing to avoid mixing obfuscation states. |
| libdd-trace-stats/src/span_concentrator/aggregation.rs | Extends StatsBucket to record whether the bucket is obfuscated (when the feature is enabled). |
| libdd-trace-stats/src/span_concentrator/tests.rs | Updates tests for updated concentrator flush return signature / OTLP flush API. |
| libdd-data-pipeline/src/trace_exporter/stats.rs | Tightens obfuscation-activation predicate and updates worker construction for the new exporter API. |
| libdd-data-pipeline/src/otlp/metrics.rs | Adapts to flush_with_otlp_exact API change (now returns buckets directly). |
| libdd-data-pipeline/results.xml | Removes an unused file from the data-pipeline crate. |
| datadog-sidecar/src/service/stats_flusher.rs | Updates sidecar exporter construction for the new exporter API (no client-side obfuscation header). |
| datadog-ipc/src/shm_stats.rs | Updates SHM concentrator flush API to return the new (…, …, buckets_obfuscated) tuple. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // We flush twice with `force_flush` so that if we have a mix of obfuscated and unobfuscated | ||
| // buckets, both get flushed in separate payloads | ||
| let flush_count = if force_flush { 2 } else { 1 }; | ||
| let mut sent_stats = false; | ||
| for _ in 0..flush_count { | ||
| let (payload, collapsed_spans, buckets_obfuscated) = self.flush(force_flush); |
|
/remove |
|
View all feedbacks in Devflow UI.
|
2c8f114 to
7538b80
Compare
7538b80 to
35d265b
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit c9d1f44: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
What does this PR do?
Motivation
Additional Notes
results.xmlfile is an unrelated change but making a PR for it would've been overkill.How to test the change?
APMSP-2985