Skip to content

Extract ContainsSpanId to SpanCollection#8435

Merged
andrewlock merged 2 commits into
masterfrom
andrew/client-side-stats/refactor-trace-chunk-model
Apr 20, 2026
Merged

Extract ContainsSpanId to SpanCollection#8435
andrewlock merged 2 commits into
masterfrom
andrew/client-side-stats/refactor-trace-chunk-model

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

Extracts ContainsSpanId from TraceChunkModel to SpanCollection

Reason for change

I need to find a given span in a SpanCollection for client-side-stats. The algorithm used by TraceChunkModel does it "properly" (by stating from the last span when looking for a root span), so it seems to make sense to move this method to SpanCollection. Additionally, this essentially hides some of the internals about the SpanCollection type, so seems like a better place for it anyway.

Implementation details

  • Move the IndexOf() method from TraceChunkModel to SpanCollection
  • Switch it to Contains() instead, seeing as the index is never actually used AFAICT. It's easy to switch it back later if we do need it.

Test coverage

Added some unit tests for the method

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/refactor-trace-chunk-model branch from d367d99 to efd496f Compare April 9, 2026 22:41
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/client-side-stats-1-2 branch from 46c887a to d2adf6e Compare April 9, 2026 22:41
@pr-commenter

pr-commenter Bot commented Apr 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-20 17:21:28

Comparing candidate commit ce99c4b in PR branch andrew/client-side-stats/refactor-trace-chunk-model with baseline commit 5925926 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 26 metrics, 0 unstable metrics, 87 known flaky benchmarks.

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.HttpClientBenchmark.SendAsync net6.0

  • 🟩 throughput [+8651.429op/s; +9537.034op/s] or [+5.877%; +6.479%]

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 net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.008%; +0.005%]
  • ignore execution_time [-1.658ms; -0.718ms] or [-0.824%; -0.357%]
  • ignore throughput [-1494.634op/s; -794.742op/s] or [-1.772%; -0.942%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.007%]
  • ignore execution_time [-2245.698µs; +1245.022µs] or [-1.120%; +0.621%]
  • 🟩 throughput [+10145.452op/s; +12365.428op/s] or [+8.528%; +10.394%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.007%]
  • ignore execution_time [+0.303ms; +2.493ms] or [+0.152%; +1.254%]
  • ignore throughput [-1470.318op/s; -333.735op/s] or [-1.495%; -0.339%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • ignore allocated_mem [-20 bytes; -19 bytes] or [-0.613%; -0.600%]
  • 🟥 execution_time [+309.112ms; +311.447ms] or [+153.392%; +154.551%]
  • ignore throughput [+4.926op/s; +9.020op/s] or [+0.886%; +1.623%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.009%; +0.002%]
  • 🟥 execution_time [+376.695ms; +378.564ms] or [+297.612%; +299.089%]
  • ignore throughput [+4.731op/s; +7.932op/s] or [+0.624%; +1.046%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.009%; +0.002%]
  • 🟥 execution_time [+396.946ms; +399.265ms] or [+351.282%; +353.335%]
  • ignore throughput [+4.257op/s; +7.208op/s] or [+0.601%; +1.018%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]
  • ignore execution_time [-271.752µs; +350.924µs] or [-0.136%; +0.175%]
  • ignore throughput [-4441.466op/s; -4030.031op/s] or [-3.456%; -3.136%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.939ms; -11.763ms] or [-7.444%; -5.494%]
  • ignore throughput [+5448.378op/s; +8238.215op/s] or [+3.977%; +6.013%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]
  • ignore execution_time [-12.695ms; -8.544ms] or [-6.045%; -4.069%]
  • ignore throughput [+460.315op/s; +2741.643op/s] or [+0.416%; +2.479%]

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • ignore execution_time [-1118.276µs; -580.357µs] or [-0.557%; -0.289%]
  • 🟥 throughput [-248095.612op/s; -244197.646op/s] or [-25.332%; -24.934%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-25.818ms; -20.954ms] or [-11.514%; -9.344%]
  • ignore throughput [-61262.779op/s; -38286.501op/s] or [-6.545%; -4.090%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • ignore execution_time [-3085.487µs; +1288.733µs] or [-1.540%; +0.643%]
  • 🟥 throughput [-130462.939op/s; -114170.229op/s] or [-18.745%; -16.404%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.007%; +0.003%]
  • ignore execution_time [-1012.248µs; +14.126µs] or [-0.505%; +0.007%]
  • ignore throughput [-119.542op/s; +646.478op/s] or [-0.080%; +0.435%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.003%]
  • ignore execution_time [+0.241ms; +3.743ms] or [+0.122%; +1.888%]
  • 🟩 throughput [+11198.335op/s; +14110.892op/s] or [+7.125%; +8.979%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.007%; +0.003%]
  • ignore execution_time [+1.731ms; +5.720ms] or [+0.883%; +2.916%]
  • 🟩 throughput [+8378.147op/s; +11004.769op/s] or [+6.674%; +8.767%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.008%; +0.004%]
  • ignore execution_time [-65.508µs; +694.245µs] or [-0.033%; +0.347%]
  • ignore throughput [+37427.165op/s; +58831.413op/s] or [+1.139%; +1.790%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.008%]
  • ignore execution_time [-2.367ms; -1.656ms] or [-1.170%; -0.819%]
  • 🟩 throughput [+489790.844op/s; +504720.630op/s] or [+16.332%; +16.830%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.004%]
  • 🟩 execution_time [-19.552ms; -15.180ms] or [-9.013%; -6.998%]
  • 🟩 throughput [+228970.271op/s; +283334.187op/s] or [+9.088%; +11.246%]

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

  • ignore allocated_mem [+1 bytes; +4 bytes] or [+0.004%; +0.012%]
  • 🟥 execution_time [+300.165ms; +300.802ms] or [+149.982%; +150.301%]
  • ignore throughput [+71.148op/s; +102.493op/s] or [+0.786%; +1.132%]

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

  • ignore allocated_mem [-1 bytes; +2 bytes] or [-0.004%; +0.008%]
  • 🟥 execution_time [+299.519ms; +302.708ms] or [+151.048%; +152.656%]
  • ignore throughput [+184.911op/s; +405.766op/s] or [+1.414%; +3.104%]

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

  • ignore allocated_mem [-1 bytes; +2 bytes] or [-0.004%; +0.008%]
  • 🟥 execution_time [+299.969ms; +302.747ms] or [+151.101%; +152.500%]
  • ignore throughput [+137.646op/s; +266.425op/s] or [+1.329%; +2.572%]

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

  • ignore allocated_mem [+2 bytes; +3 bytes] or [+0.137%; +0.150%]
  • 🟥 execution_time [+297.126ms; +297.948ms] or [+145.936%; +146.340%]
  • ignore throughput [+8.467op/s; +14.154op/s] or [+0.224%; +0.375%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.009%]
  • 🟥 execution_time [+298.162ms; +301.482ms] or [+145.760%; +147.383%]
  • ignore throughput [+70.077op/s; +118.620op/s] or [+1.018%; +1.723%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.009%]
  • 🟥 execution_time [+302.299ms; +304.251ms] or [+151.088%; +152.064%]
  • ignore throughput [+3.573op/s; +29.569op/s] or [+0.071%; +0.587%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [+0.713µs; +4.163µs] or [+0.146%; +0.855%]
  • ignore throughput [-17.256op/s; -2.893op/s] or [-0.840%; -0.141%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.000%; +0.010%]
  • ignore execution_time [+19.244µs; +47.098µs] or [+4.414%; +10.802%]
  • ignore throughput [-226.842op/s; -103.629op/s] or [-9.862%; -4.505%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.003%]
  • ignore execution_time [+5.559µs; +27.485µs] or [+1.191%; +5.889%]
  • ignore throughput [-137.177op/s; -56.582op/s] or [-6.332%; -2.612%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-6.287µs; -2.417µs] or [-1.697%; -0.653%]
  • ignore throughput [+18.446op/s; +46.399op/s] or [+0.683%; +1.718%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.007%]
  • 🟥 execution_time [+20.990µs; +44.558µs] or [+6.701%; +14.225%]
  • 🟥 throughput [-416.594op/s; -218.242op/s] or [-12.986%; -6.803%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.003%]
  • ignore execution_time [-16.149µs; +6.213µs] or [-4.418%; +1.700%]
  • ignore throughput [-79.674op/s; +53.752op/s] or [-2.859%; +1.929%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • 🟥 execution_time [+299.964ms; +300.635ms] or [+149.713%; +150.048%]
  • ignore throughput [-1638012.298op/s; -1071139.943op/s] or [-0.821%; -0.537%]

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

  • ignore allocated_mem [+80 bytes; +82 bytes] or [+0.446%; +0.457%]
  • unstable execution_time [+378.326ms; +409.596ms] or [+411.066%; +445.043%]
  • 🟩 throughput [+1026.682op/s; +1155.388op/s] or [+8.436%; +9.494%]

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

  • ignore allocated_mem [+21 bytes; +23 bytes] or [+0.103%; +0.114%]
  • unstable execution_time [+301.939ms; +339.966ms] or [+229.259%; +258.133%]
  • 🟩 throughput [+601.389op/s; +801.887op/s] or [+5.822%; +7.763%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • ignore allocated_mem [+2.764KB; +2.769KB] or [+4.911%; +4.920%]
  • unstable execution_time [+312.572ms; +387.312ms] or [+143.717%; +178.082%]
  • 🟥 throughput [-472.859op/s; -418.770op/s] or [-42.846%; -37.945%]

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

  • ignore allocated_mem [-1.270KB; -1.268KB] or [-2.995%; -2.990%]
  • unstable execution_time [+187.065ms; +321.672ms] or [+79.719%; +137.083%]
  • 🟥 throughput [-750.639op/s; -667.034op/s] or [-50.068%; -44.491%]

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

  • ignore allocated_mem [+358 bytes; +361 bytes] or [+0.847%; +0.855%]
  • 🟥 execution_time [+346.526ms; +354.602ms] or [+207.263%; +212.093%]
  • 🟥 throughput [-427.047op/s; -391.597op/s] or [-29.735%; -27.266%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-64.770µs; -49.291µs] or [-3.260%; -2.481%]
  • ignore throughput [+12.980op/s; +17.166op/s] or [+2.579%; +3.411%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-12.039µs; +3.857µs] or [-0.827%; +0.265%]
  • ignore throughput [-1.326op/s; +6.140op/s] or [-0.193%; +0.894%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-98.614µs; -83.938µs] or [-3.431%; -2.920%]
  • ignore throughput [+10.528op/s; +12.412op/s] or [+3.026%; +3.568%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-4205.494ns; +2208.161ns] or [-0.363%; +0.191%]
  • ignore throughput [-1.507op/s; +3.250op/s] or [-0.174%; +0.376%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-45.500µs; +11.321µs] or [-4.220%; +1.050%]
  • ignore throughput [+7.552op/s; +51.029op/s] or [+0.814%; +5.502%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • ignore execution_time [-6.640µs; +17.519µs] or [-0.356%; +0.939%]
  • ignore throughput [-5.099op/s; +3.245op/s] or [-0.952%; +0.606%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472

  • ignore allocated_mem [-43 bytes; +21 bytes] or [-0.007%; +0.003%]
  • ignore execution_time [+22.170µs; +39.608µs] or [+0.866%; +1.547%]
  • ignore throughput [-5.836op/s; -3.262op/s] or [-1.494%; -0.835%]

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

  • ignore allocated_mem [-38 bytes; +46 bytes] or [-0.006%; +0.007%]
  • 🟩 execution_time [-137.182µs; -104.775µs] or [-6.949%; -5.308%]
  • 🟩 throughput [+29.611op/s; +38.520op/s] or [+5.845%; +7.604%]

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

  • ignore allocated_mem [-42 bytes; +23 bytes] or [-0.007%; +0.004%]
  • ignore execution_time [-156.348µs; -108.308µs] or [-3.965%; -2.747%]
  • ignore throughput [+7.495op/s; +10.618op/s] or [+2.956%; +4.187%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.001%; +0.008%]
  • 🟥 execution_time [+302.918ms; +304.189ms] or [+152.544%; +153.184%]
  • ignore throughput [+11106.651op/s; +13042.701op/s] or [+3.574%; +4.197%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.004%]
  • 🟥 execution_time [+302.279ms; +303.947ms] or [+151.473%; +152.308%]
  • ignore throughput [+28213.993op/s; +31806.910op/s] or [+4.448%; +5.015%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.004%]
  • 🟥 execution_time [+300.482ms; +303.783ms] or [+150.949%; +152.608%]
  • ignore throughput [+8709.532op/s; +16665.071op/s] or [+1.835%; +3.511%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.008%; +0.004%]
  • 🟥 execution_time [+303.494ms; +305.836ms] or [+152.404%; +153.581%]
  • ignore throughput [+536.651op/s; +2271.488op/s] or [+0.180%; +0.761%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.007%; +0.006%]
  • 🟥 execution_time [+298.455ms; +300.147ms] or [+147.573%; +148.409%]
  • ignore throughput [+7386.086op/s; +11555.123op/s] or [+1.190%; +1.862%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.004%]
  • 🟥 execution_time [+302.711ms; +308.658ms] or [+153.427%; +156.441%]
  • ignore throughput [-8145.615op/s; +1732.164op/s] or [-1.759%; +0.374%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • ignore allocated_mem [+0 bytes; +1 bytes] or [+0.108%; +0.119%]
  • 🟥 execution_time [+300.026ms; +302.214ms] or [+150.586%; +151.684%]
  • ignore throughput [+9559.006op/s; +12115.966op/s] or [+2.480%; +3.143%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.006%]
  • 🟥 execution_time [+298.675ms; +300.588ms] or [+148.862%; +149.815%]
  • 🟩 throughput [+62885.770op/s; +66959.577op/s] or [+12.487%; +13.296%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.006%]
  • 🟥 execution_time [+303.345ms; +306.888ms] or [+150.912%; +152.674%]
  • ignore throughput [-9718.665op/s; -3800.602op/s] or [-2.300%; -0.900%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.006%]
  • ignore execution_time [-1.763ms; -0.793ms] or [-0.876%; -0.394%]
  • ignore throughput [-12729.796op/s; -9927.330op/s] or [-5.119%; -3.992%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.003%]
  • 🟩 execution_time [-17.054ms; -13.413ms] or [-7.930%; -6.237%]
  • 🟩 throughput [+20792.692op/s; +27733.490op/s] or [+5.704%; +7.608%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.008%]
  • ignore execution_time [-1160.755µs; +2774.869µs] or [-0.582%; +1.392%]
  • ignore throughput [+6200.082op/s; +11868.007op/s] or [+2.263%; +4.332%]

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

  • ignore allocated_mem [-4.459KB; -4.431KB] or [-1.623%; -1.613%]
  • ignore execution_time [+4.659µs; +44.919µs] or [+1.151%; +11.095%]
  • ignore throughput [-236.298op/s; -32.060op/s] or [-9.509%; -1.290%]

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

  • 🟩 allocated_mem [-20.960KB; -20.940KB] or [-7.646%; -7.638%]
  • unstable execution_time [-48.490µs; +3.558µs] or [-9.584%; +0.703%]
  • ignore throughput [-2.978op/s; +177.953op/s] or [-0.149%; +8.880%]

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

  • ignore allocated_mem [-2.326KB; -2.310KB] or [-0.848%; -0.842%]
  • ignore execution_time [-50.812µs; +6.581µs] or [-8.805%; +1.141%]
  • ignore throughput [-4.343op/s; +152.139op/s] or [-0.248%; +8.692%]

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

  • ignore allocated_mem [-2 bytes; +2 bytes] or [-0.005%; +0.006%]
  • ignore execution_time [+194.243ns; +1624.424ns] or [+0.336%; +2.814%]
  • ignore throughput [-459.738op/s; -55.817op/s] or [-2.653%; -0.322%]

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

  • ignore allocated_mem [-4 bytes; +0 bytes] or [-0.010%; -0.001%]
  • 🟥 execution_time [+6.968µs; +10.671µs] or [+16.470%; +25.222%]
  • 🟥 throughput [-4949.635op/s; -3234.538op/s] or [-20.836%; -13.616%]

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

  • ignore allocated_mem [-1 bytes; +1 bytes] or [-0.002%; +0.002%]
  • unstable execution_time [-13.372µs; -6.094µs] or [-20.747%; -9.454%]
  • 🟩 throughput [+1544.245op/s; +3089.946op/s] or [+9.474%; +18.958%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • ignore allocated_mem [+2 bytes; +3 bytes] or [+0.061%; +0.072%]
  • 🟥 execution_time [+302.760ms; +304.134ms] or [+153.032%; +153.726%]
  • ignore throughput [-84.157op/s; -61.626op/s] or [-1.406%; -1.030%]

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

  • ignore allocated_mem [-1 bytes; +0 bytes] or [-0.027%; -0.017%]
  • 🟥 execution_time [+302.986ms; +305.203ms] or [+154.219%; +155.348%]
  • ignore throughput [-65.175op/s; +10.002op/s] or [-0.808%; +0.124%]

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

  • ignore allocated_mem [-1 bytes; +0 bytes] or [-0.027%; -0.017%]
  • 🟥 execution_time [+300.044ms; +302.564ms] or [+150.209%; +151.471%]
  • ignore throughput [-110.683op/s; -45.552op/s] or [-1.410%; -0.580%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.005%]
  • ignore execution_time [+0.858ms; +1.514ms] or [+0.428%; +0.755%]
  • ignore throughput [-9947.700op/s; -8695.786op/s] or [-2.754%; -2.407%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.007%]
  • ignore execution_time [-1010.168µs; -212.780µs] or [-0.505%; -0.106%]
  • 🟩 throughput [+43114.552op/s; +47599.691op/s] or [+8.161%; +9.010%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.006%]
  • ignore execution_time [+1.069ms; +4.756ms] or [+0.542%; +2.411%]
  • ignore throughput [-2848.290op/s; +5693.863op/s] or [-0.674%; +1.348%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.006%]
  • 🟥 execution_time [+300.494ms; +302.196ms] or [+149.769%; +150.618%]
  • ignore throughput [+1923.720op/s; +2945.992op/s] or [+1.270%; +1.945%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+0.000%; +0.009%]
  • 🟥 execution_time [+301.215ms; +304.279ms] or [+151.256%; +152.795%]
  • ignore throughput [+1996.838op/s; +4309.628op/s] or [+0.868%; +1.874%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.003%]
  • 🟥 execution_time [+302.869ms; +305.083ms] or [+153.596%; +154.718%]
  • ignore throughput [+306.160op/s; +2153.686op/s] or [+0.172%; +1.213%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • 🟥 execution_time [+299.637ms; +300.215ms] or [+149.461%; +149.749%]
  • 🟩 throughput [+61074583.295op/s; +61347928.593op/s] or [+44.478%; +44.677%]

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

  • ignore allocated_mem [+54 bytes; +56 bytes] or [+0.318%; +0.328%]
  • unstable execution_time [+352.699ms; +394.732ms] or [+438.644%; +490.919%]
  • 🟩 throughput [+979.537op/s; +1154.343op/s] or [+7.572%; +8.924%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [+nan%; +nan%]
  • 🟥 execution_time [+299.173ms; +300.100ms] or [+149.221%; +149.683%]
  • ignore throughput [+1691809.751op/s; +2631928.396op/s] or [+0.749%; +1.166%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.006%]
  • ignore execution_time [+381.008µs; +822.461µs] or [+0.191%; +0.411%]
  • ignore throughput [-13308.587op/s; -5305.179op/s] or [-1.485%; -0.592%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.007%]
  • ignore execution_time [-4.762ms; -3.662ms] or [-2.332%; -1.794%]
  • 🟩 throughput [+109069.400op/s; +116121.543op/s] or [+10.183%; +10.842%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.003%; +0.006%]
  • ignore execution_time [+1.491ms; +5.681ms] or [+0.754%; +2.874%]
  • 🟩 throughput [+65377.609op/s; +84926.642op/s] or [+7.567%; +9.830%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.000%; +0.009%]
  • ignore execution_time [-1.403ms; -0.601ms] or [-0.701%; -0.301%]
  • ignore throughput [+9140.917op/s; +13091.990op/s] or [+0.837%; +1.198%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.004%]
  • ignore execution_time [+6.249ms; +10.442ms] or [+3.256%; +5.440%]
  • 🟩 throughput [+93262.907op/s; +123780.249op/s] or [+7.219%; +9.581%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.001%; +0.008%]
  • ignore execution_time [-4.502ms; -2.948ms] or [-2.212%; -1.448%]
  • 🟩 throughput [+89903.905op/s; +98590.866op/s] or [+8.929%; +9.792%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.008%; +0.002%]
  • ignore execution_time [-1529.632µs; -347.328µs] or [-0.761%; -0.173%]
  • ignore throughput [+9635.543op/s; +12856.246op/s] or [+2.147%; +2.864%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.004%; +0.009%]
  • ignore execution_time [-520.027µs; +995.458µs] or [-0.260%; +0.497%]
  • 🟩 throughput [+55315.449op/s; +59892.883op/s] or [+10.044%; +10.875%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.006%; +0.004%]
  • ignore execution_time [+1.049ms; +5.202ms] or [+0.527%; +2.614%]
  • 🟩 throughput [+22531.046op/s; +32383.863op/s] or [+5.043%; +7.249%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.006%]
  • ignore execution_time [-1282.097µs; -353.766µs] or [-0.639%; -0.176%]
  • ignore throughput [-19154.506op/s; -13130.298op/s] or [-2.803%; -1.922%]

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

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.007%]
  • ignore execution_time [-1392.170µs; +2106.375µs] or [-0.696%; +1.054%]
  • 🟩 throughput [+60830.314op/s; +77929.492op/s] or [+6.796%; +8.707%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

  • ignore allocated_mem [+0 bytes; +0 bytes] or [-0.005%; +0.005%]
  • ignore execution_time [+1.329ms; +5.215ms] or [+0.675%; +2.649%]
  • ignore throughput [+30180.651op/s; +44741.839op/s] or [+4.214%; +6.247%]

@dd-trace-dotnet-ci-bot

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

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8435) 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.20 ± (71.24 - 71.59) ms-0.6%
.NET Framework 4.8 - Bailout
duration76.12 ± (75.87 - 76.26) ms75.39 ± (75.36 - 75.76) ms-1.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1062.39 ± (1066.52 - 1074.97) ms1061.79 ± (1063.83 - 1070.54) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.12 ± (22.08 - 22.16) ms22.33 ± (22.29 - 22.37) ms+1.0%✅⬆️
process.time_to_main_ms83.51 ± (83.32 - 83.69) ms83.22 ± (83.03 - 83.41) ms-0.3%
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.20 ± (22.17 - 22.23) ms-0.2%
process.time_to_main_ms85.17 ± (84.98 - 85.36) ms84.59 ± (84.39 - 84.80) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB10.95 ± (10.94 - 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_ms225.10 ± (223.79 - 226.40) ms224.66 ± (223.41 - 225.90) ms-0.2%
process.time_to_main_ms513.91 ± (512.81 - 515.01) ms517.01 ± (515.90 - 518.13) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.40 ± (48.36 - 48.44) MB48.29 ± (48.26 - 48.32) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms20.94 ± (20.91 - 20.98) ms21.00 ± (20.97 - 21.02) ms+0.2%✅⬆️
process.time_to_main_ms72.16 ± (72.00 - 72.33) ms72.20 ± (72.05 - 72.36) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.61) MB10.62 ± (10.62 - 10.62) 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.77 ± (20.75 - 20.80) ms+0.4%✅⬆️
process.time_to_main_ms72.11 ± (71.98 - 72.24) ms72.38 ± (72.22 - 72.53) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.65 ± (10.65 - 10.66) MB10.67 ± (10.66 - 10.67) MB+0.1%✅⬆️
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) ms388.53 ± (386.22 - 390.83) ms+1.0%✅⬆️
process.time_to_main_ms515.16 ± (514.33 - 515.99) ms516.57 ± (515.62 - 517.51) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.93 ± (49.90 - 49.96) MB49.75 ± (49.72 - 49.78) MB-0.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.00 ± (18.97 - 19.03) ms19.16 ± (19.14 - 19.19) ms+0.9%✅⬆️
process.time_to_main_ms70.73 ± (70.58 - 70.88) ms71.58 ± (71.41 - 71.74) ms+1.2%✅⬆️
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.69) 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.18 ± (19.15 - 19.21) ms+0.6%✅⬆️
process.time_to_main_ms72.07 ± (71.93 - 72.20) ms72.39 ± (72.22 - 72.56) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.75 ± (7.74 - 7.76) MB7.73 ± (7.72 - 7.74) MB-0.3%
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) ms306.20 ± (304.29 - 308.11) ms+0.6%✅⬆️
process.time_to_main_ms477.13 ± (476.39 - 477.87) ms478.05 ± (477.21 - 478.89) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.99 ± (36.97 - 37.01) MB38.10 ± (38.06 - 38.14) MB+3.0%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.4%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.70 ± (193.65 - 194.31) ms193.53 ± (193.46 - 194.35) ms-0.1%
.NET Framework 4.8 - Bailout
duration197.67 ± (197.53 - 198.05) ms196.70 ± (196.42 - 196.98) ms-0.5%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1148.69 ± (1150.80 - 1159.08) ms1140.35 ± (1140.42 - 1145.84) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms189.02 ± (188.75 - 189.30) ms187.56 ± (187.24 - 187.88) ms-0.8%
process.time_to_main_ms81.17 ± (80.97 - 81.37) ms81.18 ± (80.96 - 81.41) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.10 - 16.15) MB16.13 ± (16.10 - 16.16) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms188.34 ± (188.07 - 188.61) ms187.58 ± (187.26 - 187.89) ms-0.4%
process.time_to_main_ms82.68 ± (82.58 - 82.79) ms82.38 ± (82.22 - 82.54) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.13) MB16.13 ± (16.10 - 16.15) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms393.64 ± (392.04 - 395.24) ms394.16 ± (392.68 - 395.65) ms+0.1%✅⬆️
process.time_to_main_ms505.54 ± (504.22 - 506.86) ms511.22 ± (510.01 - 512.43) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.49 ± (58.27 - 58.70) MB58.96 ± (58.80 - 59.11) MB+0.8%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (30 - 30)+0.3%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.32 ± (192.06 - 192.59) ms191.81 ± (191.55 - 192.07) ms-0.3%
process.time_to_main_ms70.27 ± (70.14 - 70.41) ms70.39 ± (70.25 - 70.54) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.12 ± (15.99 - 16.25) MB16.02 ± (15.86 - 16.17) MB-0.7%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 19)+0.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.54 ± (191.28 - 191.81) ms191.26 ± (190.97 - 191.54) ms-0.2%
process.time_to_main_ms71.18 ± (71.11 - 71.25) ms71.33 ± (71.22 - 71.43) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.19 ± (16.05 - 16.32) MB15.94 ± (15.78 - 16.10) MB-1.5%
runtime.dotnet.threads.count19 ± (19 - 20)19 ± (19 - 19)-1.4%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms602.58 ± (599.75 - 605.41) ms599.71 ± (597.11 - 602.30) ms-0.5%
process.time_to_main_ms510.28 ± (509.52 - 511.03) ms511.14 ± (510.31 - 511.96) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.49 ± (61.40 - 61.58) MB61.52 ± (61.42 - 61.62) 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.22 ± (188.94 - 189.50) ms-0.4%
process.time_to_main_ms69.86 ± (69.72 - 70.00) ms69.70 ± (69.54 - 69.85) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.76 - 11.81) MB11.83 ± (11.79 - 11.88) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.1%
.NET 8 - Bailout
process.internal_duration_ms188.98 ± (188.73 - 189.24) ms188.73 ± (188.47 - 188.99) ms-0.1%
process.time_to_main_ms70.82 ± (70.74 - 70.89) ms70.84 ± (70.74 - 70.93) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.66 - 11.83) MB11.78 ± (11.71 - 11.85) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms520.74 ± (518.26 - 523.23) ms524.10 ± (521.70 - 526.50) ms+0.6%✅⬆️
process.time_to_main_ms470.49 ± (469.75 - 471.22) ms469.44 ± (468.66 - 470.23) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.73 ± (50.70 - 50.76) MB50.98 ± (50.94 - 51.01) MB+0.5%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.1%✅⬆️
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 (8435) - mean (71ms)  : 69, 74
    master - mean (72ms)  : 69, 75

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

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (1,067ms)  : 1019, 1116
    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 (8435) - mean (112ms)  : 109, 116
    master - mean (112ms)  : 109, 115

    section Bailout
    This PR (8435) - mean (113ms)  : 110, 116
    master - mean (114ms)  : 112, 117

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (780ms)  : 760, 801
    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 (8435) - mean (99ms)  : 96, 103
    master - mean (99ms)  : 95, 103

    section Bailout
    This PR (8435) - mean (99ms)  : 96, 102
    master - mean (99ms)  : 96, 101

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (934ms)  : 895, 972
    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 (8435) - mean (98ms)  : 94, 103
    master - mean (97ms)  : 94, 100

    section Bailout
    This PR (8435) - mean (99ms)  : 96, 102
    master - mean (99ms)  : 96, 101

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (817ms)  : 789, 845
    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 (8435) - mean (194ms)  : 189, 198
    master - mean (194ms)  : 191, 197

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

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (1,143ms)  : 1104, 1182
    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 (8435) - mean (277ms)  : 272, 282
    master - mean (279ms)  : 275, 283

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

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (933ms)  : 910, 955
    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 (8435) - mean (270ms)  : 266, 275
    master - mean (271ms)  : 267, 275

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

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (1,141ms)  : 1107, 1176
    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 (8435) - mean (269ms)  : 265, 272
    master - mean (269ms)  : 266, 273

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

    section CallTarget+Inlining+NGEN
    This PR (8435) - mean (1,026ms)  : 992, 1059
    master - mean (1,024ms)  : 982, 1066

Loading

@andrewlock
andrewlock marked this pull request as ready for review April 10, 2026 08:20
@andrewlock
andrewlock requested a review from a team as a code owner April 10, 2026 08:20
@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 requested a review from a team as a code owner April 10, 2026 12:29
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/client-side-stats-1-2 branch from d2adf6e to f8a1a26 Compare April 10, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors span lookup logic by extracting ContainsSpanId from TraceChunkModel into SpanCollection, enabling efficient span-id searching directly on the collection (for upcoming client-side-stats work) and adding unit tests for the new API.

Changes:

  • Added SpanCollection.ContainsSpanId(ulong spanId, int startIndex) implementing wrap-around search semantics.
  • Updated TraceChunkModel to use SpanCollection.ContainsSpanId instead of its private IndexOf helper.
  • Added unit tests covering ContainsSpanId behavior across default, single-span, and multi-span cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tracer/src/Datadog.Trace/Agent/SpanCollection.cs Introduces ContainsSpanId on SpanCollection to centralize span-id lookup logic.
tracer/src/Datadog.Trace/Agent/MessagePack/TraceChunkModel.cs Switches local-root/span-id lookup to the new SpanCollection.ContainsSpanId API and removes the old IndexOf implementation.
tracer/test/Datadog.Trace.Tests/Agent/SpanCollectionTests.cs Adds unit tests validating ContainsSpanId behavior and updates CreateSpan to allow custom span IDs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tracer/src/Datadog.Trace/Agent/SpanCollection.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/MessagePack/TraceChunkModel.cs
Comment thread tracer/test/Datadog.Trace.Tests/Agent/SpanCollectionTests.cs
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/refactor-trace-chunk-model branch from bda5853 to 682df90 Compare April 14, 2026 10:08
@andrewlock
andrewlock requested review from a team as code owners April 14, 2026 10:08
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/client-side-stats-1-2 branch from f8a1a26 to 5573211 Compare April 14, 2026 10:08
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/refactor-trace-chunk-model branch from 682df90 to bcf6c7a Compare April 16, 2026 07:59
@andrewlock
andrewlock requested review from a team as code owners April 16, 2026 07:59
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/client-side-stats-1-2 branch from 5573211 to e9ee48d Compare April 16, 2026 07:59
Base automatically changed from andrew/client-side-stats/client-side-stats-1-2 to master April 20, 2026 16:11
@andrewlock
andrewlock force-pushed the andrew/client-side-stats/refactor-trace-chunk-model branch from bcf6c7a to ce99c4b Compare April 20, 2026 16:12
@andrewlock
andrewlock enabled auto-merge (squash) April 20, 2026 16:13
@andrewlock
andrewlock merged commit aefdbef into master Apr 20, 2026
141 of 142 checks passed
@andrewlock
andrewlock deleted the andrew/client-side-stats/refactor-trace-chunk-model branch April 20, 2026 20:14
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 20, 2026
andrewlock added a commit that referenced this pull request Apr 21, 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:
- #8417
- #8418
- #8420
- #8435
andrewlock added a commit that referenced this pull request Apr 21, 2026
## Summary of changes

Improves the performance of peer-tag hash calculation for "fast path"
cases (where there's an existing bucket)

## Reason for change

We have to calculate the hash of all peer tags as part of
client-side-stats bucketing calculations, which involves encoding them
as utf-8. Additionally, when we _send_ the buckets, we have to send the
tags as utf-8.

In the initial CSS 1.2.0 implementation, we encoded the tags every-time
we ran a calculation, which would allocate for every span that had peer
tags, generally quite expensive. In this PR, we switch to doing the
encoding twice: once with a zero-allocation implementation (amortized 0
on .NET Framework) to calculate the hash, and then, _if_ we need the
"real" encoded tags, then we do that encoding again.

## Implementation details

- Split the peer tags work in two, once to calculate the peer tags hash,
once to get the actual tags as `key:value`
- In the hash-calculation stage, we can use `stackalloc` for .NET Core,
and array pool implementation for .NET Framework etc
- As additional optimizations, we also 
- Pre-encode the peer tag _keys_ to utf-8, so that we only need to do
those once for the hash calculation.
- Pass key details from `BuildKey` to `GetEncodedPeerTags` (i.e. is this
a "base service" only tag, if so, what's the tag value, otherwise how
big does the peer tag list need to be)
- If client-side stats is disabled, don't bother doing all the
pre-calculation (or for trace filters)

There are some possible future optimizations, _not_ implemented in this
PR:
- Track which tags require IP quantization to avoid re-doing it. (Maybe
we should allow-list the quantization anyway, so that it only applies to
specific tags? Or alternatively, block list?)
- Instead of doing the encoding of `tag:value`, allow writing the
pre-computed `byte[]` to `MessagePackBinary` and appending the `value`.
This is doable, but requires updating the `MessagePackBinary`
implementation to support it, so I considered it out of scope for now

## Test coverage

Mostly covered by existing tests, but added some additional unit tests
that directly compare the hashing to values used in Go agent tests.

Additionally did some benchmarking. The key thing is that the
`ClientSpanWithPeerTags` path is zero-allocation (and it's nice that the
slow-path is still lower allocation than before, even if it's slower
over all)

| Method | Runtime | Mean | Error | Allocated |
| -------------------------------------------------- |
------------------ | ----------: | ---------: | --------: |
| BuildKey_SimpleSpan_Before | .NET 10.0 | 44.34 ns | 0.906 ns | - |
| BuildKey_SimpleSpan_After | .NET 10.0 | 39.17 ns | 0.445 ns | - |
| BuildKey_SimpleSpan_Before | .NET 6.0 | 93.13 ns | 1.837 ns | - |
| BuildKey_SimpleSpan_After | .NET 6.0 | 87.56 ns | 0.839 ns | - |
| BuildKey_SimpleSpan_Before | .NET Core 3.1 | 192.53 ns | 2.572 ns | -
|
| BuildKey_SimpleSpan_After | .NET Core 3.1 | 217.32 ns | 4.362 ns | - |
| BuildKey_SimpleSpan_Before | .NET Framework 4.8 | 131.98 ns | 2.621 ns
| - |
| BuildKey_SimpleSpan_After | .NET Framework 4.8 | 175.20 ns | 7.647 ns
| - |
| | | | | |
| BuildKey_ClientSpanNoPeerTags_Before | .NET 10.0 | 160.62 ns | 2.622
ns | - |
| BuildKey_ClientSpanNoPeerTags_After | .NET 10.0 | 151.27 ns | 1.995 ns
| - |
| BuildKey_ClientSpanNoPeerTags_Before | .NET 6.0 | 243.62 ns | 3.199 ns
| - |
| BuildKey_ClientSpanNoPeerTags_After | .NET 6.0 | 232.55 ns | 2.975 ns
| - |
| BuildKey_ClientSpanNoPeerTags_Before | .NET Core 3.1 | 550.47 ns |
9.998 ns | - |
| BuildKey_ClientSpanNoPeerTags_After | .NET Core 3.1 | 680.42 ns |
10.022 ns | - |
| BuildKey_ClientSpanNoPeerTags_Before | .NET Framework 4.8 | 442.88 ns
| 8.854 ns | - |
| BuildKey_ClientSpanNoPeerTags_After | .NET Framework 4.8 | 682.12 ns |
13.468 ns | - |
| | | | | |
| BuildKey_ClientSpanWithPeerTags_Before | .NET 10.0 | 800.82 ns |
15.062 ns | 840 B |
| BuildKey_ClientSpanWithPeerTags_After | .NET 10.0 | 575.04 ns | 5.604
ns | - |
| BuildKey_ClientSpanWithPeerTags_Before | .NET 6.0 | 1,076.07 ns |
13.124 ns | 840 B |
| BuildKey_ClientSpanWithPeerTags_After | .NET 6.0 | 1,440.26 ns |
28.755 ns | - |
| BuildKey_ClientSpanWithPeerTags_Before | .NET Core 3.1 | 1,531.27 ns |
13.509 ns | 840 B |
| BuildKey_ClientSpanWithPeerTags_After | .NET Core 3.1 | 1,774.35 ns |
89.601 ns | - |
| BuildKey_ClientSpanWithPeerTags_Before | .NET Framework 4.8 | 1,682.15
ns | 17.082 ns | 859 B |
| BuildKey_ClientSpanWithPeerTags_After | .NET Framework 4.8 | 2,040.90
ns | 162.895 ns | - |
| | | | | |
| BuildKey_ClientSpanWithPeerTags_GetEncodedPeerTags | .NET 10.0 |
1,141.85 ns | 9.980 ns | 760 B |
| BuildKey_ClientSpanWithPeerTags_GetEncodedPeerTags | .NET 6.0 |
2,720.55 ns | 53.097 ns | 760 B |
| BuildKey_ClientSpanWithPeerTags_GetEncodedPeerTags | .NET Core 3.1 |
3,534.28 ns | 141.234 ns | 760 B |
| BuildKey_ClientSpanWithPeerTags_GetEncodedPeerTags | .NET Framework
4.8 | 3,438.80 ns | 84.352 ns | 778 B |


<details><summary>Details</summary>
<p>

```csharp
// <copyright file="StatsAggregatorBenchmark.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Datadog.Trace;
using Datadog.Trace.Agent;
using Datadog.Trace.Agent.DiscoveryService;
using Datadog.Trace.Configuration;
using Datadog.Trace.Tagging;

namespace Benchmarks.Trace;

/// <summary>
/// StatsAggregator.BuildKey benchmarks
/// </summary>
[MemoryDiagnoser]
[BenchmarkCategory(Constants.TracerCategory)]
public class StatsAggregatorBenchmark
{
    private static readonly List<StatsAggregator.PeerTagKey> PeerTagKeys =
    [
        new("_dd.base_service"),
        new("aws.queue.name"),
        new("aws.queue.url"),
        new("aws.s3.bucket"),
        new("aws.stream.name"),
        new("bucketname"),
        new("db.couchbase.seed.nodes"),
        new("db.hostname"),
        new("db.instance"),
        new("db.system"),
        new("messaging.destination"),
        new("messaging.kafka.bootstrap.servers"),
        new("messaging.rabbitmq.exchange"),
        new("messaging.system"),
        new("network.destination.name"),
        new("peer.hostname"),
        new("peer.service"),
        new("server.address"),
        new("topic"),
    ];

    private StatsAggregator _aggregator;
    private Span _simpleSpan;
    private Span _clientSpanNoPeerTags;
    private Span _clientSpanWithPeerTags;
    private StatsAggregationKey _key;
    private List<byte[]> _encoded;

    [GlobalSetup]
    public void GlobalSetup()
    {
        _aggregator = new StatsAggregator(
            new NoOpApi(),
            new TracerSettings(),
            NullDiscoveryService.Instance,
            isOtlp: false);

        var now = DateTimeOffset.UtcNow;

        // Simple span: no span kind, no peer tags — exercises the "internal" fast path
        _simpleSpan = CreateSpan(now, "web-service", "web.request", "GET /api/users", "web");

        // Client span with SpanKind but no matching peer tags — iterates peer tag keys but finds nothing
        var clientTags = new HttpTags { HttpMethod = "GET", HttpStatusCode = "200" };
        _clientSpanNoPeerTags = CreateSpan(now, "web-service", "http.request", "GET /api/orders", "http", clientTags);

        // Client span with several peer tags set — the most expensive path
        var peerTags = new HttpTags { HttpMethod = "POST", HttpStatusCode = "200" };
        _clientSpanWithPeerTags = CreateSpan(now, "web-service", "http.request", "POST /api/data", "http", peerTags);
        _clientSpanWithPeerTags.Tags.SetTag("peer.service", "remote-service");
        _clientSpanWithPeerTags.Tags.SetTag("db.instance", "i-1234");
        _clientSpanWithPeerTags.Tags.SetTag("db.system", "postgres");
        _clientSpanWithPeerTags.Tags.SetTag("server.address", "db.example.com");
        _clientSpanWithPeerTags.Tags.SetTag("network.destination.name", "db.example.com");

    }

    [GlobalCleanup]
    public void GlobalCleanup()
    {
        _aggregator.DisposeAsync().GetAwaiter().GetResult();
        var value = _key;
        var encoded = _encoded;
    }

    /// <summary>
    /// BuildKey for a simple span with no span kind (internal fast-path, no peer tag iteration).
    /// </summary>
    [Benchmark]
    public void BuildKey_SimpleSpan()
    {
        _key = _aggregator.BuildKey(_simpleSpan, PeerTagKeys, out _);
    }

    /// <summary>
    /// BuildKey for a client span that has no matching peer tags (iterates all peer tag keys, finds none).
    /// </summary>
    [Benchmark]
    public void BuildKey_ClientSpanNoPeerTags()
    {
        _key = _aggregator.BuildKey(_clientSpanNoPeerTags, PeerTagKeys, out _);
    }

    /// <summary>
    /// BuildKey for a client span with several peer tags set (UTF-8 encoding + FNV hashing).
    /// </summary>
    [Benchmark]
    public void BuildKey_ClientSpanWithPeerTags()
    {
        _key = _aggregator.BuildKey(_clientSpanWithPeerTags, PeerTagKeys, out var results);
    }

    /// <summary>
    /// BuildKey for a client span with several peer tags set (UTF-8 encoding + FNV hashing).
    /// </summary>
    [Benchmark]
    public void BuildKey_ClientSpanWithPeerTags_GetEncodedPeerTags()
    {
        _key = _aggregator.BuildKey(_clientSpanWithPeerTags, PeerTagKeys, out var results);
        _encoded = StatsAggregator.GetEncodedPeerTags(_clientSpanWithPeerTags, PeerTagKeys, in results);
    }

    private static Span CreateSpan(DateTimeOffset start, string serviceName, string operationName, string resourceName, string type, ITags tags = null)
    {
        var tracer = Benchmarks.Trace.Asm.EmptyDatadogTracer.Instance;
        var traceContext = new TraceContext(tracer);
        var context = new SpanContext(null, traceContext, serviceName);
        var span = new Span(context, start, tags);
        span.OperationName = operationName;
        span.ResourceName = resourceName;
        span.Type = type;
        return span;
    }

    private sealed class NoOpApi : IApi
    {
        public TracesEncoding TracesEncoding => TracesEncoding.DatadogV0_4;

        public Task<bool> Ping() => Task.FromResult(true);

        public Task<bool> SendTracesAsync(ArraySegment<byte> traces, int numberOfTraces, bool statsComputationEnabled, long numberOfDroppedP0Traces, long numberOfDroppedP0Spans, bool apmTracingEnabled = true)
            => Task.FromResult(true);

        public Task<bool> SendStatsAsync(StatsBuffer stats, long bucketDuration, int tracerObfuscationVersion)
            => Task.FromResult(true);
    }
}
```

</p>
</details> 


## Other details


Part of a stack:
- #8417
- #8418
- #8420
- #8435
- #8436
- #8444
andrewlock added a commit that referenced this pull request Apr 23, 2026
## Summary of changes

Removes the minimum-agent version check from the client-side-stats check

## Reason for change

We didn't have it before, which means people who previously had stats,
suddenly won't have them. Also other agents (like bottlecap etc) don't
have the version. And we haven't figured out how to handle that yet.
While CSS is off by default, this seems like the best option to take.

## Implementation details

Remove the code that is checking for CSS support.

## Test coverage

Covered by existing (and removed a test for the behaviour)

## Other details

Follows on from 
- #8417
- #8418
- #8420
- #8435
- #8436
- #8444
- #8445
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:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants