Skip to content

fix(stats): Check v1 trace requests for client drop P0s. - #7419

Merged
AlexeyKuznetsov-DD merged 1 commit into
mainfrom
alexeyk/fix-client-drop-p0s-v1-traces
Jul 30, 2026
Merged

fix(stats): Check v1 trace requests for client drop P0s.#7419
AlexeyKuznetsov-DD merged 1 commit into
mainfrom
alexeyk/fix-client-drop-p0s-v1-traces

Conversation

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor

Motivation

The client-drop-P0s test only checks legacy trace endpoints, so it fails when dd-trace-java uses /v1.0/traces by default.

Changes

Check /v1.0/traces when validating the Datadog-Client-Computed-Stats header.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner July 30, 2026 00:51
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/stats/test_stats.py                                               @DataDog/system-tests-core

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 30, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 1 Pipeline job failed

Testing the test | all-jobs-are-green   View in Datadog   GitHub Actions

See error CI checks failed; see summary table for details.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 22b4417 | Docs | Datadog PR Page | Give us feedback!

@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD merged commit ff89115 into main Jul 30, 2026
816 of 818 checks passed
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD deleted the alexeyk/fix-client-drop-p0s-v1-traces branch July 30, 2026 13:24
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants