Skip to content

Fix processing pipeline for client-side-stats#8436

Open
andrewlock wants to merge 7 commits intoandrew/client-side-stats/refactor-trace-chunk-modelfrom
andrew/client-side-stats/update-processing-pipeline
Open

Fix processing pipeline for client-side-stats#8436
andrewlock wants to merge 7 commits intoandrew/client-side-stats/refactor-trace-chunk-modelfrom
andrew/client-side-stats/update-processing-pipeline

Conversation

@andrewlock
Copy link
Copy Markdown
Member

@andrewlock andrewlock commented Apr 9, 2026

Summary of changes

Updates the processing pipeline for client side stats

Reason for change

The bulk of the CSS 1.2.0 work was done in #8420, but the span-processing pipeline wasn't the same as the Go agent:

Step Go Agent .NET Tracer
1 Normalize Normalize + Obfuscate (ProcessTrace)
2 Filter Filter + Sample (ShouldKeepTrace)
3 Obfuscate
4 Sample
5 Stats Stats (AddRange)

Implementation details

The difference was mostly due to the way we had separate ProcessTrace() and ShouldKeepTrace() methods. By merging them, we can encapsulate the pipeline, and ensure that we mirror the way the Go agent processes traces.

Additionally, there are two different mechanisms for dropping spans now - p0drops and "trace filtering", so added a new metric tag reason:trace_filter for it.

Additionally, made some small optimizations:

  • No need for an array of ITraceProcessor when it only contains one
  • Updated TraceFilter algorithm to correctly look for local trace root, starting from last span
  • Made _statsAggregator non-null in AgentWriter to eliminate a bunch of null checks

Test coverage

Covered by existing tests.

Other details

Part of a stack:

@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:refactor labels Apr 9, 2026
@andrewlock andrewlock force-pushed the andrew/client-side-stats/update-processing-pipeline branch from 0b9d17e to 833ad62 Compare April 9, 2026 22:41
@andrewlock andrewlock force-pushed the andrew/client-side-stats/refactor-trace-chunk-model branch from d367d99 to efd496f Compare April 9, 2026 22:41
@dd-trace-dotnet-ci-bot
Copy link
Copy Markdown

dd-trace-dotnet-ci-bot bot commented Apr 9, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8436) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration71.64 ± (71.70 - 72.11) ms71.37 ± (71.38 - 71.66) ms-0.4%
.NET Framework 4.8 - Bailout
duration76.12 ± (75.87 - 76.26) ms75.53 ± (75.43 - 75.79) ms-0.8%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1062.39 ± (1066.52 - 1074.97) ms1062.11 ± (1064.29 - 1071.38) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.12 ± (22.08 - 22.16) ms22.30 ± (22.26 - 22.34) ms+0.8%✅⬆️
process.time_to_main_ms83.51 ± (83.32 - 83.69) ms83.57 ± (83.38 - 83.75) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.91) MB10.92 ± (10.92 - 10.93) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.24 ± (22.20 - 22.28) ms22.29 ± (22.26 - 22.32) ms+0.2%✅⬆️
process.time_to_main_ms85.17 ± (84.98 - 85.36) ms85.19 ± (85.01 - 85.37) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB10.95 ± (10.95 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms225.10 ± (223.79 - 226.40) ms226.97 ± (225.75 - 228.19) ms+0.8%✅⬆️
process.time_to_main_ms513.91 ± (512.81 - 515.01) ms517.91 ± (516.60 - 519.22) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.40 ± (48.36 - 48.44) MB48.25 ± (48.21 - 48.28) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.3%
.NET 6 - Baseline
process.internal_duration_ms20.94 ± (20.91 - 20.98) ms20.97 ± (20.94 - 21.01) ms+0.1%✅⬆️
process.time_to_main_ms72.16 ± (72.00 - 72.33) ms72.16 ± (71.99 - 72.32) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.61) MB10.63 ± (10.63 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.70 ± (20.66 - 20.74) ms20.91 ± (20.87 - 20.96) ms+1.0%✅⬆️
process.time_to_main_ms72.11 ± (71.98 - 72.24) ms73.35 ± (73.17 - 73.53) ms+1.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.65 ± (10.65 - 10.66) MB10.74 ± (10.73 - 10.74) MB+0.8%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms384.56 ± (382.46 - 386.65) ms383.88 ± (381.84 - 385.92) ms-0.2%
process.time_to_main_ms515.16 ± (514.33 - 515.99) ms519.93 ± (518.87 - 520.98) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.93 ± (49.90 - 49.96) MB49.94 ± (49.91 - 49.97) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.00 ± (18.97 - 19.03) ms19.23 ± (19.19 - 19.28) ms+1.2%✅⬆️
process.time_to_main_ms70.73 ± (70.58 - 70.88) ms71.50 ± (71.36 - 71.64) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.68 ± (7.67 - 7.68) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.06 ± (19.03 - 19.09) ms19.16 ± (19.12 - 19.19) ms+0.5%✅⬆️
process.time_to_main_ms72.07 ± (71.93 - 72.20) ms72.46 ± (72.33 - 72.60) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.75 ± (7.74 - 7.76) MB7.72 ± (7.71 - 7.73) MB-0.4%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms304.26 ± (302.29 - 306.23) ms307.59 ± (305.43 - 309.76) ms+1.1%✅⬆️
process.time_to_main_ms477.13 ± (476.39 - 477.87) ms476.22 ± (475.32 - 477.12) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.99 ± (36.97 - 37.01) MB38.06 ± (38.02 - 38.11) MB+2.9%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.7%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.70 ± (193.65 - 194.31) ms193.00 ± (193.09 - 193.95) ms-0.4%
.NET Framework 4.8 - Bailout
duration197.67 ± (197.53 - 198.05) ms196.38 ± (196.43 - 196.94) ms-0.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1148.69 ± (1150.80 - 1159.08) ms1145.88 ± (1147.64 - 1155.44) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms189.02 ± (188.75 - 189.30) ms187.38 ± (187.03 - 187.72) ms-0.9%
process.time_to_main_ms81.17 ± (80.97 - 81.37) ms80.93 ± (80.73 - 81.13) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.10 - 16.15) MB16.14 ± (16.10 - 16.17) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms188.34 ± (188.07 - 188.61) ms187.21 ± (186.94 - 187.48) ms-0.6%
process.time_to_main_ms82.68 ± (82.58 - 82.79) ms82.16 ± (82.05 - 82.28) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.13) MB16.21 ± (16.18 - 16.23) MB+0.7%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.3%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms393.64 ± (392.04 - 395.24) ms393.17 ± (391.72 - 394.61) ms-0.1%
process.time_to_main_ms505.54 ± (504.22 - 506.86) ms507.98 ± (506.66 - 509.30) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.49 ± (58.27 - 58.70) MB58.77 ± (58.57 - 58.97) MB+0.5%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (30 - 30)+0.3%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.32 ± (192.06 - 192.59) ms193.21 ± (192.84 - 193.59) ms+0.5%✅⬆️
process.time_to_main_ms70.27 ± (70.14 - 70.41) ms71.03 ± (70.79 - 71.26) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.12 ± (15.99 - 16.25) MB16.36 ± (16.33 - 16.39) MB+1.5%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+4.1%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.54 ± (191.28 - 191.81) ms191.09 ± (190.87 - 191.32) ms-0.2%
process.time_to_main_ms71.18 ± (71.11 - 71.25) ms71.35 ± (71.24 - 71.45) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.19 ± (16.05 - 16.32) MB16.07 ± (15.93 - 16.21) MB-0.7%
runtime.dotnet.threads.count19 ± (19 - 20)20 ± (20 - 20)+1.8%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms602.58 ± (599.75 - 605.41) ms599.74 ± (597.09 - 602.39) ms-0.5%
process.time_to_main_ms510.28 ± (509.52 - 511.03) ms511.58 ± (510.82 - 512.34) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.49 ± (61.40 - 61.58) MB61.50 ± (61.41 - 61.60) MB+0.0%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms189.90 ± (189.65 - 190.15) ms189.39 ± (189.18 - 189.60) ms-0.3%
process.time_to_main_ms69.86 ± (69.72 - 70.00) ms69.87 ± (69.71 - 70.03) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.76 - 11.81) MB11.82 ± (11.78 - 11.85) MB+0.3%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.0%
.NET 8 - Bailout
process.internal_duration_ms188.98 ± (188.73 - 189.24) ms188.77 ± (188.53 - 189.01) ms-0.1%
process.time_to_main_ms70.82 ± (70.74 - 70.89) ms70.91 ± (70.82 - 71.00) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.66 - 11.83) MB11.72 ± (11.63 - 11.81) MB-0.2%
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (18 - 19)-0.5%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms520.74 ± (518.26 - 523.23) ms519.76 ± (517.28 - 522.24) ms-0.2%
process.time_to_main_ms470.49 ± (469.75 - 471.22) ms472.15 ± (471.35 - 472.94) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.73 ± (50.70 - 50.76) MB51.07 ± (51.03 - 51.10) MB+0.7%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.2%
Comparison explanation

Execution-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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8436) - mean (72ms)  : 70, 74
    master - mean (72ms)  : 69, 75

    section Bailout
    This PR (8436) - mean (76ms)  : 73, 78
    master - mean (76ms)  : 74, 78

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (1,068ms)  : 1017, 1119
    master - mean (1,071ms)  : 1008, 1134

Loading
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 (8436) - mean (113ms)  : 109, 116
    master - mean (112ms)  : 109, 115

    section Bailout
    This PR (8436) - mean (114ms)  : 112, 117
    master - mean (114ms)  : 112, 117

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (780ms)  : 758, 802
    master - mean (776ms)  : 756, 796

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8436) - mean (99ms)  : 96, 103
    master - mean (99ms)  : 95, 103

    section Bailout
    This PR (8436) - mean (100ms)  : 98, 103
    master - mean (99ms)  : 96, 101

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (933ms)  : 898, 968
    master - mean (927ms)  : 893, 961

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8436) - mean (98ms)  : 95, 101
    master - mean (97ms)  : 94, 100

    section Bailout
    This PR (8436) - mean (99ms)  : 97, 101
    master - mean (99ms)  : 96, 101

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (818ms)  : 775, 860
    master - mean (811ms)  : 783, 840

Loading
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 (8436) - mean (194ms)  : 189, 198
    master - mean (194ms)  : 191, 197

    section Bailout
    This PR (8436) - mean (197ms)  : 194, 199
    master - mean (198ms)  : 195, 200

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (1,152ms)  : 1093, 1210
    master - mean (1,155ms)  : 1094, 1216

Loading
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 (8436) - mean (277ms)  : 273, 281
    master - mean (279ms)  : 275, 283

    section Bailout
    This PR (8436) - mean (278ms)  : 274, 281
    master - mean (279ms)  : 276, 282

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (929ms)  : 910, 949
    master - mean (927ms)  : 905, 949

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8436) - mean (272ms)  : 267, 278
    master - mean (271ms)  : 267, 275

    section Bailout
    This PR (8436) - mean (271ms)  : 267, 274
    master - mean (271ms)  : 268, 273

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (1,141ms)  : 1102, 1179
    master - mean (1,142ms)  : 1097, 1186

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8436) - mean (269ms)  : 266, 272
    master - mean (269ms)  : 266, 273

    section Bailout
    This PR (8436) - mean (269ms)  : 266, 272
    master - mean (269ms)  : 266, 273

    section CallTarget+Inlining+NGEN
    This PR (8436) - mean (1,026ms)  : 991, 1061
    master - mean (1,024ms)  : 982, 1066

Loading

@andrewlock andrewlock force-pushed the andrew/client-side-stats/update-processing-pipeline branch 2 times, most recently from a99ae1b to bf1d86f Compare April 10, 2026 07:20
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 10, 2026

Benchmarks

Benchmark execution time: 2026-04-10 08:30:13

Comparing candidate commit bf1d86f in PR branch andrew/client-side-stats/update-processing-pipeline with baseline commit 549e87e in branch master.

Found 27 performance improvements and 39 performance regressions! Performance is the same for 214 metrics, 8 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟩 throughput [+8328.291op/s; +10799.952op/s] or [+7.000%; +9.078%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+305.870ms; +310.460ms] or [+151.784%; +154.061%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+381.088ms; +383.958ms] or [+301.083%; +303.350%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+398.399ms; +401.716ms] or [+352.568%; +355.503%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟩 execution_time [-15.880ms; -11.704ms] or [-7.417%; -5.466%]
  • 🟩 throughput [+7402.848op/s; +10188.049op/s] or [+5.404%; +7.437%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟩 execution_time [-26.262ms; -20.535ms] or [-11.712%; -9.158%]
  • 🟩 throughput [+95322.754op/s; +120409.563op/s] or [+10.183%; +12.864%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟩 throughput [+90765.253op/s; +107001.654op/s] or [+13.041%; +15.374%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+7002.262op/s; +9635.873op/s] or [+5.578%; +7.676%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+309798.390op/s; +342548.370op/s] or [+10.330%; +11.422%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-17.463ms; -12.791ms] or [-8.050%; -5.896%]
  • 🟩 throughput [+191950.810op/s; +249896.253op/s] or [+7.619%; +9.919%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.688ms; +300.508ms] or [+149.744%; +150.154%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+298.100ms; +301.449ms] or [+150.333%; +152.022%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+299.890ms; +302.405ms] or [+151.061%; +152.328%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+297.594ms; +298.696ms] or [+146.167%; +146.708%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+294.619ms; +296.350ms] or [+144.028%; +144.875%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+301.063ms; +302.911ms] or [+150.471%; +151.395%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+26.466µs; +51.159µs] or [+8.449%; +16.333%]
  • 🟥 throughput [-462.710op/s; -259.600op/s] or [-14.424%; -8.092%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.384ms; +300.009ms] or [+149.423%; +149.735%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+418.904ms; +424.614ms] or [+455.157%; +461.361%]
  • 🟩 throughput [+1164.036op/s; +1315.272op/s] or [+9.565%; +10.808%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • 🟩 throughput [+729.330op/s; +928.312op/s] or [+7.060%; +8.987%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 throughput [-538.289op/s; -472.821op/s] or [-48.774%; -42.842%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 throughput [-743.289op/s; -659.814op/s] or [-49.578%; -44.010%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 allocated_mem [+2.304KB; +2.308KB] or [+5.441%; +5.449%]
  • 🟥 execution_time [+340.134ms; +348.292ms] or [+203.440%; +208.319%]
  • 🟥 throughput [-401.845op/s; -365.944op/s] or [-27.980%; -25.480%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-175.395µs; -140.004µs] or [-8.885%; -7.092%]
  • 🟩 throughput [+40.412op/s; +49.909op/s] or [+7.978%; +9.853%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1

  • 🟩 throughput [+13.808op/s; +38.084op/s] or [+5.445%; +15.018%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-23822.902op/s; -20990.996op/s] or [-6.710%; -5.912%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+299.412ms; +301.195ms] or [+150.778%; +151.676%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+301.833ms; +303.048ms] or [+151.249%; +151.858%]
  • 🟩 throughput [+42446.142op/s; +47715.578op/s] or [+6.692%; +7.523%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+301.379ms; +304.534ms] or [+151.400%; +152.985%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.595ms; +302.722ms] or [+151.451%; +152.017%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+297.504ms; +299.506ms] or [+147.102%; +148.092%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+305.350ms; +308.784ms] or [+154.765%; +156.505%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.712ms; +304.390ms] or [+151.934%; +152.776%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+301.232ms; +303.355ms] or [+150.136%; +151.195%]
  • 🟩 throughput [+49659.320op/s; +61047.251op/s] or [+9.861%; +12.122%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+298.773ms; +301.619ms] or [+148.637%; +150.053%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟥 allocated_mem [+44.289KB; +44.311KB] or [+16.156%; +16.164%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+6.077µs; +10.094µs] or [+14.364%; +23.858%]
  • 🟥 throughput [-4603.274op/s; -2831.397op/s] or [-19.378%; -11.919%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • 🟩 throughput [+2023.496op/s; +3476.757op/s] or [+12.415%; +21.331%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.146ms; +303.474ms] or [+152.721%; +153.392%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.183ms; +304.232ms] or [+153.301%; +154.853%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+299.043ms; +301.627ms] or [+149.708%; +151.001%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+35035.032op/s; +40546.063op/s] or [+6.631%; +7.675%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.628ms; +302.476ms] or [+149.836%; +150.757%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.168ms; +305.243ms] or [+152.236%; +153.279%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+304.784ms; +307.129ms] or [+154.567%; +155.756%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.388ms; +300.924ms] or [+149.835%; +150.102%]
  • 🟩 throughput [+61283005.732op/s; +61511857.855op/s] or [+44.630%; +44.797%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟩 throughput [+1058.720op/s; +1246.030op/s] or [+8.184%; +9.632%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.501ms; +300.417ms] or [+149.384%; +149.841%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+97176.905op/s; +104378.757op/s] or [+9.073%; +9.746%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+64613.556op/s; +97049.214op/s] or [+5.001%; +7.512%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+87426.907op/s; +94702.108op/s] or [+8.683%; +9.405%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+55701.924op/s; +60258.705op/s] or [+10.114%; +10.942%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1

  • 🟩 throughput [+22563.956op/s; +32187.505op/s] or [+5.051%; +7.205%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+87879.453op/s; +104740.409op/s] or [+9.818%; +11.702%]

@andrewlock andrewlock marked this pull request as ready for review April 10, 2026 09:07
@andrewlock andrewlock requested review from a team as code owners April 10, 2026 09:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3179a17d78

ℹ️ 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".

@andrewlock andrewlock marked this pull request as draft April 10, 2026 09:20
@andrewlock andrewlock force-pushed the andrew/client-side-stats/update-processing-pipeline branch from 3179a17 to 2a9f4b3 Compare April 10, 2026 12:29
@andrewlock andrewlock force-pushed the andrew/client-side-stats/refactor-trace-chunk-model branch from efd496f to bda5853 Compare April 10, 2026 12:29
@andrewlock andrewlock marked this pull request as ready for review April 10, 2026 12:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a9f4b3577

ℹ️ 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".

Comment on lines +210 to 213
if (_statsAggregator.CanComputeStats == true)
{
await _statsAggregator.DisposeAsync().ConfigureAwait(false);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Always dispose stats aggregator during shutdown

FlushAndCloseAsync() now calls DisposeAsync() only when CanComputeStats == true, but a real StatsAggregator is instantiated whenever client-side stats are enabled, even while capability is still null/false (e.g., before discovery completes or when agent support is missing). In those cases shutdown skips disposal, so subscriptions are not removed and the internal flush task may continue running past writer shutdown, which leaks resources and can interfere with repeated tracer lifecycles/tests.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant