Skip to content

Implement span-derived primary tags (AKA Additional tags) on Client-Side-Stats computation#8766

Merged
andrewlock merged 8 commits into
masterfrom
andrew/span-derived-primary-tags
Jul 2, 2026
Merged

Implement span-derived primary tags (AKA Additional tags) on Client-Side-Stats computation#8766
andrewlock merged 8 commits into
masterfrom
andrew/span-derived-primary-tags

Conversation

@andrewlock

@andrewlock andrewlock commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary of changes

Implements span-derived primary tags (also called "Additional metric tags")

Reason for change

This is a feature requested by customers, and defined in the RFC

Implementation details

  • Add DD_TRACE_STATS_ADDITIONAL_TAGS for controlling which span-tags to include as metric dimensions in client-side-stats
    • This is an experimental feature, so is gated on DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED currently
  • Include the defined tags as additional dimensions in the metric key (similar to peer tags)
  • Apply cardinality limits to avoid memory leaks
    • NOTE: the cardinality limits implemented here are somewhat superseded by a subsequent RFC, and so are only partially implemented here.

Test coverage

  • Added unit tests for all the behaviour
  • System tests TBC - once they're implemented, I'll enable them and confirm they're worked

Other details

Some aspects of the RFC are missing/modified based on other discussions

  • The telemetry metric in the span tags RFC is not defined, we will add the cardinality limit version instead.
  • The required logging will be added as part of the cardinality RFC implementation
  • Cardinality protection doesn't entirely match the RFC, as it follows the later RFC

Part of a stack

https://datadoghq.atlassian.net/browse/APMLP-1446

@datadog-prod-us1-4

This comment has been minimized.

@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from b535a3d to 529937d Compare June 8, 2026 15:08
@andrewlock
andrewlock marked this pull request as draft June 8, 2026 15:12

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b535a3dc2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tracer/src/Datadog.Trace/Agent/StatsAggregator.cs
Comment thread tracer/src/Datadog.Trace/Agent/StatsAggregator.cs
Comment thread tracer/src/Datadog.Trace/Configuration/TracerSettings.cs
@pr-commenter

pr-commenter Bot commented Jun 8, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-30 08:36:24

