Fix tracestats bucket-boundary flakes (TS003/4/9) #8519
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 413 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #8519"
general
weight: 0.35
ichinaski
<!-- dd-meta {"pullId":"8ffc9de6-9caf-44d4-818d-71a5df5180c9","source":"chat","resourceId":"40b5946d-f1ed-43a7-93a9-08eccbaf8400","workflowId":"10fa511e-b9fa-410c-bc90-b25b217c0755","codeChangeId":"10fa511e-b9fa-410c-bc90-b25b217c0755","sourceType":"code_channel"} -->
Motivation
This came out of the test failure triage for the Language Platform Green CI SLI report (Nov 13–15). The only LP failure was
Test_Library_Tracestats::test_metrics_computed_after_span_finsh_TS009on nodejs 6.24.0 (Nightly, 2026-11-13). It failed withThere should be one bucket containing the stats/assert 2 == 1.Client-side stats are grouped into 10s time buckets. When the spans of a test finish on both sides of a bucket boundary, the library reports them in two buckets, and the test fails. The cause is the test, not the tracer. The same failure hit TS003 (nodejs, golang) and TS004 (golang): at least 4 failures in the last 90 days. On nodejs, TS003 was marked
flaky (APMLP-2085)for this reason, so it has not run since Oct 20.Changes
tests/parametric/test_library_tracestats.py: new_merged_v06_statshelper. It merges the decoded stats entries of every request and every time bucket by aggregation key, and sums their counters (Hits, TopLevelHits, Duration, Errors). Within a single bucket it still requires one entry per key, so a library that fails to aggregate is still caught.[0]. The checks on counters and dimensions are unchanged. TS009 still fails if a span's aggregation key changes after finish.manifests/nodejs.yml: removed theflaky (APMLP-2085)entry on TS003 (>=6.21.0), because this fixes its cause. APMLP-2085 can be closed once this is merged.Testing:
-lint manifests/, yamllint, andutils/manifest/format.py/validate.pyall pass.Follow-ups, not in this PR:
Workflow
1. ⚠️ Create your PR as draft ⚠️
2. Work on you PR until the CI passes
3. Mark it as ready for review
Tests, manifest, weblog are modified -> you'll need a review from
system-tests-reviewers: ask to one of youre co-worker familiar with the tested feature.Framework is modified, or non obvious usage of it -> get a review from
system-tests-core(slack):rocket: Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
🤖 Generated with <span>Claude Code</span> (<span>https://claude.com/claude-code</span>)
---
PR by Bits - View session in Datadog • Open in Slack
Comment @datadog to request changes