[Stats] Fix partial_version exclusion: use >= 0 instead of > 0#8776
Conversation
This comment has been minimized.
This comment has been minimized.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8776) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (72ms) : 70, 75
master - mean (73ms) : 70, 77
section Bailout
This PR (8776) - mean (77ms) : 73, 81
master - mean (76ms) : 74, 78
section CallTarget+Inlining+NGEN
This PR (8776) - mean (1,093ms) : 1049, 1137
master - mean (1,095ms) : 1041, 1150
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (113ms) : 109, 116
master - mean (114ms) : 108, 120
section Bailout
This PR (8776) - mean (118ms) : 113, 123
master - mean (113ms) : 111, 116
section CallTarget+Inlining+NGEN
This PR (8776) - mean (794ms) : 771, 816
master - mean (793ms) : 767, 818
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (100ms) : 97, 103
master - mean (100ms) : 96, 104
section Bailout
This PR (8776) - mean (103ms) : 97, 108
master - mean (103ms) : 99, 108
section CallTarget+Inlining+NGEN
This PR (8776) - mean (943ms) : 905, 980
master - mean (944ms) : 902, 986
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (100ms) : 95, 105
master - mean (99ms) : 95, 102
section Bailout
This PR (8776) - mean (99ms) : 98, 101
master - mean (99ms) : 97, 101
section CallTarget+Inlining+NGEN
This PR (8776) - mean (823ms) : 774, 872
master - mean (821ms) : 782, 860
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (198ms) : 191, 205
master - mean (200ms) : 192, 207
section Bailout
This PR (8776) - mean (201ms) : 196, 207
master - mean (203ms) : 198, 208
section CallTarget+Inlining+NGEN
This PR (8776) - mean (1,194ms) : 1155, 1232
master - mean (1,198ms) : 1157, 1240
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (284ms) : 277, 291
master - mean (284ms) : 277, 292
section Bailout
This PR (8776) - mean (285ms) : 278, 293
master - mean (286ms) : 281, 291
section CallTarget+Inlining+NGEN
This PR (8776) - mean (957ms) : 936, 978
master - mean (959ms) : 940, 978
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (278ms) : 270, 285
master - mean (279ms) : 274, 284
section Bailout
This PR (8776) - mean (277ms) : 270, 285
master - mean (278ms) : 274, 283
section CallTarget+Inlining+NGEN
This PR (8776) - mean (1,158ms) : 1120, 1196
master - mean (1,160ms) : 1125, 1196
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8776) - mean (276ms) : 269, 284
master - mean (276ms) : 270, 281
section Bailout
This PR (8776) - mean (276ms) : 272, 280
master - mean (277ms) : 273, 280
section CallTarget+Inlining+NGEN
This PR (8776) - mean (1,039ms) : 989, 1090
master - mean (1,040ms) : 1003, 1078
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-06-11 10:05:29 Comparing candidate commit 53a35ff in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 63 known flaky benchmarks, 63 flaky benchmarks without significant changes.
|
There was a problem hiding this comment.
Pull request overview
This PR aligns StatsAggregator with the CSS v1.2.0 spec by excluding spans from stats when _dd.partial_version is present and >= 0, fixing the prior behavior that incorrectly included spans with _dd.partial_version = 0.
Changes:
- Update stats exclusion logic to treat
_dd.partial_version = 0as excluded (>= 0instead of> 0). - Add a regression unit test (
TS014) to ensure spans with_dd.partial_version = 0are excluded from stats aggregation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tracer/src/Datadog.Trace/Agent/StatsAggregator.cs |
Fixes exclusion condition so spans with _dd.partial_version >= 0 are not included in stats buckets. |
tracer/test/Datadog.Trace.Tests/Agent/StatsAggregatorTests.cs |
Adds a unit test validating the new exclusion behavior for _dd.partial_version = 0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andrewlock
left a comment
There was a problem hiding this comment.
LGTM, I wonder if this should be tested in system tests too?
It is already tested, and once this fix lands we can remove this from the manifest: https://github.com/DataDog/system-tests/blob/main/manifests/dotnet.yml#L885 |
CSS v1.2.0 spec §7 requires spans with `_dd.partial_version` >= 0 to be excluded from stats, but `StatsAggregator.cs` used `> 0`, silently including spans with value 0. This changes the check to `>= 0`. In C# with `double?`, `null >= 0` is false, so spans without the metric are correctly included. Adds a unit test (`TS014`) for the value=0 case. Tracked in [APMSP-3045](https://datadoghq.atlassian.net/browse/APMSP-3045); context in the [CSS v1.2.0 Implementation Status](https://datadoghq.atlassian.net/wiki/spaces/APM/pages/6378587288/Implementation+Status). [APMSP-3045]: https://datadoghq.atlassian.net/browse/APMSP-3045?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
CSS v1.2.0 spec §7 requires spans with
_dd.partial_version>= 0 to be excluded from stats, butStatsAggregator.csused> 0, silently including spans with value 0. This changes the check to>= 0. In C# withdouble?,null >= 0is false, so spans without the metric are correctly included. Adds a unit test (TS014) for the value=0 case. Tracked in APMSP-3045; context in the CSS v1.2.0 Implementation Status.