Comparing candidate commit 889f756 in PR branch andrew/span-derived-primary-tags with baseline commit d0dbc99 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 3 performance regressions! Performance is the same for 69 metrics, 0 unstable metrics, 63 known flaky benchmarks, 63 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.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net472

  • 🟥 throughput [-16979.101op/s; -16052.528op/s] or [-8.537%; -8.071%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan net472

  • 🟥 throughput [-11360.723op/s; -10333.923op/s] or [-6.036%; -5.490%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive net472

  • 🟥 throughput [-11752.296op/s; -10115.971op/s] or [-6.735%; -5.797%]

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.TelemetrySpanBenchmark.StartSpan net472

  • 🟥 throughput [-16818.023op/s; -15157.444op/s] or [-8.638%; -7.785%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-6297.526op/s; -5661.043op/s] or [-7.467%; -6.712%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+311.499ms; +319.211ms] or [+154.577%; +158.404%]
  • 🟥 throughput [-43.808op/s; -40.166op/s] or [-7.882%; -7.227%]

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

  • 🟥 execution_time [+386.300ms; +388.748ms] or [+305.201%; +307.134%]
  • 🟩 throughput [+79.897op/s; +83.925op/s] or [+10.534%; +11.065%]

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

  • 🟥 execution_time [+393.058ms; +396.104ms] or [+347.842%; +350.537%]

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 [-15.789ms; -11.548ms] or [-7.374%; -5.393%]
  • 🟩 throughput [+7162.361op/s; +10079.007op/s] or [+5.228%; +7.357%]

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 [-262887.359op/s; -259584.283op/s] or [-26.842%; -26.505%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-25.987ms; -21.115ms] or [-11.589%; -9.416%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-154503.091op/s; -138268.235op/s] or [-22.199%; -19.866%]

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

  • 🟩 throughput [+8231.700op/s; +11160.534op/s] or [+5.238%; +7.101%]

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

  • 🟩 throughput [+9349.527op/s; +12031.754op/s] or [+7.448%; +9.585%]

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

  • 🟩 throughput [+515835.100op/s; +526975.616op/s] or [+17.200%; +17.572%]

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

  • 🟩 execution_time [-19.024ms; -14.694ms] or [-8.769%; -6.774%]
  • 🟩 throughput [+146921.502op/s; +203806.201op/s] or [+5.832%; +8.090%]

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

  • 🟥 execution_time [+300.257ms; +301.229ms] or [+150.028%; +150.514%]

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

  • 🟥 execution_time [+298.585ms; +301.755ms] or [+150.577%; +152.176%]
  • 🟩 throughput [+659.993op/s; +872.996op/s] or [+5.048%; +6.677%]

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

  • 🟥 execution_time [+299.860ms; +302.829ms] or [+151.046%; +152.542%]

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

  • 🟥 execution_time [+295.957ms; +297.855ms] or [+145.362%; +146.295%]

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

  • 🟥 execution_time [+293.105ms; +295.280ms] or [+143.288%; +144.351%]

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

  • 🟥 execution_time [+301.280ms; +303.540ms] or [+150.580%; +151.709%]

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

  • 🟥 execution_time [+23.703µs; +47.351µs] or [+7.567%; +15.117%]
  • 🟥 throughput [-439.637op/s; -240.668op/s] or [-13.705%; -7.502%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.706ms; +300.497ms] or [+149.584%; +149.979%]

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

  • unstable execution_time [+406.798ms; +416.030ms] or [+442.003%; +452.034%]
  • 🟩 throughput [+706.285op/s; +862.277op/s] or [+5.804%; +7.085%]

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

  • unstable execution_time [+245.258ms; +308.412ms] or [+186.222%; +234.174%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+244.670ms; +287.968ms] or [+112.497%; +132.405%]
  • 🟥 throughput [-510.202op/s; -468.480op/s] or [-46.229%; -42.449%]

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

  • unstable execution_time [+209.787ms; +343.019ms] or [+89.403%; +146.180%]
  • 🟥 throughput [-670.663op/s; -587.087op/s] or [-44.733%; -39.159%]

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

  • 🟥 execution_time [+332.227ms; +347.766ms] or [+198.710%; +208.004%]
  • 🟥 throughput [-400.256op/s; -361.123op/s] or [-27.869%; -25.144%]

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

  • 🟩 execution_time [-209.828µs; -175.769µs] or [-10.629%; -8.904%]
  • 🟩 throughput [+50.781op/s; +59.987op/s] or [+10.025%; +11.842%]

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

  • unstable throughput [+11.983op/s; +54.336op/s] or [+4.725%; +21.427%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+300.720ms; +304.575ms] or [+151.437%; +153.378%]

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

  • 🟥 execution_time [+300.054ms; +301.963ms] or [+150.358%; +151.314%]

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

  • 🟥 execution_time [+301.839ms; +305.179ms] or [+151.631%; +153.309%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+303.443ms; +305.768ms] or [+152.379%; +153.547%]

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

  • 🟥 execution_time [+299.231ms; +303.200ms] or [+147.957%; +149.919%]

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

  • 🟥 execution_time [+302.364ms; +305.890ms] or [+153.251%; +155.039%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+298.588ms; +300.872ms] or [+149.864%; +151.011%]

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

  • 🟥 execution_time [+302.412ms; +306.131ms] or [+150.725%; +152.578%]
  • 🟩 throughput [+57561.970op/s; +63074.941op/s] or [+11.430%; +12.525%]

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

  • 🟥 execution_time [+299.970ms; +302.735ms] or [+149.233%; +150.608%]

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

  • 🟩 execution_time [-16.527ms; -12.865ms] or [-7.685%; -5.982%]
  • 🟩 throughput [+20397.833op/s; +27181.099op/s] or [+5.596%; +7.457%]

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

  • unstable execution_time [-4.029ms; +17.027ms] or [-2.021%; +8.541%]

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

  • unstable execution_time [+9.965µs; +52.454µs] or [+2.461%; +12.956%]

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

  • 🟩 allocated_mem [-19.106KB; -19.082KB] or [-6.969%; -6.961%]
  • unstable execution_time [-35.874µs; +22.164µs] or [-7.090%; +4.381%]
  • unstable throughput [-75.749op/s; +127.395op/s] or [-3.780%; +6.357%]

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

  • 🟩 allocated_mem [-24.765KB; -24.747KB] or [-9.028%; -9.021%]
  • unstable execution_time [-54.930µs; +6.849µs] or [-9.519%; +1.187%]

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

  • unstable execution_time [+5.222µs; +10.173µs] or [+12.343%; +24.045%]
  • 🟥 throughput [-4484.847op/s; -2564.454op/s] or [-18.880%; -10.796%]

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

  • unstable execution_time [-15.207µs; -7.695µs] or [-23.594%; -11.938%]
  • 🟩 throughput [+1984.660op/s; +3607.116op/s] or [+12.177%; +22.131%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.815ms; +303.384ms] or [+152.554%; +153.347%]

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

  • 🟥 execution_time [+302.096ms; +304.386ms] or [+153.766%; +154.931%]

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

  • 🟥 execution_time [+297.144ms; +299.553ms] or [+148.757%; +149.963%]

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

  • 🟩 throughput [+35983.524op/s; +38894.767op/s] or [+6.811%; +7.362%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.535ms; +301.349ms] or [+149.291%; +150.195%]

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

  • 🟥 execution_time [+302.115ms; +303.998ms] or [+151.708%; +152.653%]

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

  • 🟥 execution_time [+304.575ms; +307.739ms] or [+154.461%; +156.065%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.288ms; +300.211ms] or [+149.287%; +149.747%]
  • 🟩 throughput [+61136600.368op/s; +61429474.309op/s] or [+44.523%; +44.737%]

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

  • unstable execution_time [+315.202ms; +390.550ms] or [+392.010%; +485.719%]

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

  • 🟥 execution_time [+298.854ms; +299.886ms] or [+149.062%; +149.576%]

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

  • 🟩 throughput [+100066.784op/s; +110058.892op/s] or [+9.343%; +10.276%]

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

  • 🟩 throughput [+57845.229op/s; +76903.882op/s] or [+6.695%; +8.901%]

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

  • 🟩 throughput [+90169.715op/s; +121454.114op/s] or [+6.979%; +9.401%]

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

  • 🟩 throughput [+76238.758op/s; +85340.320op/s] or [+7.572%; +8.476%]

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

  • 🟩 throughput [+47895.793op/s; +54620.586op/s] or [+8.697%; +9.918%]

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

  • 🟩 throughput [+24423.791op/s; +34220.890op/s] or [+5.467%; +7.660%]

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

  • 🟩 throughput [+88764.150op/s; +107703.072op/s] or [+9.917%; +12.033%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • 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 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.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • 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.OptimizedCharSlice netcoreapp3.1
  • 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.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8766) 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
duration70.81 ± (70.86 - 71.34) ms70.27 ± (70.34 - 70.76) ms-0.8%
.NET Framework 4.8 - Bailout
duration74.47 ± (74.41 - 74.73) ms76.90 ± (76.64 - 77.05) ms+3.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1077.12 ± (1076.65 - 1083.10) ms1077.24 ± (1076.73 - 1083.75) ms+0.0%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.29 ± (22.24 - 22.34) ms22.21 ± (22.17 - 22.26) ms-0.3%
process.time_to_main_ms81.42 ± (81.16 - 81.67) ms82.44 ± (82.13 - 82.74) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.91 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.07 ± (22.04 - 22.10) ms22.07 ± (22.04 - 22.11) ms+0.0%✅⬆️
process.time_to_main_ms81.83 ± (81.71 - 81.95) ms82.76 ± (82.54 - 82.98) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.98) MB10.95 ± (10.95 - 10.96) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms208.75 ± (207.71 - 209.78) ms209.77 ± (209.06 - 210.49) ms+0.5%✅⬆️
process.time_to_main_ms526.45 ± (525.09 - 527.82) ms526.81 ± (525.40 - 528.22) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.67 ± (48.63 - 48.70) MB49.07 ± (49.03 - 49.10) MB+0.8%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.2%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.13 ± (21.09 - 21.18) ms21.16 ± (21.11 - 21.21) ms+0.1%✅⬆️
process.time_to_main_ms71.51 ± (71.28 - 71.74) ms72.15 ± (71.86 - 72.44) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.62) MB10.62 ± (10.62 - 10.62) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.69 ± (20.66 - 20.72) ms20.88 ± (20.84 - 20.91) ms+0.9%✅⬆️
process.time_to_main_ms70.73 ± (70.60 - 70.86) ms71.01 ± (70.87 - 71.15) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.73) MB10.74 ± (10.73 - 10.74) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms373.82 ± (371.65 - 375.99) ms371.94 ± (369.54 - 374.34) ms-0.5%
process.time_to_main_ms533.91 ± (532.82 - 535.00) ms535.53 ± (534.35 - 536.71) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.13 ± (50.11 - 50.16) MB50.11 ± (50.09 - 50.14) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms18.97 ± (18.94 - 19.01) ms19.08 ± (19.05 - 19.10) ms+0.5%✅⬆️
process.time_to_main_ms68.55 ± (68.42 - 68.68) ms68.94 ± (68.72 - 69.17) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.68 ± (7.67 - 7.68) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.21 ± (19.17 - 19.25) ms19.54 ± (19.48 - 19.60) ms+1.7%✅⬆️
process.time_to_main_ms71.62 ± (71.41 - 71.83) ms73.03 ± (72.75 - 73.32) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.72 - 7.73) MB7.74 ± (7.73 - 7.74) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms298.72 ± (296.46 - 300.98) ms300.42 ± (298.01 - 302.83) ms+0.6%✅⬆️
process.time_to_main_ms484.70 ± (483.78 - 485.63) ms484.32 ± (483.41 - 485.24) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.13 ± (37.10 - 37.16) MB37.47 ± (37.45 - 37.50) MB+0.9%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.7%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration204.20 ± (203.84 - 204.86) ms203.65 ± (203.23 - 204.14) ms-0.3%
.NET Framework 4.8 - Bailout
duration207.50 ± (207.17 - 207.99) ms207.53 ± (207.25 - 208.05) ms+0.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1216.34 ± (1213.63 - 1219.51) ms1212.96 ± (1213.69 - 1219.07) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms196.60 ± (196.17 - 197.02) ms197.57 ± (197.16 - 197.97) ms+0.5%✅⬆️
process.time_to_main_ms85.50 ± (85.28 - 85.73) ms85.63 ± (85.35 - 85.91) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.01 ± (15.99 - 16.04) MB15.98 ± (15.95 - 16.00) MB-0.2%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-1.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms195.61 ± (195.19 - 196.02) ms196.64 ± (196.30 - 196.98) ms+0.5%✅⬆️
process.time_to_main_ms86.26 ± (86.00 - 86.52) ms86.81 ± (86.66 - 86.97) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.05 ± (16.02 - 16.08) MB16.14 ± (16.11 - 16.17) MB+0.6%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.1%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms394.38 ± (393.14 - 395.63) ms391.25 ± (390.02 - 392.48) ms-0.8%
process.time_to_main_ms548.97 ± (547.81 - 550.13) ms545.29 ± (544.10 - 546.48) ms-0.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.83 ± (58.65 - 59.00) MB58.89 ± (58.67 - 59.11) MB+0.1%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms203.05 ± (202.71 - 203.39) ms203.13 ± (202.70 - 203.57) ms+0.0%✅⬆️
process.time_to_main_ms74.98 ± (74.70 - 75.25) ms74.72 ± (74.48 - 74.96) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.36 ± (16.33 - 16.38) MB16.39 ± (16.37 - 16.42) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.7%
.NET 6 - Bailout
process.internal_duration_ms201.69 ± (201.32 - 202.05) ms201.46 ± (201.09 - 201.83) ms-0.1%
process.time_to_main_ms76.08 ± (75.86 - 76.30) ms75.81 ± (75.60 - 76.03) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.42 ± (16.39 - 16.44) MB16.44 ± (16.42 - 16.47) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.2%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms584.13 ± (581.48 - 586.79) ms583.55 ± (581.35 - 585.75) ms-0.1%
process.time_to_main_ms560.17 ± (559.06 - 561.28) ms556.84 ± (555.76 - 557.93) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.37 ± (61.27 - 61.46) MB61.52 ± (61.44 - 61.60) MB+0.2%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.1%
.NET 8 - Baseline
process.internal_duration_ms201.37 ± (201.05 - 201.69) ms199.60 ± (199.20 - 200.00) ms-0.9%
process.time_to_main_ms74.23 ± (74.03 - 74.43) ms73.62 ± (73.38 - 73.85) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.65 ± (11.63 - 11.67) MB11.71 ± (11.69 - 11.74) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 18)-2.3%
.NET 8 - Bailout
process.internal_duration_ms201.19 ± (200.81 - 201.57) ms198.45 ± (198.08 - 198.81) ms-1.4%
process.time_to_main_ms75.74 ± (75.57 - 75.91) ms74.43 ± (74.26 - 74.60) ms-1.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.68 - 11.72) MB11.75 ± (11.73 - 11.77) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.0%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms512.82 ± (509.82 - 515.81) ms511.90 ± (509.24 - 514.55) ms-0.2%
process.time_to_main_ms504.60 ± (503.67 - 505.53) ms504.26 ± (503.35 - 505.16) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.91 ± (50.87 - 50.96) MB51.06 ± (51.02 - 51.09) MB+0.3%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.2%✅⬆️
Comparison explanation

