Skip to content

Tweak BatchingSink to remove flake#8696

Merged
andrewlock merged 1 commit into
masterfrom
andrew/fix-batching-sink-tests
May 29, 2026
Merged

Tweak BatchingSink to remove flake#8696
andrewlock merged 1 commit into
masterfrom
andrew/fix-batching-sink-tests

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

  • Allow optionally not starting the BatchingSink flush task for tests
  • Rewrite BatchingSinkTests to "manually drive" the behaviour

Reason for change

BatchingSinkTests is, and always has been, flaky, because it relies on timings. #8601 refactored the DiscoveryServiceTests to avoid the timing dependence, and this PR does the same for BatchingSink.

Implementation details

  • Allow optionally not starting the background flush loop for BatchingSink, and instead expose the "component" methods.
  • Rewrite the BatchingSinkTests to imitate what the background loop does, but without depending on any timings

Test coverage

The coverage should be essentially the same, we just removed all of the potential flake-causing timing issues

Other details

It might be easier to review the BatchingSink file with whitespace ignored, there's very few "real" changes in there, just structural changes

@andrewlock
andrewlock requested a review from a team as a code owner May 27, 2026 10:09
@andrewlock andrewlock changed the title Rewrite BatchingSink to remove flake Rewrite BatchingSink to remove flake May 27, 2026
@andrewlock andrewlock changed the title Rewrite BatchingSink to remove flake Tweak BatchingSink to remove flake May 27, 2026
@pr-commenter

pr-commenter Bot commented May 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-27 10:46:00

Comparing candidate commit 0af0c80 in PR branch andrew/fix-batching-sink-tests with baseline commit 7174a42 in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 61 known flaky benchmarks, 65 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 ----------------------------------'

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5095.897op/s; -4675.555op/s] or [-5.817%; -5.337%]

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.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472

  • 🟥 throughput [-12820.863op/s; -11139.431op/s] or [-6.381%; -5.544%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-7397.170op/s; -6968.215op/s] or [-8.771%; -8.262%]

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

  • unstable execution_time [-30.825ms; -7.862ms] or [-15.504%; -3.954%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+305.101ms; +311.354ms] or [+151.402%; +154.505%]
  • 🟥 throughput [-49.778op/s; -44.844op/s] or [-8.956%; -8.068%]

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

  • 🟥 execution_time [+379.402ms; +382.229ms] or [+299.751%; +301.984%]
  • 🟩 throughput [+95.908op/s; +102.698op/s] or [+12.645%; +13.540%]

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

  • 🟥 execution_time [+391.810ms; +395.834ms] or [+346.737%; +350.298%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-16.473ms; -12.275ms] or [-7.693%; -5.733%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-290442.765op/s; -280076.022op/s] or [-29.656%; -28.597%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-25.741ms; -20.610ms] or [-11.479%; -9.191%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-161854.855op/s; -145882.589op/s] or [-23.255%; -20.961%]

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

  • 🟩 throughput [+8886.585op/s; +11776.641op/s] or [+5.654%; +7.493%]

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

  • 🟩 throughput [+8771.638op/s; +11435.141op/s] or [+6.988%; +9.110%]

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

  • 🟩 throughput [+369376.161op/s; +489146.407op/s] or [+12.317%; +16.310%]

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

  • 🟩 execution_time [-18.372ms; -13.982ms] or [-8.469%; -6.445%]
  • 🟩 throughput [+158163.084op/s; +211704.965op/s] or [+6.278%; +8.403%]

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

  • 🟥 execution_time [+299.730ms; +300.376ms] or [+149.765%; +150.088%]

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

  • 🟥 execution_time [+299.649ms; +302.959ms] or [+151.114%; +152.783%]
  • 🟩 throughput [+674.377op/s; +885.437op/s] or [+5.158%; +6.772%]

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

  • 🟥 execution_time [+300.841ms; +303.242ms] or [+151.540%; +152.750%]

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

  • 🟥 execution_time [+297.385ms; +298.284ms] or [+146.064%; +146.505%]

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

  • 🟥 execution_time [+296.116ms; +297.826ms] or [+144.760%; +145.596%]

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

  • 🟥 execution_time [+297.415ms; +300.064ms] or [+148.648%; +149.971%]

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

  • 🟥 execution_time [+24.484µs; +48.206µs] or [+7.816%; +15.390%]
  • 🟥 throughput [-446.376op/s; -246.837op/s] or [-13.915%; -7.695%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.945ms; +300.829ms] or [+149.703%; +150.145%]

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

  • 🟥 execution_time [+420.744ms; +427.375ms] or [+457.155%; +464.361%]

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

  • 🟥 execution_time [+360.515ms; +366.684ms] or [+273.736%; +278.420%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+288.152ms; +336.936ms] or [+132.490%; +154.920%]
  • 🟥 throughput [-536.183op/s; -487.419op/s] or [-48.583%; -44.165%]

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

  • unstable execution_time [+200.158ms; +333.508ms] or [+85.299%; +142.127%]
  • 🟥 throughput [-673.269op/s; -589.636op/s] or [-44.907%; -39.329%]

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

  • 🟥 execution_time [+332.475ms; +341.328ms] or [+198.858%; +204.154%]
  • 🟥 throughput [-413.921op/s; -374.602op/s] or [-28.821%; -26.083%]

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

  • unstable throughput [+11.587op/s; +51.722op/s] or [+3.331%; +14.867%]

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

  • 🟩 execution_time [-191.587µs; -141.486µs] or [-9.705%; -7.167%]
  • 🟩 throughput [+41.114op/s; +54.603op/s] or [+8.116%; +10.779%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+302.106ms; +304.203ms] or [+152.135%; +153.191%]

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

  • 🟥 execution_time [+301.226ms; +302.862ms] or [+150.945%; +151.765%]

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

  • 🟥 execution_time [+301.134ms; +304.474ms] or [+151.277%; +152.955%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.159ms; +304.068ms] or [+151.734%; +152.693%]

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

  • 🟥 execution_time [+300.295ms; +302.090ms] or [+148.482%; +149.370%]

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

  • 🟥 execution_time [+302.451ms; +306.335ms] or [+153.295%; +155.264%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.576ms; +302.145ms] or [+150.360%; +151.650%]

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

  • 🟥 execution_time [+304.809ms; +308.181ms] or [+151.920%; +153.600%]
  • 🟩 throughput [+46015.896op/s; +50258.634op/s] or [+9.137%; +9.980%]

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

  • 🟥 execution_time [+301.998ms; +304.764ms] or [+150.241%; +151.618%]

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

  • 🟩 execution_time [-17.374ms; -13.536ms] or [-8.079%; -6.294%]

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

  • unstable execution_time [+1.331µs; +43.940µs] or [+0.329%; +10.854%]

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

  • 🟩 allocated_mem [-20.636KB; -20.613KB] or [-7.527%; -7.519%]
  • unstable execution_time [-43.593µs; +12.364µs] or [-8.616%; +2.444%]

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

  • unstable execution_time [+7.557µs; +12.142µs] or [+17.862%; +28.700%]
  • 🟥 throughput [-5342.312op/s; -3500.324op/s] or [-22.489%; -14.735%]

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

  • unstable execution_time [-13.434µs; -4.484µs] or [-20.843%; -6.956%]
  • unstable throughput [+1265.682op/s; +3130.655op/s] or [+7.765%; +19.208%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.413ms; +304.502ms] or [+152.351%; +153.912%]

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

  • 🟥 execution_time [+305.052ms; +309.673ms] or [+155.271%; +157.623%]

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

  • 🟥 execution_time [+297.115ms; +299.652ms] or [+148.743%; +150.013%]

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

  • 🟩 throughput [+31412.350op/s; +35257.660op/s] or [+5.946%; +6.674%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.034ms; +300.007ms] or [+148.543%; +149.527%]

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

  • 🟥 execution_time [+301.444ms; +304.128ms] or [+151.371%; +152.718%]

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

  • 🟥 execution_time [+303.396ms; +305.808ms] or [+153.863%; +155.086%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.350ms; +301.534ms] or [+149.816%; +150.407%]
  • 🟩 throughput [+61069367.652op/s; +61415149.955op/s] or [+44.475%; +44.726%]

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

  • unstable execution_time [+278.790ms; +351.324ms] or [+346.724%; +436.934%]

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

  • 🟥 execution_time [+299.457ms; +300.813ms] or [+149.362%; +150.038%]

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

  • 🟩 throughput [+91343.907op/s; +102414.127op/s] or [+8.528%; +9.562%]

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

  • 🟩 throughput [+81716.901op/s; +111921.927op/s] or [+6.325%; +8.663%]

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

  • 🟩 throughput [+81924.889op/s; +91052.668op/s] or [+8.136%; +9.043%]

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

  • 🟩 throughput [+53377.784op/s; +58036.205op/s] or [+9.692%; +10.538%]

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

  • 🟩 throughput [+23618.035op/s; +34158.140op/s] or [+5.286%; +7.646%]

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

  • 🟩 throughput [+96605.350op/s; +115833.088op/s] or [+10.793%; +12.941%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • 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.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • 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.StringConcatAspectBenchmark 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.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • 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 (8696) 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
duration74.83 ± (74.64 - 75.14) ms76.35 ± (75.98 - 76.59) ms+2.0%✅⬆️
.NET Framework 4.8 - Bailout
duration78.50 ± (78.43 - 78.90) ms77.94 ± (77.86 - 78.33) ms-0.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1110.79 ± (1110.14 - 1118.29) ms1108.94 ± (1107.69 - 1116.58) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.73 ± (22.68 - 22.78) ms22.72 ± (22.66 - 22.78) ms-0.0%
process.time_to_main_ms86.27 ± (85.97 - 86.57) ms85.63 ± (85.34 - 85.91) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.91 - 10.92) MB10.93 ± (10.92 - 10.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.51 ± (22.47 - 22.56) ms22.46 ± (22.41 - 22.50) ms-0.3%
process.time_to_main_ms85.79 ± (85.60 - 85.98) ms86.11 ± (85.90 - 86.33) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.96) MB10.96 ± (10.96 - 10.97) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms213.55 ± (212.71 - 214.39) ms215.62 ± (214.61 - 216.63) ms+1.0%✅⬆️
process.time_to_main_ms544.71 ± (543.37 - 546.04) ms544.14 ± (542.83 - 545.45) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.67 ± (48.64 - 48.70) MB48.55 ± (48.52 - 48.59) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms21.37 ± (21.32 - 21.43) ms21.20 ± (21.17 - 21.24) ms-0.8%
process.time_to_main_ms74.77 ± (74.50 - 75.04) ms73.56 ± (73.38 - 73.73) ms-1.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.61) MB10.65 ± (10.65 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.13 ± (21.09 - 21.16) ms21.51 ± (21.45 - 21.57) ms+1.8%✅⬆️
process.time_to_main_ms74.65 ± (74.48 - 74.83) ms76.51 ± (76.19 - 76.82) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.73) MB10.76 ± (10.76 - 10.76) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.75 ± (367.49 - 372.02) ms369.10 ± (366.95 - 371.25) ms-0.2%
process.time_to_main_ms551.44 ± (550.16 - 552.71) ms548.84 ± (547.67 - 550.01) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.01 ± (49.98 - 50.03) MB50.10 ± (50.07 - 50.12) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.39 ± (19.35 - 19.43) ms19.29 ± (19.25 - 19.33) ms-0.5%
process.time_to_main_ms73.41 ± (73.17 - 73.65) ms72.19 ± (71.99 - 72.38) ms-1.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.68) MB7.69 ± (7.69 - 7.70) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.51 ± (19.46 - 19.56) ms19.15 ± (19.12 - 19.19) ms-1.8%
process.time_to_main_ms75.33 ± (75.04 - 75.61) ms73.00 ± (72.83 - 73.17) ms-3.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.71 - 7.71) MB7.73 ± (7.72 - 7.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms296.40 ± (294.05 - 298.76) ms294.40 ± (292.11 - 296.69) ms-0.7%
process.time_to_main_ms494.23 ± (493.16 - 495.30) ms501.35 ± (500.23 - 502.47) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.93 ± (36.90 - 36.96) MB36.94 ± (36.91 - 36.97) MB+0.0%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration197.55 ± (197.49 - 198.34) ms198.55 ± (198.25 - 199.10) ms+0.5%✅⬆️
.NET Framework 4.8 - Bailout
duration201.60 ± (201.16 - 202.06) ms203.61 ± (202.79 - 203.49) ms+1.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1192.70 ± (1192.65 - 1198.06) ms1201.98 ± (1203.76 - 1210.95) ms+0.8%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms194.00 ± (193.64 - 194.35) ms192.81 ± (192.32 - 193.29) ms-0.6%
process.time_to_main_ms84.27 ± (84.01 - 84.53) ms83.69 ± (83.45 - 83.93) ms-0.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.04 - 16.10) MB16.05 ± (16.03 - 16.08) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms193.68 ± (193.33 - 194.03) ms193.80 ± (193.32 - 194.29) ms+0.1%✅⬆️
process.time_to_main_ms85.60 ± (85.39 - 85.82) ms85.31 ± (85.09 - 85.53) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.20) MB16.13 ± (16.11 - 16.15) MB-0.2%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms389.08 ± (387.78 - 390.39) ms388.36 ± (386.92 - 389.80) ms-0.2%
process.time_to_main_ms540.88 ± (539.75 - 542.01) ms534.72 ± (533.64 - 535.80) ms-1.1%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.22 ± (57.98 - 58.46) MB57.59 ± (57.41 - 57.77) MB-1.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.5%
.NET 6 - Baseline
process.internal_duration_ms198.38 ± (197.90 - 198.87) ms197.40 ± (196.91 - 197.89) ms-0.5%
process.time_to_main_ms72.32 ± (72.09 - 72.56) ms72.18 ± (71.92 - 72.44) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.30 - 16.37) MB16.40 ± (16.37 - 16.43) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+1.7%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms198.21 ± (197.72 - 198.69) ms196.35 ± (195.96 - 196.74) ms-0.9%
process.time_to_main_ms73.64 ± (73.41 - 73.87) ms73.29 ± (73.13 - 73.45) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.39 ± (16.36 - 16.41) MB16.47 ± (16.44 - 16.50) MB+0.5%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms587.00 ± (584.90 - 589.10) ms587.09 ± (584.40 - 589.78) ms+0.0%✅⬆️
process.time_to_main_ms545.78 ± (544.77 - 546.78) ms543.74 ± (542.65 - 544.82) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.17 ± (61.08 - 61.26) MB61.30 ± (61.19 - 61.42) MB+0.2%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.5%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms195.23 ± (194.82 - 195.65) ms195.36 ± (194.86 - 195.86) ms+0.1%✅⬆️
process.time_to_main_ms71.75 ± (71.47 - 72.02) ms71.58 ± (71.35 - 71.81) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.75 - 11.79) MB11.66 ± (11.65 - 11.68) MB-0.9%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.6%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms194.77 ± (194.26 - 195.28) ms193.93 ± (193.44 - 194.42) ms-0.4%
process.time_to_main_ms72.78 ± (72.56 - 72.99) ms72.42 ± (72.23 - 72.62) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.72 - 11.77) MB11.77 ± (11.74 - 11.80) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms514.42 ± (512.34 - 516.50) ms513.48 ± (510.94 - 516.02) ms-0.2%
process.time_to_main_ms492.52 ± (491.64 - 493.40) ms491.62 ± (490.49 - 492.75) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.67 ± (50.64 - 50.71) MB50.60 ± (50.57 - 50.64) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-0.7%
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 (8696) - mean (76ms)  : 72, 81
    master - mean (75ms)  : 71, 79

    section Bailout
    This PR (8696) - mean (78ms)  : 75, 82
    master - mean (79ms)  : 75, 82

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (1,112ms)  : 1044, 1181
    master - mean (1,114ms)  : 1055, 1174

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 (8696) - mean (115ms)  : 110, 121
    master - mean (116ms)  : 111, 121

    section Bailout
    This PR (8696) - mean (116ms)  : 112, 119
    master - mean (115ms)  : 113, 118

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (796ms)  : 774, 819
    master - mean (795ms)  : 767, 822

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8696) - mean (101ms)  : 98, 104
    master - mean (103ms)  : 97, 109

    section Bailout
    This PR (8696) - mean (105ms)  : 98, 112
    master - mean (102ms)  : 99, 105

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (950ms)  : 911, 989
    master - mean (950ms)  : 906, 994

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

    section Bailout
    This PR (8696) - mean (100ms)  : 97, 102
    master - mean (103ms)  : 97, 109

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (828ms)  : 786, 870
    master - mean (820ms)  : 780, 861

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 (8696) - mean (199ms)  : 194, 203
    master - mean (198ms)  : 193, 203

    section Bailout
    This PR (8696) - mean (203ms)  : 200, 207
    master - mean (202ms)  : 197, 206

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (1,207ms)  : 1156, 1259
    master - mean (1,195ms)  : 1162, 1229

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 (8696) - mean (286ms)  : 278, 293
    master - mean (287ms)  : 282, 292

    section Bailout
    This PR (8696) - mean (288ms)  : 281, 294
    master - mean (288ms)  : 282, 293

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (964ms)  : 942, 985
    master - mean (971ms)  : 944, 999

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8696) - mean (278ms)  : 272, 285
    master - mean (279ms)  : 270, 287

    section Bailout
    This PR (8696) - mean (277ms)  : 272, 283
    master - mean (280ms)  : 272, 289

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (1,161ms)  : 1126, 1196
    master - mean (1,161ms)  : 1127, 1194

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8696) - mean (277ms)  : 267, 286
    master - mean (277ms)  : 271, 283

    section Bailout
    This PR (8696) - mean (276ms)  : 269, 283
    master - mean (277ms)  : 271, 283

    section CallTarget+Inlining+NGEN
    This PR (8696) - mean (1,038ms)  : 979, 1097
    master - mean (1,039ms)  : 1008, 1070

Loading

@NachoEchevarria NachoEchevarria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@bouwkast bouwkast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice thanks!

@andrewlock
andrewlock merged commit 5b90434 into master May 29, 2026
143 checks passed
@andrewlock
andrewlock deleted the andrew/fix-batching-sink-tests branch May 29, 2026 12:42
@github-actions github-actions Bot added this to the vNext-v3 milestone May 29, 2026
andrewlock added a commit that referenced this pull request Jun 2, 2026
## Summary of changes

Refactor the `DirectSubmissionLogSink` and `DatadogSinkTests` to remove
flake

## Reason for change

The tests are currently flaky, and there was some recent changes to work
on this in #8696

## Implementation details

Basically the same as #8696 - don't start the background job, and just
call the methods directly

## Test coverage

Same coverage, now with less flake 🤞
andrewlock added a commit that referenced this pull request Jun 2, 2026
## Summary of changes

Refactor the `OtlpSubmissionLogSink` and `OtlpSinkTests` to remove flake

## Reason for change

The tests are currently flaky, and there was some recent changes to work
on this in #8696

## Implementation details

Basically the same as #8696 and #8714 - don't start the background job,
and just call the methods directly

## Test coverage

Same coverage, now with less flake 🤞
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants