Skip to content

Fix race condition in Client Side Stats enablement#8509

Merged
andrewlock merged 3 commits into
masterfrom
andrew/fix-flaky-stats
Apr 29, 2026
Merged

Fix race condition in Client Side Stats enablement#8509
andrewlock merged 3 commits into
masterfrom
andrew/fix-flaky-stats

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

Fixes a race condition in client-side-stats enablement

Reason for change

A unit test was flaking, where there was a delay in obfuscation, so we had 2 buckets - one with obfuscated resource name, and one without.

Implementation details

Move the setting of CanComputeStats = true to the end of the method, after setting peer tags and obfuscation, so that when it switches false -> true, it already has the full config.

Warning

There is still a race condition when config is updated for an already enabled stats config. In that case the obfuscation/peer tags will be briefly out of sync theoretically. But I don't think that's a big issue, and would only occur if the agent changes during application execution, which is rare

Test coverage

Covered by the unit tests already (they shouldn't flake now).

Other details

@andrewlock
andrewlock requested a review from a team as a code owner April 23, 2026 11:58
@github-actions github-actions Bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Apr 23, 2026

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

Copy link
Copy Markdown

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: 8b5cd08520

ℹ️ 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 thread tracer/src/Datadog.Trace/Agent/StatsAggregator.cs
@pr-commenter

pr-commenter Bot commented Apr 23, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-28 16:27:27

Comparing candidate commit 7a0764e in PR branch andrew/fix-flaky-stats with baseline commit 37b6bcd in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 59 known flaky benchmarks, 28 flaky benchmarks without significant changes.

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 ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

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

  • 🟩 throughput [+8856.728op/s; +11082.722op/s] or [+7.444%; +9.315%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+299.532ms; +301.179ms] or [+148.638%; +149.456%]

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

  • 🟥 execution_time [+382.707ms; +385.748ms] or [+302.362%; +304.765%]

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

  • 🟥 execution_time [+394.931ms; +397.856ms] or [+349.499%; +352.087%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.881ms; -11.717ms] or [-7.417%; -5.472%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-264954.424op/s; -259861.180op/s] or [-27.053%; -26.533%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.633ms; -21.784ms] or [-11.877%; -9.715%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-135915.573op/s; -119897.137op/s] or [-19.528%; -17.227%]

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

  • 🟩 throughput [+8507.336op/s; +11500.738op/s] or [+5.413%; +7.318%]

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

  • 🟩 throughput [+393884.398op/s; +420239.559op/s] or [+13.134%; +14.013%]

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

  • 🟩 execution_time [-18.670ms; -14.293ms] or [-8.606%; -6.589%]
  • 🟩 throughput [+203017.078op/s; +256844.294op/s] or [+8.058%; +10.195%]

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

  • 🟥 execution_time [+299.462ms; +300.170ms] or [+149.631%; +149.985%]

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

  • 🟥 execution_time [+298.689ms; +306.747ms] or [+150.629%; +154.693%]

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

  • 🟥 execution_time [+299.439ms; +301.873ms] or [+150.834%; +152.060%]

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

  • 🟥 execution_time [+296.565ms; +297.389ms] or [+145.661%; +146.066%]

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

  • 🟥 execution_time [+293.476ms; +295.420ms] or [+143.469%; +144.420%]

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

  • 🟥 execution_time [+302.222ms; +304.224ms] or [+151.050%; +152.051%]

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

  • 🟥 execution_time [+23.363µs; +46.938µs] or [+7.459%; +14.985%]
  • 🟥 throughput [-436.294op/s; -237.900op/s] or [-13.601%; -7.416%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.688ms; +300.360ms] or [+149.575%; +149.911%]

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

  • unstable execution_time [+368.452ms; +404.901ms] or [+400.338%; +439.942%]
  • 🟩 throughput [+1056.177op/s; +1195.083op/s] or [+8.679%; +9.820%]

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

  • unstable execution_time [+227.649ms; +274.824ms] or [+172.852%; +208.671%]
  • 🟩 throughput [+704.991op/s; +911.929op/s] or [+6.825%; +8.828%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+318.069ms; +388.214ms] or [+146.245%; +178.497%]
  • 🟥 throughput [-546.756op/s; -478.878op/s] or [-49.541%; -43.391%]

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

  • unstable execution_time [+201.516ms; +334.720ms] or [+85.878%; +142.644%]
  • 🟥 throughput [-748.542op/s; -665.022op/s] or [-49.928%; -44.357%]

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

  • 🟥 allocated_mem [+2.304KB; +2.308KB] or [+5.441%; +5.449%]
  • 🟥 execution_time [+346.488ms; +354.606ms] or [+207.240%; +212.096%]
  • 🟥 throughput [-427.026op/s; -391.514op/s] or [-29.733%; -27.261%]

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

  • 🟩 execution_time [-69.406µs; -54.594µs] or [-6.437%; -5.063%]
  • 🟩 throughput [+49.612op/s; +66.441op/s] or [+5.349%; +7.164%]

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

  • 🟩 execution_time [-173.770µs; -134.425µs] or [-8.803%; -6.809%]
  • 🟩 throughput [+39.096op/s; +49.586op/s] or [+7.718%; +9.789%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+300.405ms; +301.705ms] or [+151.278%; +151.933%]

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

  • 🟥 execution_time [+303.494ms; +305.165ms] or [+152.081%; +152.919%]

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

  • 🟥 execution_time [+301.681ms; +305.025ms] or [+151.552%; +153.232%]
  • 🟩 throughput [+26708.150op/s; +34405.939op/s] or [+5.626%; +7.248%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.198ms; +303.881ms] or [+151.754%; +152.599%]

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

  • 🟥 execution_time [+299.671ms; +301.048ms] or [+148.174%; +148.855%]

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

  • 🟥 execution_time [+304.004ms; +307.535ms] or [+154.083%; +155.872%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.911ms; +306.427ms] or [+152.034%; +153.799%]

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

  • 🟥 execution_time [+297.925ms; +299.763ms] or [+148.488%; +149.404%]
  • 🟩 throughput [+51582.828op/s; +55632.975op/s] or [+10.243%; +11.047%]

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

  • 🟥 execution_time [+300.524ms; +303.638ms] or [+149.508%; +151.057%]

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

  • 🟩 execution_time [-15.965ms; -12.294ms] or [-7.424%; -5.717%]
  • 🟩 throughput [+19340.507op/s; +25972.031op/s] or [+5.306%; +7.125%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+11.200µs; +53.652µs] or [+2.767%; +13.252%]

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

  • 🟩 allocated_mem [-18.854KB; -18.833KB] or [-6.877%; -6.870%]
  • unstable execution_time [-40.416µs; +11.697µs] or [-7.988%; +2.312%]

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

  • 🟩 allocated_mem [-16.752KB; -16.736KB] or [-6.107%; -6.101%]

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

  • 🟥 execution_time [+6.899µs; +10.902µs] or [+16.306%; +25.769%]
  • 🟥 throughput [-4924.317op/s; -3152.011op/s] or [-20.730%; -13.269%]

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

  • unstable execution_time [-13.378µs; -6.052µs] or [-20.755%; -9.390%]
  • 🟩 throughput [+1545.581op/s; +3083.068op/s] or [+9.483%; +18.916%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.249ms; +304.129ms] or [+153.279%; +153.724%]

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

  • 🟥 execution_time [+302.571ms; +304.764ms] or [+154.008%; +155.124%]

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

  • 🟥 execution_time [+298.732ms; +300.714ms] or [+149.552%; +150.544%]

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

  • 🟩 throughput [+41630.073op/s; +44131.268op/s] or [+7.880%; +8.353%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.476ms; +301.404ms] or [+149.262%; +150.223%]

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

  • 🟥 execution_time [+301.283ms; +302.892ms] or [+151.290%; +152.098%]

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

  • 🟥 execution_time [+304.092ms; +306.309ms] or [+154.216%; +155.340%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.491ms; +301.413ms] or [+149.887%; +150.346%]
  • 🟩 throughput [+65925020.369op/s; +66216372.120op/s] or [+48.011%; +48.223%]

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

  • unstable execution_time [+336.815ms; +385.695ms] or [+418.890%; +479.680%]
  • 🟩 throughput [+933.913op/s; +1114.261op/s] or [+7.220%; +8.614%]

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

  • 🟥 execution_time [+299.373ms; +300.342ms] or [+149.320%; +149.804%]
  • 🟩 throughput [+18240859.885op/s; +19182340.815op/s] or [+8.080%; +8.497%]

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

  • 🟩 throughput [+82117.340op/s; +90343.244op/s] or [+7.667%; +8.435%]

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

  • 🟩 throughput [+55374.334op/s; +75154.502op/s] or [+6.409%; +8.699%]

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

  • 🟩 throughput [+88298.879op/s; +118241.538op/s] or [+6.834%; +9.152%]

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

  • 🟩 throughput [+88506.753op/s; +96867.710op/s] or [+8.790%; +9.621%]

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

  • 🟩 throughput [+52161.508op/s; +58000.993op/s] or [+9.472%; +10.532%]

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

  • 🟩 throughput [+62776.585op/s; +81728.244op/s] or [+7.014%; +9.131%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8509) 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
duration75.30 ± (75.18 - 75.76) ms72.89 ± (73.00 - 73.36) ms-3.2%
.NET Framework 4.8 - Bailout
duration77.74 ± (77.81 - 78.28) ms80.13 ± (79.86 - 80.38) ms+3.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1073.15 ± (1071.63 - 1078.20) ms1079.50 ± (1081.01 - 1089.37) ms+0.6%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.92 ± (22.86 - 22.97) ms22.72 ± (22.66 - 22.78) ms-0.9%
process.time_to_main_ms86.67 ± (86.34 - 86.99) ms86.32 ± (85.98 - 86.66) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.93) MB10.91 ± (10.91 - 10.91) MB-0.2%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.43 ± (22.40 - 22.47) ms22.55 ± (22.50 - 22.60) ms+0.5%✅⬆️
process.time_to_main_ms84.85 ± (84.64 - 85.05) ms87.32 ± (87.04 - 87.59) ms+2.9%✅⬆️
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.95) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms214.25 ± (213.34 - 215.16) ms211.78 ± (210.91 - 212.65) ms-1.2%
process.time_to_main_ms525.91 ± (524.51 - 527.32) ms525.39 ± (524.14 - 526.65) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.79 ± (47.76 - 47.82) MB47.86 ± (47.83 - 47.89) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms21.19 ± (21.15 - 21.24) ms21.58 ± (21.52 - 21.64) ms+1.8%✅⬆️
process.time_to_main_ms73.57 ± (73.32 - 73.83) ms76.72 ± (76.42 - 77.01) ms+4.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.63) MB10.64 ± (10.64 - 10.64) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.52 ± (21.47 - 21.57) ms21.13 ± (21.09 - 21.17) ms-1.8%
process.time_to_main_ms77.30 ± (76.98 - 77.61) ms74.87 ± (74.69 - 75.05) ms-3.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.74) MB10.75 ± (10.75 - 10.75) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms384.41 ± (382.40 - 386.42) ms381.63 ± (379.30 - 383.95) ms-0.7%
process.time_to_main_ms529.74 ± (528.31 - 531.17) ms531.74 ± (530.40 - 533.09) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.18 ± (49.15 - 49.20) MB49.33 ± (49.31 - 49.36) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 8 - Baseline
process.internal_duration_ms19.55 ± (19.52 - 19.58) ms19.65 ± (19.60 - 19.70) ms+0.5%✅⬆️
process.time_to_main_ms72.75 ± (72.59 - 72.91) ms74.33 ± (74.05 - 74.62) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.68) MB7.65 ± (7.65 - 7.66) MB-0.2%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.84 ± (19.79 - 19.90) ms19.92 ± (19.86 - 19.97) ms+0.4%✅⬆️
process.time_to_main_ms75.62 ± (75.31 - 75.92) ms77.21 ± (76.95 - 77.47) ms+2.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.71) MB7.70 ± (7.70 - 7.71) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms300.15 ± (298.14 - 302.16) ms303.01 ± (300.94 - 305.09) ms+1.0%✅⬆️
process.time_to_main_ms489.82 ± (488.59 - 491.05) ms487.93 ± (486.90 - 488.95) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.70 ± (36.65 - 36.74) MB36.55 ± (36.51 - 36.60) MB-0.4%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.2%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration199.99 ± (199.56 - 200.44) ms205.98 ± (206.27 - 207.54) ms+3.0%✅⬆️
.NET Framework 4.8 - Bailout
duration204.08 ± (203.41 - 204.42) ms210.31 ± (210.76 - 212.40) ms+3.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1176.14 ± (1176.95 - 1184.80) ms1213.80 ± (1212.59 - 1221.12) ms+3.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms193.59 ± (193.13 - 194.05) ms200.00 ± (199.42 - 200.58) ms+3.3%✅⬆️
process.time_to_main_ms83.89 ± (83.66 - 84.12) ms86.92 ± (86.61 - 87.23) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.01 ± (15.99 - 16.03) MB15.93 ± (15.92 - 15.95) MB-0.5%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms192.28 ± (191.79 - 192.78) ms198.51 ± (197.95 - 199.08) ms+3.2%✅⬆️
process.time_to_main_ms84.87 ± (84.65 - 85.09) ms87.95 ± (87.69 - 88.21) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.08 - 16.11) MB15.98 ± (15.96 - 16.00) MB-0.7%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.3%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms382.26 ± (380.98 - 383.53) ms394.77 ± (393.27 - 396.26) ms+3.3%✅⬆️
process.time_to_main_ms518.46 ± (516.90 - 520.02) ms537.24 ± (535.97 - 538.50) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed56.64 ± (56.54 - 56.73) MB58.04 ± (57.87 - 58.21) MB+2.5%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.7%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms197.90 ± (197.42 - 198.38) ms206.00 ± (205.37 - 206.63) ms+4.1%✅⬆️
process.time_to_main_ms72.58 ± (72.40 - 72.77) ms76.25 ± (75.93 - 76.56) ms+5.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.31 - 16.35) MB16.33 ± (16.31 - 16.35) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+1.8%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms198.46 ± (197.98 - 198.94) ms203.44 ± (202.90 - 203.99) ms+2.5%✅⬆️
process.time_to_main_ms74.24 ± (74.04 - 74.43) ms76.44 ± (76.19 - 76.69) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.31 ± (16.29 - 16.33) MB16.35 ± (16.34 - 16.37) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms591.90 ± (589.04 - 594.76) ms595.30 ± (592.79 - 597.80) ms+0.6%✅⬆️
process.time_to_main_ms524.18 ± (523.10 - 525.26) ms538.85 ± (537.68 - 540.02) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed60.68 ± (60.57 - 60.78) MB61.07 ± (60.98 - 61.16) MB+0.6%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.1%
.NET 8 - Baseline
process.internal_duration_ms196.01 ± (195.53 - 196.50) ms202.15 ± (201.51 - 202.79) ms+3.1%✅⬆️
process.time_to_main_ms72.24 ± (72.01 - 72.47) ms74.38 ± (74.13 - 74.63) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.67 ± (11.65 - 11.68) MB11.58 ± (11.56 - 11.59) MB-0.8%
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+2.2%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms195.62 ± (195.14 - 196.10) ms202.38 ± (201.72 - 203.04) ms+3.5%✅⬆️
process.time_to_main_ms73.42 ± (73.20 - 73.65) ms75.96 ± (75.69 - 76.23) ms+3.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.68 - 11.71) MB11.63 ± (11.62 - 11.65) MB-0.6%
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+2.1%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms521.06 ± (518.29 - 523.82) ms526.04 ± (520.88 - 531.19) ms+1.0%✅⬆️
process.time_to_main_ms481.21 ± (480.19 - 482.24) ms495.10 ± (493.91 - 496.28) ms+2.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.38 ± (50.34 - 50.42) MB50.30 ± (50.24 - 50.36) MB-0.2%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.3%✅⬆️
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 (8509) - mean (73ms)  : 71, 76
    master - mean (75ms)  : 71, 80

    section Bailout
    This PR (8509) - mean (80ms)  : 76, 84
    master - mean (78ms)  : 75, 81

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (1,085ms)  : 1021, 1149
    master - mean (1,075ms)  : 1026, 1124

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 (8509) - mean (116ms)  : 109, 123
    master - mean (117ms)  : 111, 122

    section Bailout
    This PR (8509) - mean (117ms)  : 112, 122
    master - mean (114ms)  : 110, 118

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (773ms)  : 749, 798
    master - mean (776ms)  : 747, 805

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8509) - mean (105ms)  : 99, 111
    master - mean (101ms)  : 96, 107

    section Bailout
    This PR (8509) - mean (102ms)  : 99, 106
    master - mean (106ms)  : 100, 111

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (939ms)  : 902, 976
    master - mean (942ms)  : 911, 973

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8509) - mean (102ms)  : 96, 108
    master - mean (100ms)  : 97, 103

    section Bailout
    This PR (8509) - mean (105ms)  : 101, 110
    master - mean (103ms)  : 98, 109

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (823ms)  : 786, 861
    master - mean (823ms)  : 790, 857

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 (8509) - mean (207ms)  : 198, 216
    master - mean (200ms)  : 194, 206

    section Bailout
    This PR (8509) - mean (212ms)  : 199, 224
    master - mean (204ms)  : 198, 209

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (1,217ms)  : 1156, 1278
    master - mean (1,181ms)  : 1122, 1240

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 (8509) - mean (297ms)  : 283, 311
    master - mean (287ms)  : 275, 298

    section Bailout
    This PR (8509) - mean (297ms)  : 282, 312
    master - mean (286ms)  : 277, 295

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (970ms)  : 937, 1002
    master - mean (932ms)  : 910, 954

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8509) - mean (292ms)  : 276, 308
    master - mean (279ms)  : 269, 289

    section Bailout
    This PR (8509) - mean (290ms)  : 276, 303
    master - mean (281ms)  : 270, 292

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (1,165ms)  : 1121, 1209
    master - mean (1,143ms)  : 1084, 1201

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8509) - mean (288ms)  : 273, 304
    master - mean (278ms)  : 270, 286

    section Bailout
    This PR (8509) - mean (289ms)  : 276, 302
    master - mean (279ms)  : 271, 288

    section CallTarget+Inlining+NGEN
    This PR (8509) - mean (1,057ms)  : 983, 1130
    master - mean (1,035ms)  : 993, 1077

Loading

Comment thread tracer/src/Datadog.Trace/Agent/StatsAggregator.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/StatsAggregator.cs Outdated
Co-authored-by: Andrew Lock <[email protected]>
@andrewlock
andrewlock enabled auto-merge (squash) April 29, 2026 08:25
@andrewlock
andrewlock merged commit bc123ee into master Apr 29, 2026
138 of 139 checks passed
@andrewlock
andrewlock deleted the andrew/fix-flaky-stats branch April 29, 2026 09:23
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:client-side-stats area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:bug type:flake-fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants