Skip to content

[Tracer] Add optional tags to OTLP trace metrics - #9002

Open
mabdinur wants to merge 6 commits into
masterfrom
munir/otlp-trace-metrics-array-tags
Open

mabdinur wants to merge 6 commits into
masterfrom
munir/otlp-trace-metrics-array-tags

Conversation

@mabdinur

@mabdinur mabdinur commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • emits datadog.process_tags as a resource string array
  • emits datadog.peer_tags as a data-point string array
  • emits configured additional metric tags as individual data-point attributes
  • writes pre-encoded additional tags directly to protobuf without UTF-8 decoding

This keeps optional tag serialization separate from the core OTLP trace metrics implementation in #8992.

Test plan

  • managed tracer build succeeds with no warnings
  • all 64 OtlpSpanStatsSerializerTests pass on .NET 10

@pr-commenter

pr-commenter Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-11 20:46:53

Comparing candidate commit 87a3869 in PR branch munir/otlp-trace-metrics-array-tags with baseline commit 12e9e34 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 70 metrics, 1 unstable metrics, 66 known flaky benchmarks, 60 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.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-33406.347op/s; -30591.065op/s] or [-9.409%; -8.616%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync netcoreapp3.1

  • unstable execution_time [-25.641ms; -5.103ms] or [-12.805%; -2.548%]

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_UpdateName_Sampled net472

  • 🟩 throughput [+10637.389op/s; +11509.139op/s] or [+5.559%; +6.015%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0

  • 🟥 throughput [-22104.658op/s; -18984.694op/s] or [-7.328%; -6.293%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472

  • 🟥 throughput [-11715.790op/s; -10430.701op/s] or [-7.741%; -6.892%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-8680.552op/s; -8185.914op/s] or [-10.293%; -9.706%]

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

  • 🟥 throughput [-9770.114op/s; -8519.701op/s] or [-9.934%; -8.663%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+676 bytes; +677 bytes] or [+20.565%; +20.579%]
  • 🟥 execution_time [+303.120ms; +305.120ms] or [+150.419%; +151.411%]
  • 🟥 throughput [-51.404op/s; -47.589op/s] or [-9.249%; -8.562%]

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

  • 🟥 allocated_mem [+391 bytes; +392 bytes] or [+14.530%; +14.542%]
  • 🟥 execution_time [+384.625ms; +387.317ms] or [+303.877%; +306.004%]
  • 🟩 throughput [+68.621op/s; +75.152op/s] or [+9.047%; +9.909%]

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

  • 🟥 allocated_mem [+394 bytes; +395 bytes] or [+14.641%; +14.652%]
  • 🟥 execution_time [+400.557ms; +402.452ms] or [+354.478%; +356.155%]

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

  • 🟥 allocated_mem [+4.692KB; +4.693KB] or [+98.785%; +98.801%]
  • 🟥 throughput [-60605.181op/s; -60232.068op/s] or [-47.154%; -46.864%]

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

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-15.774ms; -11.608ms] or [-7.367%; -5.421%]
  • 🟥 throughput [-61411.020op/s; -58642.297op/s] or [-44.827%; -42.806%]

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

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-49241.867op/s; -46977.529op/s] or [-44.520%; -42.473%]

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

  • 🟥 allocated_mem [+1.316KB; +1.316KB] or [+106.475%; +106.490%]
  • 🟥 throughput [-251852.238op/s; -248262.426op/s] or [-25.715%; -25.349%]

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

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-26.424ms; -21.566ms] or [-11.784%; -9.617%]

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

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-162100.871op/s; -145794.209op/s] or [-23.291%; -20.948%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-73595.377op/s; -72797.407op/s] or [-49.529%; -48.992%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-74753.355op/s; -71842.453op/s] or [-47.564%; -45.712%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-55535.387op/s; -52922.245op/s] or [-44.241%; -42.159%]

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

  • 🟩 throughput [+263465.907op/s; +292761.243op/s] or [+8.785%; +9.762%]

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

  • 🟩 execution_time [-19.079ms; -14.746ms] or [-8.795%; -6.797%]

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

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+300.363ms; +301.035ms] or [+150.081%; +150.417%]
  • 🟩 throughput [+896.329op/s; +930.761op/s] or [+9.900%; +10.280%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.567ms; +303.807ms] or [+151.576%; +153.211%]
  • 🟩 throughput [+2208.065op/s; +2423.071op/s] or [+16.888%; +18.533%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.530ms; +303.246ms] or [+151.384%; +152.752%]
  • 🟩 throughput [+1887.556op/s; +2016.994op/s] or [+18.223%; +19.473%]

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

  • 🟥 execution_time [+297.724ms; +299.455ms] or [+146.230%; +147.080%]
  • 🟩 throughput [+578.901op/s; +594.208op/s] or [+15.347%; +15.753%]

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

  • 🟥 execution_time [+297.610ms; +298.386ms] or [+145.491%; +145.870%]
  • 🟩 throughput [+2663.389op/s; +2698.333op/s] or [+38.694%; +39.202%]

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

  • 🟥 execution_time [+280.667ms; +295.720ms] or [+140.277%; +147.801%]
  • 🟩 throughput [+1297.667op/s; +1367.720op/s] or [+25.758%; +27.148%]

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

  • 🟩 execution_time [-145.251µs; -141.065µs] or [-29.822%; -28.963%]
  • 🟩 throughput [+841.183op/s; +869.506op/s] or [+40.969%; +42.349%]

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

  • 🟩 execution_time [-135.866µs; -109.209µs] or [-31.161%; -25.047%]
  • 🟩 throughput [+829.521op/s; +951.659op/s] or [+36.064%; +41.374%]

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

  • 🟩 execution_time [-142.535µs; -120.513µs] or [-30.538%; -25.820%]
  • 🟩 throughput [+775.741op/s; +859.094op/s] or [+35.810%; +39.657%]

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

  • 🟩 execution_time [-127.892µs; -122.996µs] or [-34.530%; -33.208%]
  • 🟩 throughput [+1353.913op/s; +1416.680op/s] or [+50.143%; +52.467%]

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

  • 🟩 execution_time [-100.036µs; -76.398µs] or [-31.936%; -24.390%]
  • 🟩 throughput [+1136.128op/s; +1339.421op/s] or [+35.416%; +41.754%]

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

  • 🟩 execution_time [-137.096µs; -114.656µs] or [-37.504%; -31.365%]
  • 🟩 throughput [+1317.437op/s; +1456.765op/s] or [+47.278%; +52.277%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.173ms; +299.940ms] or [+149.318%; +149.701%]

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

  • 🟥 execution_time [+414.700ms; +421.664ms] or [+450.589%; +458.155%]
  • 🟩 throughput [+772.266op/s; +939.270op/s] or [+6.346%; +7.718%]

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

  • 🟥 execution_time [+366.764ms; +370.698ms] or [+278.481%; +281.467%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+296.220ms; +375.175ms] or [+136.199%; +172.502%]
  • 🟥 throughput [-552.903op/s; -497.398op/s] or [-50.098%; -45.069%]

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

  • unstable execution_time [+145.762ms; +290.289ms] or [+62.118%; +123.709%]
  • 🟥 throughput [-682.774op/s; -598.701op/s] or [-45.541%; -39.934%]

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

  • 🟥 execution_time [+348.068ms; +360.570ms] or [+208.185%; +215.663%]
  • 🟥 throughput [-399.794op/s; -358.328op/s] or [-27.837%; -24.950%]

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

  • 🟩 execution_time [-177.136µs; -127.501µs] or [-8.973%; -6.459%]
  • 🟩 throughput [+37.033op/s; +49.900op/s] or [+7.311%; +9.851%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.911ms; +303.903ms] or [+152.037%; +153.040%]

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

  • 🟥 execution_time [+300.918ms; +302.623ms] or [+150.791%; +151.645%]

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

  • 🟥 execution_time [+300.083ms; +303.507ms] or [+150.749%; +152.469%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.562ms; +302.748ms] or [+151.434%; +152.030%]

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

  • 🟥 execution_time [+297.647ms; +299.370ms] or [+147.173%; +148.025%]

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

  • 🟥 execution_time [+302.531ms; +306.271ms] or [+153.336%; +155.232%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.480ms; +303.624ms] or [+151.316%; +152.392%]

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

  • 🟥 execution_time [+296.466ms; +301.508ms] or [+147.761%; +150.274%]
  • 🟩 throughput [+34319.119op/s; +41435.516op/s] or [+6.815%; +8.228%]

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

  • 🟥 execution_time [+300.292ms; +303.715ms] or [+149.392%; +151.095%]

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

  • unstable execution_time [+14.126µs; +55.677µs] or [+3.489%; +13.753%]

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

  • 🟩 allocated_mem [-19.760KB; -19.737KB] or [-7.208%; -7.200%]
  • unstable execution_time [-39.431µs; +16.777µs] or [-7.793%; +3.316%]

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

  • 🟩 allocated_mem [-27.525KB; -27.507KB] or [-10.034%; -10.028%]
  • unstable execution_time [-66.665µs; -5.396µs] or [-11.553%; -0.935%]

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

  • unstable execution_time [+8.396µs; +12.810µs] or [+19.846%; +30.280%]
  • 🟥 throughput [-5628.391op/s; -3790.881op/s] or [-23.694%; -15.958%]

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

  • unstable execution_time [-12.615µs; -4.371µs] or [-19.572%; -6.782%]
  • unstable throughput [+1037.944op/s; +2838.987op/s] or [+6.368%; +17.418%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.310ms; +303.382ms] or [+152.804%; +153.346%]

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

  • 🟥 execution_time [+302.362ms; +304.703ms] or [+153.901%; +155.093%]

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

  • 🟥 execution_time [+299.441ms; +301.595ms] or [+149.907%; +150.986%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.230ms; +301.272ms] or [+148.641%; +150.157%]

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

  • 🟥 execution_time [+300.898ms; +302.587ms] or [+151.097%; +151.945%]

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

  • 🟥 execution_time [+302.882ms; +305.218ms] or [+153.602%; +154.787%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.740ms; +300.702ms] or [+149.512%; +149.992%]
  • 🟩 throughput [+61081540.654op/s; +61397315.593op/s] or [+44.483%; +44.713%]

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

  • 🟥 execution_time [+423.626ms; +429.194ms] or [+526.855%; +533.780%]

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

  • 🟥 execution_time [+299.063ms; +300.049ms] or [+149.166%; +149.657%]

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

  • 🟩 throughput [+62725.585op/s; +81870.080op/s] or [+5.856%; +7.644%]

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

  • unstable execution_time [+3.323ms; +24.513ms] or [+1.731%; +12.771%]

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

  • 🟩 throughput [+76517.411op/s; +84969.660op/s] or [+7.599%; +8.439%]

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

  • 🟩 throughput [+44098.127op/s; +49531.759op/s] or [+8.007%; +8.994%]

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

  • 🟩 throughput [+63732.846op/s; +81007.274op/s] or [+7.121%; +9.051%]

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 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 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.ObjectExtractorSimpleBody net472
  • 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.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
  • 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.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@mabdinur mabdinur changed the title [Agent] Wire datadog.process_tags and datadog.peer_tags into OTLP stats [Agent] Add OTLP process, peer, and additional metric tags Aug 11, 2026
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@mabdinur mabdinur changed the title [Agent] Add OTLP process, peer, and additional metric tags [Agent] Add process, peer, and additional metric tags to OTLP trace metrics Aug 12, 2026
@mabdinur
mabdinur force-pushed the munir/otlp-trace-metrics-fixes branch from b2caa13 to d0cd8d9 Compare August 12, 2026 16:24
mabdinur added a commit that referenced this pull request Aug 13, 2026
## Summary

Aligns .NET OTLP trace metrics with the cross-tracer contract in
DataDog/system-tests#7466.

- Emits OTLP metric attributes independently of
`DD_TRACE_OTEL_SEMANTICS_ENABLED` while retaining that setting for its
other consumers.
- Emits core SMC attributes first in the order `service.name`,
`status.code`, `span.kind`, and `span.name`; unknown span kinds default
to `SPAN_KIND_INTERNAL`.
- Always emits `datadog.operation.name`, emits known trace-root and
top-level values as booleans, and emits `datadog.svc_src` when present.

Process and peer-tag arrays remain intentionally deferred to
#9002.

## Validation

- Focused `OtlpSpanStatsSerializerTests`: 59 passed
- Production and test `dotnet format --verify-no-changes`: passed
- `Datadog.Trace.csproj -f netstandard2.0 --no-restore`: passed with no
warnings or errors
- `git diff --check`: passed
Base automatically changed from munir/otlp-trace-metrics-fixes to master August 13, 2026 14:39
@mabdinur
mabdinur force-pushed the munir/otlp-trace-metrics-array-tags branch from 5444ae8 to d2c36d2 Compare August 13, 2026 15:01
@mabdinur mabdinur changed the title [Agent] Add process, peer, and additional metric tags to OTLP trace metrics [Tracer] Add optional tags to OTLP trace metrics Aug 13, 2026
@mabdinur
mabdinur marked this pull request as ready for review August 13, 2026 17:02
@mabdinur
mabdinur requested a review from a team as a code owner August 13, 2026 17:02

@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: d2c36d2512

ℹ️ 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/OtlpSpanStatsSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/OtlpSpanStatsSerializer.cs Outdated
@mabdinur

Copy link
Copy Markdown
Contributor Author

With this change, the following tests pass (link):

XPASS tests/parametric/test_otlp_trace_metrics.py::Test_FR08_Datadog_Attributes::test_fr08_8_process_tags[library_env0] missing_feature (process tags are not yet emitted on the OTLP trace metrics resource)
XPASS tests/parametric/test_otlp_trace_metrics.py::Test_FR08_AdditionalTags::test_fr08_12_stats_additional_tags[library_env0] missing_feature (pending implementation release)

Although this PR adds support for serializing peer tags in OTLP, the value is not set in the aggregator. The corresponding system test continues to fail. This is expected.

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think fundamentally the design here is not sound. We're doing huge allocations to try to decode utf8 byte arrays, but given we have access to those sources further up the pipeline, we should be looking at how we can expose these values instead

Comment thread tracer/src/Datadog.Trace/Agent/OtlpSpanStatsSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/OtlpSpanStatsSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/OtlpSpanStatsSerializer.cs Outdated
@mabdinur
mabdinur requested review from a team as code owners September 11, 2026 19:58
@mabdinur
mabdinur requested a review from andrewlock September 11, 2026 19:58

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

I think these are all @DataDog/apm-sdk-capabilities-dotnet files so they should have their ownership adjusted.

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.

This file should be owned by @DataDog/apm-sdk-capabilities-dotnet

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.

This file should be owned by @DataDog/apm-sdk-capabilities-dotnet

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.

This file should be owned by @DataDog/apm-sdk-capabilities-dotnet

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants