fix(stats): Check v1 trace requests for client drop P0s. - #7419
Merged
Conversation
Contributor
|
|
|
nccatoni
approved these changes
Jul 30, 2026
This was referenced Aug 4, 2026
darccio
added a commit
that referenced
this pull request
Aug 7, 2026
CSS and the ETP/v1 trace protocol were only ever exercised separately. No scenario configured both, so the combination was reached solely by accident, via whichever protocol a tracer happened to default to. That is how #7419 happened: dd-trace-java started defaulting to /v1.0/traces and Test_Client_Drop_P0s broke, because it only looked at legacy trace endpoints. The two features do interact. CSS drops P0s client-side, changing which traces are emitted, while ETP/v1 changes how they are encoded. Both act on the same trace-emission path, so the intersection deserves explicit coverage rather than incidental coverage. Add TRACE_STATS_COMPUTATION_V1: identical to TRACE_STATS_COMPUTATION apart from the trace protocol, so a failure there points at a CSS/ETP interaction and not at a sampling or obfuscation difference. Run the format-sensitive stats classes in it: Test_Client_Stats (hit and top-level-hit counting plus IsTraceRoot, which depend on top-level span detection that v1 relocates into `attributes`), Test_Peer_Tags (peer tag extraction from span structure) and Test_Transport_Headers (stats request headers). Test_Time_Bucketing is left out as timing-sensitive, and Test_Agent_Info_Endpoint as format-independent. Also fix the endpoint probing in Test_Client_Drop_P0s. The sequential `if len(...) == 0` chain stopped at the first non-empty endpoint, so a tracer emitting on both v0.4 and v1.0 only had v0.4 header-checked. get_data accepts a list of path filters and matches any of them, so all trace payloads are now collected and every one is verified. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
client-drop-P0stest only checks legacy trace endpoints, so it fails whendd-trace-javauses/v1.0/tracesby default.Changes
Check
/v1.0/traceswhen validating theDatadog-Client-Computed-Statsheader.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present