Execution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:

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

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8766) - mean (71ms)  : 68, 74
    master - mean (71ms)  : 67, 75

    section Bailout
    This PR (8766) - mean (77ms)  : 74, 80
    master - mean (75ms)  : 73, 76

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (1,080ms)  : 1030, 1130
    master - mean (1,080ms)  : 1034, 1126

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 (8766) - mean (112ms)  : 105, 119
    master - mean (111ms)  : 106, 116

    section Bailout
    This PR (8766) - mean (112ms)  : 106, 118
    master - mean (110ms)  : 109, 112

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (774ms)  : 757, 792
    master - mean (770ms)  : 751, 789

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8766) - mean (100ms)  : 93, 107
    master - mean (99ms)  : 94, 105

    section Bailout
    This PR (8766) - mean (98ms)  : 95, 101
    master - mean (97ms)  : 95, 100

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (935ms)  : 900, 971
    master - mean (936ms)  : 890, 982

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

    section Bailout
    This PR (8766) - mean (100ms)  : 92, 109
    master - mean (98ms)  : 93, 104

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (813ms)  : 779, 847
    master - mean (812ms)  : 776, 848

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 (8766) - mean (204ms)  : 199, 208
    master - mean (204ms)  : 198, 210

    section Bailout
    This PR (8766) - mean (208ms)  : 204, 212
    master - mean (208ms)  : 203, 212

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (1,216ms)  : 1182, 1250
    master - mean (1,217ms)  : 1174, 1259

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 (8766) - mean (293ms)  : 288, 299
    master - mean (292ms)  : 286, 298

    section Bailout
    This PR (8766) - mean (293ms)  : 288, 298
    master - mean (292ms)  : 286, 297

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (979ms)  : 959, 1000
    master - mean (983ms)  : 950, 1017

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8766) - mean (287ms)  : 280, 294
    master - mean (288ms)  : 282, 293

    section Bailout
    This PR (8766) - mean (286ms)  : 282, 291
    master - mean (287ms)  : 282, 293

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (1,173ms)  : 1138, 1208
    master - mean (1,175ms)  : 1139, 1211

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8766) - mean (284ms)  : 278, 289
    master - mean (286ms)  : 282, 291

    section Bailout
    This PR (8766) - mean (283ms)  : 279, 287
    master - mean (287ms)  : 282, 292

    section CallTarget+Inlining+NGEN
    This PR (8766) - mean (1,049ms)  : 1009, 1090
    master - mean (1,047ms)  : 991, 1103

Loading

@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from 529937d to cff7ab2 Compare June 11, 2026 16:23
@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from cff7ab2 to 81ee269 Compare June 24, 2026 15:09
@andrewlock andrewlock changed the title Implement span-derived primary tags on Client-Side-Stats computation Implement span-derived primary tags (AKA Additional tags) on Client-Side-Stats computation Jun 24, 2026
@andrewlock andrewlock added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Jun 24, 2026
@andrewlock
andrewlock changed the base branch from master to andrew/css-encoding-improvements-2 June 24, 2026 15:50
@andrewlock
andrewlock force-pushed the andrew/css-encoding-improvements-2 branch from ba84f2d to ab84d18 Compare June 26, 2026 08:37
@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from d0a473c to c6898d1 Compare June 26, 2026 08:37
@andrewlock
andrewlock marked this pull request as ready for review June 26, 2026 11:30
@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from c6898d1 to f99f6dd Compare June 26, 2026 12:39
andrewlock added a commit that referenced this pull request Jun 30, 2026
## Summary of changes

- Mark testing only methods with `[TestingAndPrivateOnly]`
- Pre-encode header tags for static UTF-8 messagepack keys
- Avoid re-encoding the peer_tags, seeing as we already have that data

## Reason for change

Minor tweaks (mostly perf) before adding the additional
client-side-stats features

## Implementation details

Mostly self-evident, written as distinct commits. The most interesting
one is avoiding the additional interpolated string when encoding
peer_tags. We also avoid re-encoding the tags seeing as we already do
that work up front

## Test coverage

Covered by existing tests, this is all refactoring

## Other details

Part of a client-side stats stack of PRs.

- #8822 👈
- #8766
- #8823
- #8824

https://datadoghq.atlassian.net/browse/APMLP-1446
Base automatically changed from andrew/css-encoding-improvements-2 to master June 30, 2026 07:40
andrewlock and others added 6 commits June 30, 2026 08:43
Adds two tracer-side config keys for span-derived primary tags (client-side
stats additional dimensions):

- DD_TRACE_STATS_ADDITIONAL_TAGS: comma-separated span tag keys to extract as
  extra aggregation dimensions. Gated behind DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED
  including DD_TRACE_STATS_ADDITIONAL_TAGS. Deduplicated, sorted, capped at 6 keys
  (excess dropped with a warn log).
- DD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMIT: per-flush-bucket cap on distinct
  stat entries with additional tags. Defaults to 100; invalid values (<=0) fall back
  to the default with a warn log.

Wires these through TracerSettings and the telemetry normalization rules. No
aggregation behaviour yet.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adds the schema for span-derived primary tags without any extraction behaviour
yet:

- Add `AdditionalMetricTagsHash` to `StatsAggregationKey`.
- Add `AdditionalMetricTags` to `StatsBucket`
Wires up extraction of the configured span-derived additional-tags:

- Pre-encode the configured tag keys into `AdditionalTagKey` structs at construction.
- `BuildKey` computes a hash of the tag values, similar to peer tags, and stores it in the aggregation key
- On the cold path, the encoded "key:value" pairs are stored on the bucket. we could potentially optimize this in a follow up to avoid the interpolation
-Values longer than 200 chars are replaced with "blocked_by_tracer" (consistently in both hash and encoding).
Implements the per-flush-bucket cardinality protection for span-derived additional tags:

- A per-bucket counter tracks distinct stat entries admitted with additional tags. Once DD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMIT is reached, all additional tags are replaced with "blocked_by_tracer".
- The span's base stats are never blocked, just the additional spans
- Adds a log (once per flush cycle) when something is blocked
- The cardinality counter and log guard reset on each flush
- Deferred the telemetry metric for now
Writes the span-derived primary tags as `AdditionalMetricTags` in the ClientGroupedStats msgpack payload
@andrewlock
andrewlock force-pushed the andrew/span-derived-primary-tags branch from f99f6dd to 889f756 Compare June 30, 2026 07:47

@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.

Thanks LGTM!

@andrewlock
andrewlock merged commit 7fc15f3 into master Jul 2, 2026
142 checks passed
@andrewlock
andrewlock deleted the andrew/span-derived-primary-tags branch July 2, 2026 08:54
@github-actions github-actions Bot added this to the vNext-v3 milestone Jul 2, 2026
andrewlock added a commit that referenced this pull request Jul 2, 2026
## Summary of changes

Adds support for adding `DD_TAGS` as span-derived primary tags (AKA
Additional tags) in Client Side Stats

## Reason for change

Implements [the
RFC](https://datadoghq.atlassian.net/wiki/spaces/APM/pages/6607667207/PENDING+DD_TAGS+Derived+Primary+Tags)
for adding `DD_TAGS` to the client-side stats payload.

## Implementation details

Relatively simple: we just thread any `DD_TAGS` value through to the
payload, and the backend/agent then ensures they're added as
span-derived primary tags. There's no cardinality issues at play here,
which simplifies things, and we can just include them in every payload

## Test coverage

Added some unit tests, system tests to follow...

## Other details

Part of a stack

- #8822
- #8766
- https://github.com/DataDog/dd-trace-dotnet/pull/8823👈
- #8824

https://datadoghq.atlassian.net/browse/APMLP-1446
andrewlock added a commit that referenced this pull request Jul 2, 2026
## Summary of changes

Implements the Client-Side Stats [cardinality control
RFC](https://datadoghq.atlassian.net/wiki/spaces/APM/pages/6821151019/PENDING+Cardinality+Limits)

## Reason for change

Currently, we have a risk of unbounded memory growth caused by
cardinality explosion. This has not been a big issue so far as CSS is
off by default for .NET. However, resource name explosion (in
particular), as well as span-derived primary tags and peer tags have the
potential to cause OOM issues. This PR adds strict (configurable) caps
to prevent issues from runaway memory growth.

## Implementation details

Largely broken into separate distinct commits

- Convert `StatsAggregationKey` to `readonly record struct`, seeing as
that's basically what it was anyway
- Make `IsTraceRoot` nullable (required for "overflow bucket")
- Make resource length limit configurable (to support "big_resource"
feature from agent)
- Add per-field cardinality limitation to resource, httpendoint,
peertags, additional tags
- Per-field limits stop a single very high cardinality field rendering
everything else useless
  - Only added to these 4 fields for now, but we can expand if necessary
- Add whole-key cardinality limit
  - Essentially a cap on the maximum number of buckets we'll allocate
  - All additional stats flow into an "overflow" bucket
- Add telemetry/heath-metrics/logging for tracking overflow occurences
- Add some tests

## Test coverage

Added a bunch of unit tests. Waiting on system tests to confirm the
implementation.

## Other details

Part of a stack


- #8822
- #8766
- #8823
- #8824 👈

https://datadoghq.atlassian.net/browse/APMLP-1446
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:new-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants