Skip to content

[Config] Add scope field infrastructure to configuration registry (2/3)#8732

Merged
bm1549 merged 7 commits into
masterfrom
brian.marks/native-config-scope-pr2
Jun 10, 2026
Merged

[Config] Add scope field infrastructure to configuration registry (2/3)#8732
bm1549 merged 7 commits into
masterfrom
brian.marks/native-config-scope-pr2

Conversation

@bm1549

@bm1549 bm1549 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Adds the scope field infrastructure to the configuration registry: parsing, source-generator enforcement, tests, and documentation.

Stack:

  • PR 1 (merged): scope: managed on all existing entries
  • PR 2 (this): scope infrastructure — parsing, enforcement, tests, docs
  • PR 3: all native config variables

Reason for change

Lets the registry distinguish managed-only, native-only, and dual-scope (managed, native) config variables. The generator emits C# constants only for entries whose scope includes managed; native-only entries are registered for coverage tracking and produce no constant. A build error (DDSG0009) is emitted for any entry missing a valid scope.

Implementation details

  • YamlReader.cs: ConfigurationEntry.Scope/Aliases are now EquatableArray<string> for value-based equality (the incremental generator caches on it); comma-separated scope parsing (managed, native, managed, native).
  • ConfigurationKeysGenerator.cs: a validation pass emits DDSG0009 for missing/empty/unrecognized scope (scopeValue is not ("managed" or "native")); a separate generation pass emits constants only for managed-scoped keys, via an allocation-free, case-sensitive ScopeContains helper.
  • ConfigKeyAliasesSwitcherGenerator.cs: updated for the EquatableArray<string> aliases.
  • ConfigurationKeysGeneratorTests.cs: tests for native-only exclusion, managed, native inclusion, and DDSG0009 on empty/invalid scope; existing YAML fixtures carry scope.
  • AddingConfigurationKeys.md: scope documented as a Required field.

Test coverage

Source-generator unit tests pass, including the native-only exclusion and DDSG0009 cases. The native-coverage enforcement (a Nuke build step) lands in PR 3 alongside the data it validates.

Other details

Safe to merge onto master: all existing entries carry scope: managed, so DDSG0009 does not fire.

@bm1549 bm1549 added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 2, 2026
@datadog-prod-us1-6

This comment has been minimized.

@bm1549
bm1549 force-pushed the brian.marks/native-config-scope-pr2 branch from a74d141 to 2fe83b1 Compare June 2, 2026 17:22
@bm1549
bm1549 force-pushed the brian.marks/native-config-scope-pr1 branch from e8fba4e to 9fb89ee Compare June 2, 2026 17:24
@bm1549
bm1549 force-pushed the brian.marks/native-config-scope-pr2 branch from 2fe83b1 to ace5613 Compare June 2, 2026 17:24
@pr-commenter

pr-commenter Bot commented Jun 2, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-10 16:56:59

Comparing candidate commit e3731a8 in PR branch brian.marks/native-config-scope-pr2 with baseline commit d14b2d6 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 62 known flaky benchmarks, 64 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 [-21574.520op/s; -18643.874op/s] or [-6.076%; -5.251%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5133.307op/s; -4914.944op/s] or [-5.860%; -5.611%]

Known flaky benchmarks

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

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-7301.101op/s; -6538.563op/s] or [-8.657%; -7.753%]

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

  • 🟥 throughput [-7005.615op/s; -5644.129op/s] or [-7.123%; -5.739%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+310.624ms; +318.694ms] or [+154.142%; +158.147%]
  • 🟥 throughput [-43.143op/s; -39.404op/s] or [-7.762%; -7.090%]

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

  • 🟥 execution_time [+378.701ms; +379.763ms] or [+299.197%; +300.036%]
  • 🟩 throughput [+94.704op/s; +96.572op/s] or [+12.486%; +12.733%]

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

  • 🟥 execution_time [+392.587ms; +396.137ms] or [+347.424%; +350.566%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]
  • 🟥 throughput [-7106.885op/s; -6652.731op/s] or [-5.530%; -5.176%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-15.733ms; -11.559ms] or [-7.348%; -5.399%]

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 [-307447.814op/s; -303739.068op/s] or [-31.392%; -31.013%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-25.878ms; -21.016ms] or [-11.540%; -9.372%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-154874.051op/s; -138887.348op/s] or [-22.252%; -19.955%]

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

  • 🟩 throughput [+8824.112op/s; +11895.430op/s] or [+5.615%; +7.569%]

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

  • 🟩 throughput [+9373.523op/s; +12029.791op/s] or [+7.467%; +9.583%]

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

  • 🟩 throughput [+435145.893op/s; +457767.035op/s] or [+14.510%; +15.264%]

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

  • 🟩 execution_time [-16.778ms; -12.103ms] or [-7.734%; -5.579%]

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

  • 🟥 execution_time [+300.896ms; +301.610ms] or [+150.347%; +150.704%]

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

  • 🟥 execution_time [+297.962ms; +301.239ms] or [+150.263%; +151.916%]

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

  • 🟥 execution_time [+300.167ms; +302.952ms] or [+151.201%; +152.604%]

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

  • 🟥 execution_time [+296.885ms; +297.892ms] or [+145.818%; +146.313%]

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

  • 🟥 execution_time [+292.825ms; +297.183ms] or [+143.151%; +145.282%]

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

  • 🟥 execution_time [+302.703ms; +304.339ms] or [+151.291%; +152.108%]

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

  • 🟥 execution_time [+22.293µs; +45.920µs] or [+7.117%; +14.660%]
  • 🟥 throughput [-427.909op/s; -229.090op/s] or [-13.339%; -7.141%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.154ms; +299.917ms] or [+149.308%; +149.690%]

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

  • unstable execution_time [+331.333ms; +389.509ms] or [+360.007%; +423.217%]
  • 🟩 throughput [+884.168op/s; +1079.720op/s] or [+7.265%; +8.872%]

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

  • unstable execution_time [+217.363ms; +274.907ms] or [+165.041%; +208.734%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+307.820ms; +350.706ms] or [+141.533%; +161.251%]
  • 🟥 throughput [-586.300op/s; -538.594op/s] or [-53.125%; -48.802%]

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

  • unstable execution_time [+205.828ms; +339.079ms] or [+87.715%; +144.501%]
  • 🟥 throughput [-683.098op/s; -599.116op/s] or [-45.563%; -39.961%]

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

  • 🟥 execution_time [+336.139ms; +347.023ms] or [+201.050%; +207.560%]
  • 🟥 throughput [-409.944op/s; -373.030op/s] or [-28.544%; -25.974%]

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

  • 🟩 throughput [+27.329op/s; +45.045op/s] or [+5.395%; +8.892%]

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

  • 🟩 execution_time [-585.048µs; -208.696µs] or [-14.836%; -5.292%]
  • unstable throughput [+20.419op/s; +69.043op/s] or [+8.052%; +27.226%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+302.083ms; +303.980ms] or [+152.123%; +153.079%]

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

  • 🟥 execution_time [+300.504ms; +302.657ms] or [+150.583%; +151.662%]

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

  • 🟥 execution_time [+300.083ms; +303.245ms] or [+150.749%; +152.337%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.883ms; +304.474ms] or [+152.097%; +152.897%]

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

  • 🟥 execution_time [+301.198ms; +304.167ms] or [+148.929%; +150.397%]

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

  • 🟥 execution_time [+303.018ms; +306.975ms] or [+153.583%; +155.588%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+298.352ms; +300.251ms] or [+149.746%; +150.699%]

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

  • 🟥 execution_time [+299.946ms; +303.339ms] or [+149.495%; +151.187%]
  • 🟩 throughput [+28616.087op/s; +37746.722op/s] or [+5.682%; +7.495%]

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

  • 🟥 execution_time [+297.952ms; +301.230ms] or [+148.228%; +149.859%]

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

  • 🟩 execution_time [-16.729ms; -13.039ms] or [-7.779%; -6.063%]
  • 🟩 throughput [+18316.771op/s; +25715.358op/s] or [+5.025%; +7.054%]

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

  • unstable execution_time [+7.756µs; +52.562µs] or [+1.916%; +12.983%]

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

  • 🟩 allocated_mem [-20.719KB; -20.697KB] or [-7.558%; -7.550%]
  • unstable execution_time [+18.277µs; +120.218µs] or [+3.612%; +23.760%]
  • unstable throughput [-293.380op/s; -20.287op/s] or [-14.640%; -1.012%]

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

  • unstable execution_time [-67.475µs; -6.006µs] or [-11.693%; -1.041%]

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

  • unstable execution_time [+7.520µs; +12.582µs] or [+17.776%; +29.741%]
  • 🟥 throughput [-5388.057op/s; -3442.035op/s] or [-22.682%; -14.490%]

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

  • unstable execution_time [-11.899µs; -3.467µs] or [-18.460%; -5.379%]
  • unstable throughput [+795.382op/s; +2641.736op/s] or [+4.880%; +16.208%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.634ms; +303.953ms] or [+152.968%; +153.635%]

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

  • 🟥 execution_time [+302.535ms; +305.082ms] or [+153.990%; +155.286%]

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

  • 🟥 execution_time [+298.808ms; +300.838ms] or [+149.590%; +150.607%]

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

  • 🟩 throughput [+31756.184op/s; +34473.393op/s] or [+6.011%; +6.525%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.751ms; +303.084ms] or [+149.897%; +151.060%]

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

  • 🟥 execution_time [+302.082ms; +303.131ms] or [+151.691%; +152.218%]

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

  • 🟥 execution_time [+304.163ms; +306.924ms] or [+154.252%; +155.652%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.042ms; +300.825ms] or [+149.662%; +150.053%]
  • 🟩 throughput [+61287214.365op/s; +61607497.573op/s] or [+44.633%; +44.866%]

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

  • 🟥 execution_time [+417.693ms; +420.935ms] or [+519.476%; +523.507%]

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

  • 🟥 execution_time [+299.662ms; +300.704ms] or [+149.464%; +149.984%]

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

  • 🟩 throughput [+91453.097op/s; +104538.732op/s] or [+8.539%; +9.760%]

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

  • 🟩 throughput [+57568.058op/s; +76603.049op/s] or [+6.663%; +8.867%]

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

  • 🟩 throughput [+66405.752op/s; +98804.436op/s] or [+5.140%; +7.648%]

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

  • 🟩 throughput [+86570.991op/s; +96179.460op/s] or [+8.598%; +9.552%]

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

  • 🟩 throughput [+49675.549op/s; +54502.682op/s] or [+9.020%; +9.897%]

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

  • 🟩 throughput [+25739.878op/s; +35426.744op/s] or [+5.761%; +7.930%]

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

  • 🟩 throughput [+86117.905op/s; +103191.609op/s] or [+9.622%; +11.529%]

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

Comment thread tracer/src/Datadog.Trace.SourceGenerators/Helpers/YamlReader.cs Outdated
@dd-trace-dotnet-ci-bot

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

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8732) 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
duration73.34 ± (73.41 - 73.97) ms72.84 ± (72.91 - 73.42) ms-0.7%
.NET Framework 4.8 - Bailout
duration76.92 ± (76.64 - 77.01) ms76.80 ± (76.71 - 77.06) ms-0.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1096.80 ± (1096.08 - 1103.13) ms1092.04 ± (1093.19 - 1100.43) ms-0.4%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.69 ± (22.63 - 22.75) ms22.49 ± (22.44 - 22.54) ms-0.9%
process.time_to_main_ms84.86 ± (84.53 - 85.19) ms84.03 ± (83.75 - 84.30) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.91) MB10.92 ± (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.43 ± (22.39 - 22.47) ms22.20 ± (22.17 - 22.24) ms-1.0%
process.time_to_main_ms84.85 ± (84.67 - 85.03) ms84.51 ± (84.31 - 84.70) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.94) MB10.94 ± (10.93 - 10.94) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms218.01 ± (217.05 - 218.98) ms216.69 ± (215.72 - 217.65) ms-0.6%
process.time_to_main_ms545.11 ± (543.42 - 546.81) ms543.47 ± (542.05 - 544.89) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.24 ± (48.20 - 48.27) MB48.36 ± (48.33 - 48.39) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.19 ± (21.15 - 21.23) ms21.27 ± (21.22 - 21.33) ms+0.4%✅⬆️
process.time_to_main_ms72.51 ± (72.34 - 72.68) ms73.20 ± (72.92 - 73.48) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.63) MB10.64 ± (10.64 - 10.64) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.02 ± (20.98 - 21.07) ms21.74 ± (21.67 - 21.80) ms+3.4%✅⬆️
process.time_to_main_ms73.19 ± (73.04 - 73.34) ms76.63 ± (76.38 - 76.88) ms+4.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.75 ± (10.74 - 10.75) MB10.75 ± (10.75 - 10.75) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.08 ± (366.93 - 371.22) ms368.95 ± (366.97 - 370.92) ms-0.0%
process.time_to_main_ms548.59 ± (547.19 - 550.00) ms545.76 ± (544.40 - 547.13) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.81 ± (49.79 - 49.84) MB49.72 ± (49.69 - 49.75) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.81 ± (19.76 - 19.86) ms19.29 ± (19.25 - 19.33) ms-2.6%
process.time_to_main_ms74.15 ± (73.89 - 74.41) ms71.44 ± (71.28 - 71.59) ms-3.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.68 ± (7.67 - 7.69) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.53 ± (19.50 - 19.56) ms19.23 ± (19.20 - 19.26) ms-1.5%
process.time_to_main_ms73.40 ± (73.23 - 73.57) ms72.61 ± (72.43 - 72.78) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.70 - 7.71) MB7.72 ± (7.71 - 7.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms297.39 ± (294.99 - 299.79) ms300.85 ± (298.57 - 303.14) ms+1.2%✅⬆️
process.time_to_main_ms498.08 ± (496.89 - 499.27) ms495.64 ± (494.65 - 496.62) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.85 ± (36.82 - 36.87) MB36.90 ± (36.87 - 36.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.5%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration198.18 ± (197.81 - 198.59) ms198.07 ± (197.94 - 198.80) ms-0.1%
.NET Framework 4.8 - Bailout
duration201.21 ± (200.93 - 201.60) ms201.11 ± (200.45 - 201.40) ms-0.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1195.02 ± (1198.70 - 1207.08) ms1189.20 ± (1186.70 - 1192.08) ms-0.5%
.NET Core 3.1 - Baseline
process.internal_duration_ms191.66 ± (191.29 - 192.04) ms190.64 ± (190.17 - 191.11) ms-0.5%
process.time_to_main_ms82.92 ± (82.63 - 83.20) ms82.10 ± (81.85 - 82.36) ms-1.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.12 - 16.17) MB16.17 ± (16.15 - 16.20) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms192.32 ± (191.86 - 192.79) ms189.44 ± (188.96 - 189.91) ms-1.5%
process.time_to_main_ms84.23 ± (84.02 - 84.43) ms83.25 ± (82.97 - 83.53) ms-1.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.17) MB16.22 ± (16.20 - 16.25) MB+0.5%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms384.38 ± (383.04 - 385.73) ms383.65 ± (382.23 - 385.08) ms-0.2%
process.time_to_main_ms535.34 ± (534.19 - 536.49) ms531.81 ± (530.64 - 532.99) ms-0.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.36 ± (57.21 - 57.51) MB57.11 ± (57.02 - 57.20) MB-0.4%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.1%
.NET 6 - Baseline
process.internal_duration_ms197.20 ± (196.82 - 197.57) ms195.42 ± (194.92 - 195.92) ms-0.9%
process.time_to_main_ms72.06 ± (71.78 - 72.33) ms71.70 ± (71.43 - 71.97) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.40 ± (16.37 - 16.43) MB16.47 ± (16.43 - 16.50) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.0%
.NET 6 - Bailout
process.internal_duration_ms198.29 ± (197.80 - 198.78) ms194.94 ± (194.53 - 195.35) ms-1.7%
process.time_to_main_ms73.42 ± (73.15 - 73.68) ms72.58 ± (72.35 - 72.81) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.40 ± (16.38 - 16.43) MB16.43 ± (16.34 - 16.52) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.8%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms585.22 ± (583.03 - 587.41) ms585.99 ± (583.54 - 588.44) ms+0.1%✅⬆️
process.time_to_main_ms546.20 ± (545.17 - 547.23) ms542.08 ± (541.16 - 543.01) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.09 ± (61.01 - 61.17) MB61.14 ± (61.05 - 61.23) MB+0.1%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms194.07 ± (193.61 - 194.54) ms193.30 ± (192.86 - 193.75) ms-0.4%
process.time_to_main_ms71.41 ± (71.17 - 71.64) ms70.97 ± (70.69 - 71.25) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.79 ± (11.77 - 11.80) MB11.77 ± (11.75 - 11.79) MB-0.1%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.1%
.NET 8 - Bailout
process.internal_duration_ms194.06 ± (193.56 - 194.55) ms192.81 ± (192.32 - 193.30) ms-0.6%
process.time_to_main_ms72.30 ± (72.09 - 72.51) ms72.07 ± (71.85 - 72.29) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.85 ± (11.83 - 11.87) MB11.82 ± (11.80 - 11.85) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms513.08 ± (510.53 - 515.62) ms516.33 ± (513.59 - 519.07) ms+0.6%✅⬆️
process.time_to_main_ms495.31 ± (494.37 - 496.25) ms492.61 ± (491.94 - 493.29) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.64 ± (50.60 - 50.68) MB50.50 ± (50.47 - 50.53) MB-0.3%
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (29 - 30)-0.1%
Comparison explanation

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

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

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

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

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8732) - mean (73ms)  : 69, 77
    master - mean (74ms)  : 69, 78

    section Bailout
    This PR (8732) - mean (77ms)  : 75, 79
    master - mean (77ms)  : 75, 79

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (1,097ms)  : 1044, 1149
    master - mean (1,100ms)  : 1048, 1151

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 (8732) - mean (114ms)  : 107, 120
    master - mean (115ms)  : 107, 123

    section Bailout
    This PR (8732) - mean (113ms)  : 111, 116
    master - mean (114ms)  : 111, 117

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (795ms)  : 767, 823
    master - mean (800ms)  : 778, 822

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8732) - mean (101ms)  : 96, 106
    master - mean (100ms)  : 97, 103

    section Bailout
    This PR (8732) - mean (105ms)  : 101, 109
    master - mean (100ms)  : 99, 102

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (944ms)  : 913, 976
    master - mean (950ms)  : 910, 990

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8732) - mean (98ms)  : 94, 102
    master - mean (102ms)  : 96, 107

    section Bailout
    This PR (8732) - mean (99ms)  : 97, 102
    master - mean (101ms)  : 98, 103

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (827ms)  : 787, 866
    master - mean (824ms)  : 788, 860

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 (8732) - mean (198ms)  : 193, 204
    master - mean (198ms)  : 194, 202

    section Bailout
    This PR (8732) - mean (201ms)  : 196, 206
    master - mean (201ms)  : 198, 204

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (1,189ms)  : 1161, 1218
    master - mean (1,203ms)  : 1141, 1265

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 (8732) - mean (281ms)  : 275, 288
    master - mean (284ms)  : 278, 290

    section Bailout
    This PR (8732) - mean (281ms)  : 274, 288
    master - mean (285ms)  : 279, 291

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (955ms)  : 939, 972
    master - mean (959ms)  : 939, 979

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8732) - mean (276ms)  : 269, 282
    master - mean (278ms)  : 273, 282

    section Bailout
    This PR (8732) - mean (276ms)  : 271, 281
    master - mean (280ms)  : 275, 286

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (1,156ms)  : 1118, 1193
    master - mean (1,159ms)  : 1122, 1196

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8732) - mean (274ms)  : 267, 282
    master - mean (276ms)  : 268, 284

    section Bailout
    This PR (8732) - mean (275ms)  : 268, 282
    master - mean (276ms)  : 267, 286

    section CallTarget+Inlining+NGEN
    This PR (8732) - mean (1,040ms)  : 992, 1088
    master - mean (1,041ms)  : 1002, 1080

Loading

@bm1549
bm1549 marked this pull request as ready for review June 5, 2026 16:10
@bm1549
bm1549 requested a review from a team as a code owner June 5, 2026 16:10
Comment thread tracer/src/Datadog.Trace.SourceGenerators/Helpers/YamlReader.cs Outdated
foreach (var kvp in parsedData.Configurations)
{
var entry = kvp.Value;
if (entry.Scope is null || !entry.Scope.Any(s => string.Equals(s, "managed", StringComparison.OrdinalIgnoreCase)))

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.

Avoid LINQ if possible as it's relatively expensive. Plus we should prob just do case-sensitive comparison

Comment thread tracer/src/Datadog.Trace.SourceGenerators/Helpers/YamlReader.cs Outdated
Comment thread tracer/src/Datadog.Trace.SourceGenerators/Helpers/YamlReader.cs Outdated
bm1549 added a commit that referenced this pull request Jun 9, 2026
## Summary of changes

Adds `scope: managed` to every existing entry in
`supported-configurations.yaml`. Also adds `scope` to the YAML parser's
recognized property list so the field is accepted without throwing.

This is the first of three stacked PRs introducing scope tracking to the
configuration registry:
- **PR 1 (this)**: Add `scope: managed` to all existing entries — pure
data + one-line parser guard
- [**PR 2**](#8732): Full
scope infrastructure — parsing, generator enforcement, tests, docs
- [**PR 3**](#8733): All
native config variables — new `scope: native` entries + `scope: managed,
native` upgrades

## Reason for change

Prerequisite for scope-aware config registry. The parser must recognize
the field before the data lands; the generator infrastructure lands in
PR 2.

## Implementation details

- `YamlReader.cs`: one-line addition — `"scope"` added to the recognized
property list (prevents `InvalidOperationException` on unknown fields)
- `supported-configurations.yaml`: `scope: managed` inserted after every
`- implementation:` line across all 317 existing entries

No behavioral change — the generator does not yet read or act on the
scope field.

## Test coverage

Existing test suite passes unchanged. The generator ignores the scope
field at this point so no new tests are needed here.

## Other details

Part of a larger effort to register all native-consumed `DD_*` variables
in the config registry and enforce coverage via a CI test.

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Base automatically changed from brian.marks/native-config-scope-pr1 to master June 9, 2026 22:07
@bm1549
bm1549 requested a review from a team as a code owner June 9, 2026 22:07
bm1549 and others added 5 commits June 9, 2026 18:14
Parses scope into string[]? on ConfigurationEntry; the generator skips C#
constant generation for native-only entries and emits DDSG0009 for missing
or unrecognized scope values. Adds scope behavior tests.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Split the single loop into a validation pass (scope + documentation, for all
entries) and a generation pass that filters to managed-scoped keys up front.
Since scope is already validated, the generation pass can filter on "managed"
directly. Behavior is unchanged; the flow now reads as "validate everything,
then generate constants for managed keys."

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…e checks

Address source-generator review feedback:
- Switch ConfigurationEntry.Scope/Aliases to EquatableArray<string>,
  removing the hand-rolled ArraysEqual helper (anna-git, andrewlock).
- Replace the LINQ + OrdinalIgnoreCase managed-scope filter with an
  allocation-free, case-sensitive ScopeContains helper (andrewlock), and
  drop the now-unused ValidScopeValues field.
- Fix a pattern-precedence bug in scope validation: `is not "managed"
  or "native"` parsed as `(not "managed") or "native"`, flagging every
  non-"managed" value (including "native"); use `is not ("managed" or
  "native")`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@bm1549
bm1549 force-pushed the brian.marks/native-config-scope-pr2 branch from a5b94f6 to d823642 Compare June 9, 2026 22:47

@anna-git anna-git left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT on one funny comment left and Andrew's comment to address on the usage of linq

bm1549 and others added 2 commits June 10, 2026 11:46
The scope CSV parse was the only LINQ this PR introduced; swap the
Split().Select().Where().ToArray() chain for an allocation-free loop,
per review preference to avoid LINQ in the source generator.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@bm1549
bm1549 enabled auto-merge (squash) June 10, 2026 17:28
@bm1549
bm1549 merged commit cf138c1 into master Jun 10, 2026
134 of 137 checks passed
@bm1549
bm1549 deleted the brian.marks/native-config-scope-pr2 branch June 10, 2026 17:28
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 10, 2026
zacharycmontoya pushed a commit that referenced this pull request Jun 16, 2026
## Summary of changes

Adds `scope: managed` to every existing entry in
`supported-configurations.yaml`. Also adds `scope` to the YAML parser's
recognized property list so the field is accepted without throwing.

This is the first of three stacked PRs introducing scope tracking to the
configuration registry:
- **PR 1 (this)**: Add `scope: managed` to all existing entries — pure
data + one-line parser guard
- [**PR 2**](#8732): Full
scope infrastructure — parsing, generator enforcement, tests, docs
- [**PR 3**](#8733): All
native config variables — new `scope: native` entries + `scope: managed,
native` upgrades

## Reason for change

Prerequisite for scope-aware config registry. The parser must recognize
the field before the data lands; the generator infrastructure lands in
PR 2.

## Implementation details

- `YamlReader.cs`: one-line addition — `"scope"` added to the recognized
property list (prevents `InvalidOperationException` on unknown fields)
- `supported-configurations.yaml`: `scope: managed` inserted after every
`- implementation:` line across all 317 existing entries

No behavioral change — the generator does not yet read or act on the
scope field.

## Test coverage

Existing test suite passes unchanged. The generator ignores the scope
field at this point so no new tests are needed here.

## Other details

Part of a larger effort to register all native-consumed `DD_*` variables
in the config registry and enforce coverage via a CI test.

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
zacharycmontoya pushed a commit that referenced this pull request Jun 16, 2026
…3) (#8732)

## Summary of changes

Adds the scope field infrastructure to the configuration registry:
parsing, source-generator enforcement, tests, and documentation.

Stack:
- **PR 1** (merged): `scope: managed` on all existing entries
- **PR 2 (this)**: scope infrastructure — parsing, enforcement, tests,
docs
- **PR 3**: all native config variables

## Reason for change

Lets the registry distinguish managed-only, native-only, and dual-scope
(`managed, native`) config variables. The generator emits C# constants
only for entries whose scope includes `managed`; native-only entries are
registered for coverage tracking and produce no constant. A build error
(DDSG0009) is emitted for any entry missing a valid scope.

## Implementation details

- `YamlReader.cs`: `ConfigurationEntry.Scope`/`Aliases` are now
`EquatableArray<string>` for value-based equality (the incremental
generator caches on it); comma-separated scope parsing (`managed`,
`native`, `managed, native`).
- `ConfigurationKeysGenerator.cs`: a validation pass emits DDSG0009 for
missing/empty/unrecognized scope (`scopeValue is not ("managed" or
"native")`); a separate generation pass emits constants only for
managed-scoped keys, via an allocation-free, case-sensitive
`ScopeContains` helper.
- `ConfigKeyAliasesSwitcherGenerator.cs`: updated for the
`EquatableArray<string>` aliases.
- `ConfigurationKeysGeneratorTests.cs`: tests for native-only exclusion,
`managed, native` inclusion, and DDSG0009 on empty/invalid scope;
existing YAML fixtures carry `scope`.
- `AddingConfigurationKeys.md`: `scope` documented as a Required field.

## Test coverage

Source-generator unit tests pass, including the native-only exclusion
and DDSG0009 cases. The native-coverage enforcement (a Nuke build step)
lands in PR 3 alongside the data it validates.

## Other details

Safe to merge onto master: all existing entries carry `scope: managed`,
so DDSG0009 does not fire.

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Andrew Lock <[email protected]>
Co-authored-by: Anna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants