Skip to content

Conversation

@anna-git
Copy link
Contributor

@anna-git anna-git commented Oct 21, 2025

Context

Part of Configuration Inversion (Step 4) - Stack progress:

  1. #7548 - Add GitLab step and JSON configuration file
  2. #7688 - Cleanup configuration / platform keys + analyzers
  3. #7698 - Source generator for ConfigurationKeys
  4. #7689 - Aliases handling and analyzers (this PR)
  5. #7697 - Replace manual ConfigurationKeys with generated version

Summary

Adds source generator for configuration key aliases, integrates alias resolution into ConfigurationBuilder, and adds Roslyn analyzers to enforce proper configuration key usage.

Changes

Alias Source Generator:

  • ConfigKeyAliasesSwitcherGenerator reads aliases from supported-configurations.json
  • Auto-generates switch statements to resolve primary keys from aliases
  • Generated for all target frameworks (net461, netstandard2.0, netcoreapp3.1, net6.0)

ConfigurationBuilder Improvements:

  • Integrated alias resolution directly into ConfigurationBuilder.WithKeys()
  • Removed manual fallback overloads throughout codebase
  • Added GetKeyWithAlias() method to IConfigurationSource interface

IntegrationSettings Special Handling:

  • Updated to use pattern-based key construction (e.g., DD_TRACE_{INTEGRATION}_ENABLED)
  • Simplified configuration reading by leveraging alias system

Roslyn Analyzers:

  • DD0007: PlatformKeysAnalyzer - Enforces use of PlatformKeys for external platform environment variables
  • DD0008: ConfigurationBuilderWithKeysAnalyzer - Enforces use of ConfigurationKeys/PlatformKeys constants in ConfigurationBuilder.WithKeys() calls

Special Cases:

  • Fixed DatadogLoggingFactory to handle deprecated DD_TRACE_LOG_PATH with proper analyzer suppression
  • Updated configuration tests to work with alias resolution

Motivation

Completes configuration inversion by:

  • Auto-generating alias resolution from supported-configurations.json
  • Eliminating manual fallback chains
  • Enforcing compile-time validation of configuration keys
  • Preventing hardcoded strings and typos

Test Coverage

  • Added ConfigKeyAliasesSwitcherGeneratorTests with comprehensive test coverage
  • Added PlatformKeysAnalyzerTests with 146 lines of tests
  • Added ConfigurationBuilderWithKeysAnalyzerTests with 538 lines of tests
  • Updated existing configuration tests for alias support
  • All tests pass with new alias system

Related Work

Builds on #7548 (configuration registry), #7688 (PlatformKeys separation), and #7698 (source generator for ConfigurationKeys).

@anna-git anna-git marked this pull request as ready for review October 21, 2025 16:24
@anna-git anna-git requested review from a team as code owners October 21, 2025 16:24
@anna-git anna-git requested a review from link04 October 21, 2025 16:24
@anna-git anna-git changed the base branch from master to anna/config-inversion-configuration-aliases-switch-3 October 21, 2025 16:25
@anna-git anna-git marked this pull request as draft October 21, 2025 16:25
@anna-git anna-git changed the title anna/config-inversion-configuration-analyzers-4 [Config registry] Analyzers for ConfigurationBuilder, ConfigurationKeys, PlatformKeys Oct 21, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from be32003 to c983088 Compare October 21, 2025 16:41
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from acaf6cf to c1f7943 Compare October 21, 2025 16:42
@pr-commenter
Copy link

pr-commenter bot commented Oct 21, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7689 compared to master:

  • 3 benchmarks are slower, with geometric mean 1.508
  • 4 benchmarks have fewer allocations
  • 10 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.06 KB 6.11 KB 50 B 0.83%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.5μs 57.7ns 346ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 13.9μs 66.8ns 259ns 0 0 0 5.7 KB
master StartStopWithChild net472 22.3μs 119ns 665ns 0.977 0.326 0.109 6.06 KB
#7689 StartStopWithChild net6.0 11μs 58.5ns 298ns 0 0 0 5.51 KB
#7689 StartStopWithChild netcoreapp3.1 14μs 27.7ns 107ns 0 0 0 5.72 KB
#7689 StartStopWithChild net472 22.2μs 124ns 816ns 0.963 0.214 0 6.11 KB
Benchmarks.Trace.AgentWriterBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 N/A N/A N/A NaN NaN NaN 0 b
master WriteAndFlushEnrichedTraces netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master WriteAndFlushEnrichedTraces net472 N/A N/A N/A NaN NaN NaN 0 b
#7689 WriteAndFlushEnrichedTraces net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7689 WriteAndFlushEnrichedTraces netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7689 WriteAndFlushEnrichedTraces net472 N/A N/A N/A NaN NaN NaN 0 b
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.08μs 5.94ns 36.1ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.42μs 7.96ns 51ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.06μs 0.817ns 3.16ns 0.191 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.31μs 34.6ns 147ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.87μs 45.6ns 204ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.61μs 6.65ns 25.8ns 0.722 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 325ns 1.83ns 10.7ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 396ns 0.266ns 1.03ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 301ns 0.313ns 1.21ns 0.0438 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.38μs 32.1ns 136ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.9μs 39.2ns 175ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.67μs 2.3ns 8.91ns 0.6 0 0 3.8 KB
#7689 AllCycleSimpleBody net6.0 1.08μs 6.11ns 45.3ns 0 0 0 1.22 KB
#7689 AllCycleSimpleBody netcoreapp3.1 1.42μs 7.71ns 44.3ns 0 0 0 1.2 KB
#7689 AllCycleSimpleBody net472 998ns 0.622ns 2.41ns 0.194 0 0 1.23 KB
#7689 AllCycleMoreComplexBody net6.0 7.22μs 33ns 128ns 0 0 0 4.72 KB
#7689 AllCycleMoreComplexBody netcoreapp3.1 9.04μs 41.2ns 160ns 0 0 0 4.62 KB
#7689 AllCycleMoreComplexBody net472 7.68μs 7.68ns 29.7ns 0.721 0 0 4.74 KB
#7689 ObjectExtractorSimpleBody net6.0 333ns 0.183ns 0.634ns 0 0 0 280 B
#7689 ObjectExtractorSimpleBody netcoreapp3.1 417ns 0.292ns 1.05ns 0 0 0 272 B
#7689 ObjectExtractorSimpleBody net472 297ns 0.269ns 1.04ns 0.0446 0 0 281 B
#7689 ObjectExtractorMoreComplexBody net6.0 6.19μs 33.7ns 185ns 0 0 0 3.78 KB
#7689 ObjectExtractorMoreComplexBody netcoreapp3.1 7.89μs 39.2ns 162ns 0 0 0 3.69 KB
#7689 ObjectExtractorMoreComplexBody net472 6.66μs 2.62ns 9.81ns 0.57 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 76.1μs 21.7ns 78.3ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.1μs 165ns 639ns 0 0 0 32.4 KB
master EncodeArgs net472 109μs 19.6ns 73.2ns 4.91 0 0 32.51 KB
master EncodeLegacyArgs net6.0 148μs 46.7ns 175ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 514ns 1.99μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 265μs 117ns 420ns 0 0 0 2.16 KB
#7689 EncodeArgs net6.0 75.7μs 352ns 1.36μs 0 0 0 32.4 KB
#7689 EncodeArgs netcoreapp3.1 97.5μs 213ns 799ns 0 0 0 32.4 KB
#7689 EncodeArgs net472 110μs 15.8ns 61.2ns 4.93 0 0 32.5 KB
#7689 EncodeLegacyArgs net6.0 146μs 49ns 177ns 0 0 0 2.15 KB
#7689 EncodeLegacyArgs netcoreapp3.1 199μs 387ns 1.5μs 0 0 0 2.14 KB
#7689 EncodeLegacyArgs net472 262μs 356ns 1.38μs 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472 0 b 8.19 KB 8.19 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472 0 b 8.19 KB 8.19 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0 2.88 KB 3.17 KB 288 B 10.00%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 5.14 KB 5.53 KB 384 B 7.47%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 424μs 1.37μs 5.49μs 0 0 0 5.14 KB
master RunWafRealisticBenchmark netcoreapp3.1 456μs 2.64μs 22.6μs 0 0 0 4.58 KB
master RunWafRealisticBenchmark net472 498μs 377ns 1.41μs 0 0 0 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 327μs 2.12μs 20.9μs 0 0 0 2.88 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 348μs 3.27μs 31.5μs 0 0 0 2.32 KB
master RunWafRealisticBenchmarkWithAttack net472 372μs 252ns 909ns 0 0 0 0 b
#7689 RunWafRealisticBenchmark net6.0 434μs 2.23μs 13.9μs 0 0 0 5.53 KB
#7689 RunWafRealisticBenchmark netcoreapp3.1 460μs 1.56μs 5.63μs 0 0 0 4.58 KB
#7689 RunWafRealisticBenchmark net472 500μs 479ns 1.79μs 0 0 0 8.19 KB
#7689 RunWafRealisticBenchmarkWithAttack net6.0 315μs 1.01μs 3.76μs 0 0 0 3.17 KB
#7689 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 343μs 1.92μs 13.2μs 0 0 0 2.32 KB
#7689 RunWafRealisticBenchmarkWithAttack net472 376μs 213ns 769ns 0 0 0 8.19 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 61.2μs 71.7ns 278ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.4μs 169ns 1.15μs 0 0 0 17.42 KB
master SendRequest net472 0.00754ns 0.0021ns 0.00787ns 0 0 0 0 b
#7689 SendRequest net6.0 61.8μs 93.2ns 349ns 0 0 0 14.52 KB
#7689 SendRequest netcoreapp3.1 72.3μs 337ns 1.35μs 0 0 0 17.42 KB
#7689 SendRequest net472 0.00641ns 0.00195ns 0.00756ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7689

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1 1.859 2,120,200.00 3,942,200.00
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 1.634 1,726,100.00 2,820,450.00
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 1.128 1,397,450.00 1,575,900.00

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 0 b 8.19 KB 8.19 KB
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 0 b 8.19 KB 8.19 KB

Fewer allocations 🎉 in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 640 B 304 B -336 B -52.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.88ms 3.27μs 12.7μs 0 0 0 640.98 KB
master OriginalCharSlice netcoreapp3.1 2.13ms 6.12μs 40.1μs 0 0 0 640.1 KB
master OriginalCharSlice net472 2.64ms 668ns 2.5μs 0 0 0 647.17 KB
master OptimizedCharSlice net6.0 1.4ms 447ns 1.67μs 0 0 0 640 B
master OptimizedCharSlice netcoreapp3.1 1.73ms 5.65μs 37.1μs 0 0 0 104 B
master OptimizedCharSlice net472 1.98ms 544ns 2.04μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 1.05ms 1.25μs 4.85μs 0 0 0 640 B
master OptimizedCharSliceWithPool netcoreapp3.1 1.86ms 1.72μs 6.65μs 0 0 0 104 B
master OptimizedCharSliceWithPool net472 1.23ms 781ns 3.02μs 0 0 0 0 b
#7689 OriginalCharSlice net6.0 2.03ms 1.36μs 5.08μs 0 0 0 640.64 KB
#7689 OriginalCharSlice netcoreapp3.1 3.94ms 1.64μs 6.14μs 0 0 0 640.1 KB
#7689 OriginalCharSlice net472 2.56ms 1.38μs 5.36μs 0 0 0 647.17 KB
#7689 OptimizedCharSlice net6.0 1.58ms 969ns 3.49μs 0 0 0 304 B
#7689 OptimizedCharSlice netcoreapp3.1 2.82ms 634ns 2.37μs 0 0 0 104 B
#7689 OptimizedCharSlice net472 1.96ms 825ns 3.09μs 0 0 0 8.19 KB
#7689 OptimizedCharSliceWithPool net6.0 1.07ms 2.28μs 8.84μs 0 0 0 640 B
#7689 OptimizedCharSliceWithPool netcoreapp3.1 1.9ms 1.96μs 7.58μs 0 0 0 104 B
#7689 OptimizedCharSliceWithPool net472 1.14ms 495ns 1.92μs 0 0 0 8.19 KB
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.77 KB 42.58 KB 813 B 1.95%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 689μs 2.8μs 10.5μs 0 0 0 41.77 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 802μs 1.06μs 3.95μs 0 0 0 41.82 KB
master WriteAndFlushEnrichedTraces net472 852μs 2.34μs 9.08μs 8.33 0 0 56.22 KB
#7689 WriteAndFlushEnrichedTraces net6.0 707μs 3.99μs 26.8μs 0 0 0 42.58 KB
#7689 WriteAndFlushEnrichedTraces netcoreapp3.1 802μs 4.07μs 18.7μs 0 0 0 41.85 KB
#7689 WriteAndFlushEnrichedTraces net472 890μs 3.75μs 13.5μs 4.46 0 0 55.97 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 2μs 7.88ns 29.5ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.59μs 7.55ns 29.2ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.77μs 4.17ns 16.1ns 0.154 0 0 987 B
#7689 ExecuteNonQuery net6.0 1.92μs 3.32ns 12.9ns 0 0 0 1.02 KB
#7689 ExecuteNonQuery netcoreapp3.1 2.56μs 6.23ns 24.1ns 0 0 0 1.02 KB
#7689 ExecuteNonQuery net472 2.67μs 2.96ns 11.5ns 0.146 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.76μs 2.98ns 11.6ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.28μs 4.74ns 18.4ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.55μs 2.98ns 11.6ns 0.16 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.8μs 0.809ns 2.92ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.41μs 8.04ns 31.1ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.62μs 4.18ns 16.2ns 0.165 0 0 1.1 KB
#7689 CallElasticsearch net6.0 1.76μs 8.98ns 41.2ns 0 0 0 1.03 KB
#7689 CallElasticsearch netcoreapp3.1 2.37μs 5.76ns 22.3ns 0 0 0 1.03 KB
#7689 CallElasticsearch net472 3.53μs 5.88ns 22ns 0.158 0 0 1.04 KB
#7689 CallElasticsearchAsync net6.0 1.87μs 9.08ns 38.5ns 0 0 0 1.01 KB
#7689 CallElasticsearchAsync netcoreapp3.1 2.35μs 11.7ns 52.2ns 0 0 0 1.08 KB
#7689 CallElasticsearchAsync net472 3.67μs 3.45ns 13.4ns 0.165 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.96μs 8.73ns 33.8ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.34μs 9.89ns 38.3ns 0 0 0 952 B
master ExecuteAsync net472 2.57μs 1.64ns 6.12ns 0.141 0 0 915 B
#7689 ExecuteAsync net6.0 1.84μs 1.7ns 6.58ns 0 0 0 952 B
#7689 ExecuteAsync netcoreapp3.1 2.41μs 9.99ns 38.7ns 0 0 0 952 B
#7689 ExecuteAsync net472 2.72μs 1.04ns 4.01ns 0.136 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.9μs 8.06ns 30.2ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.69μs 28ns 108ns 0 0 0 2.9 KB
master SendAsync net472 12.4μs 11.4ns 42.6ns 0.495 0 0 3.18 KB
#7689 SendAsync net6.0 6.93μs 18.9ns 73.3ns 0 0 0 2.36 KB
#7689 SendAsync netcoreapp3.1 8.43μs 24.7ns 95.6ns 0 0 0 2.9 KB
#7689 SendAsync net472 12μs 9.01ns 34.9ns 0.48 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.1 KB 45.21 KB 2.1 KB 4.88%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 290.08 KB 11.55 KB 4.15%

Fewer allocations 🎉 in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.1 KB 42.73 KB -1.37 KB -3.10%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.47 KB 257.26 KB -17.22 KB -6.27%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 65.54 KB 57.34 KB -8.19 KB -12.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 45.1μs 201ns 698ns 0 0 0 43.1 KB
master StringConcatBenchmark netcoreapp3.1 48.8μs 174ns 628ns 0 0 0 44.1 KB
master StringConcatBenchmark net472 56.2μs 253ns 979ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 473μs 2.03μs 8.12μs 0 0 0 278.65 KB
master StringConcatAspectBenchmark netcoreapp3.1 509μs 1.55μs 6.77μs 0 0 0 274.47 KB
master StringConcatAspectBenchmark net472 412μs 2.36μs 17μs 0 0 0 278.53 KB
#7689 StringConcatBenchmark net6.0 47.7μs 439ns 4.17μs 0 0 0 45.21 KB
#7689 StringConcatBenchmark netcoreapp3.1 55.5μs 313ns 2.6μs 0 0 0 42.73 KB
#7689 StringConcatBenchmark net472 57.7μs 120ns 450ns 0 0 0 57.34 KB
#7689 StringConcatAspectBenchmark net6.0 485μs 1.92μs 8.13μs 0 0 0 279.04 KB
#7689 StringConcatAspectBenchmark netcoreapp3.1 518μs 2.04μs 7.37μs 0 0 0 257.26 KB
#7689 StringConcatAspectBenchmark net472 408μs 2.12μs 10.4μs 0 0 0 290.08 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.72μs 13.3ns 58ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.63μs 17.8ns 71.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.86μs 4.37ns 16.9ns 0.251 0 0 1.64 KB
#7689 EnrichedLog net6.0 2.68μs 13.5ns 57.3ns 0 0 0 1.7 KB
#7689 EnrichedLog netcoreapp3.1 3.69μs 18.6ns 80.9ns 0 0 0 1.7 KB
#7689 EnrichedLog net472 3.99μs 5.11ns 19.8ns 0.259 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 122μs 103ns 400ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 136μs 770ns 5.28μs 0 0 0 4.31 KB
master EnrichedLog net472 168μs 82.2ns 318ns 0 0 0 4.51 KB
#7689 EnrichedLog net6.0 123μs 141ns 508ns 0 0 0 4.31 KB
#7689 EnrichedLog netcoreapp3.1 128μs 155ns 560ns 0 0 0 4.31 KB
#7689 EnrichedLog net472 169μs 157ns 607ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.01μs 0.968ns 3.75ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.93μs 18.4ns 71.3ns 0 0 0 2.26 KB
master EnrichedLog net472 7.6μs 8.88ns 34.4ns 0.303 0 0 2.08 KB
#7689 EnrichedLog net6.0 4.94μs 18.3ns 70.7ns 0 0 0 2.26 KB
#7689 EnrichedLog netcoreapp3.1 6.95μs 25.5ns 98.7ns 0 0 0 2.26 KB
#7689 EnrichedLog net472 7.57μs 7.75ns 30ns 0.305 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2μs 1.83ns 7.09ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.68μs 5.16ns 19.3ns 0 0 0 1.2 KB
master SendReceive net472 3.1μs 2.24ns 8.67ns 0.187 0 0 1.2 KB
#7689 SendReceive net6.0 1.91μs 10.3ns 49.3ns 0 0 0 1.2 KB
#7689 SendReceive netcoreapp3.1 2.66μs 12.4ns 49.5ns 0 0 0 1.2 KB
#7689 SendReceive net472 3.03μs 0.981ns 3.8ns 0.183 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.39μs 6.63ns 24.8ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.78μs 22.7ns 87.9ns 0 0 0 1.63 KB
master EnrichedLog net472 6.34μs 9.43ns 36.5ns 0.316 0 0 2.03 KB
#7689 EnrichedLog net6.0 4.55μs 1.89ns 6.54ns 0 0 0 1.58 KB
#7689 EnrichedLog netcoreapp3.1 5.91μs 18.3ns 71ns 0 0 0 1.63 KB
#7689 EnrichedLog net472 6.69μs 7.8ns 30.2ns 0.3 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 810ns 3.74ns 16.3ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 1μs 5.05ns 22ns 0 0 0 576 B
master StartFinishSpan net472 932ns 0.196ns 0.735ns 0.0886 0 0 578 B
master StartFinishScope net6.0 944ns 0.324ns 1.21ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.17μs 2.34ns 9.06ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.162ns 0.626ns 0.104 0 0 658 B
master StartFinishTwoScopes net6.0 1.77μs 0.968ns 3.75ns 0 0 0 1.19 KB
master StartFinishTwoScopes netcoreapp3.1 2.23μs 10.5ns 43.2ns 0 0 0 1.19 KB
master StartFinishTwoScopes net472 2.15μs 1.42ns 5.32ns 0.161 0 0 1.08 KB
#7689 StartFinishSpan net6.0 795ns 0.283ns 1.06ns 0 0 0 576 B
#7689 StartFinishSpan netcoreapp3.1 985ns 4.74ns 18.4ns 0 0 0 576 B
#7689 StartFinishSpan net472 914ns 0.103ns 0.384ns 0.0916 0 0 578 B
#7689 StartFinishScope net6.0 950ns 3.52ns 13.6ns 0 0 0 696 B
#7689 StartFinishScope netcoreapp3.1 1.18μs 6.46ns 35.4ns 0 0 0 696 B
#7689 StartFinishScope net472 1.13μs 1.73ns 6.68ns 0.101 0 0 658 B
#7689 StartFinishTwoScopes net6.0 1.76μs 9.33ns 47.6ns 0 0 0 1.19 KB
#7689 StartFinishTwoScopes netcoreapp3.1 2.22μs 11.3ns 51.8ns 0 0 0 1.19 KB
#7689 StartFinishTwoScopes net472 2.16μs 0.878ns 3.4ns 0.163 0 0 1.08 KB
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.08μs 0.384ns 1.49ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.45μs 7.3ns 31.8ns 0 0 0 696 B
master RunOnMethodBegin net472 1.42μs 0.877ns 3.4ns 0.0994 0 0 658 B
#7689 RunOnMethodBegin net6.0 1.07μs 5.44ns 26.1ns 0 0 0 696 B
#7689 RunOnMethodBegin netcoreapp3.1 1.44μs 7.06ns 29.1ns 0 0 0 696 B
#7689 RunOnMethodBegin net472 1.44μs 3.7ns 14.3ns 0.0998 0 0 658 B

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Oct 21, 2025

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration74.01 ± (74.01 - 74.60) ms75.31 ± (75.27 - 76.08) ms+1.7%✅⬆️
.NET Framework 4.8 - Bailout
duration79.46 ± (79.28 - 79.94) ms79.23 ± (78.98 - 79.67) ms-0.3%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1058.84 ± (1060.96 - 1070.35) ms1067.14 ± (1068.22 - 1077.60) ms+0.8%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.83 ± (22.75 - 22.90) ms22.87 ± (22.80 - 22.93) ms+0.2%✅⬆️
process.time_to_main_ms87.09 ± (86.76 - 87.42) ms86.91 ± (86.52 - 87.29) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.91 - 10.92) MB10.92 ± (10.92 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.71 ± (22.65 - 22.77) ms22.76 ± (22.70 - 22.81) ms+0.2%✅⬆️
process.time_to_main_ms88.89 ± (88.54 - 89.25) ms88.42 ± (88.12 - 88.72) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.95 - 10.96) MB10.95 ± (10.95 - 10.96) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms222.46 ± (221.03 - 223.89) ms220.90 ± (219.47 - 222.33) ms-0.7%
process.time_to_main_ms499.24 ± (498.10 - 500.38) ms502.61 ± (501.49 - 503.74) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.84 ± (47.82 - 47.86) MB47.92 ± (47.89 - 47.94) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.59 ± (21.53 - 21.66) ms21.70 ± (21.64 - 21.76) ms+0.5%✅⬆️
process.time_to_main_ms76.29 ± (75.96 - 76.61) ms76.68 ± (76.38 - 76.98) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.60) MB10.62 ± (10.62 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.65 ± (21.58 - 21.72) ms21.65 ± (21.60 - 21.71) ms+0.0%✅⬆️
process.time_to_main_ms77.55 ± (77.20 - 77.90) ms76.91 ± (76.63 - 77.19) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.66) MB10.67 ± (10.67 - 10.68) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms212.29 ± (211.14 - 213.44) ms210.43 ± (209.23 - 211.63) ms-0.9%
process.time_to_main_ms466.22 ± (465.11 - 467.34) ms470.42 ± (469.32 - 471.53) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.03 ± (48.01 - 48.06) MB48.20 ± (48.17 - 48.22) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.81 ± (19.76 - 19.87) ms19.97 ± (19.91 - 20.02) ms+0.8%✅⬆️
process.time_to_main_ms74.84 ± (74.51 - 75.17) ms75.39 ± (75.08 - 75.71) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.65 ± (7.65 - 7.66) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.01 ± (19.92 - 20.10) ms19.89 ± (19.84 - 19.94) ms-0.6%
process.time_to_main_ms77.27 ± (76.86 - 77.67) ms76.78 ± (76.53 - 77.03) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.72) MB7.71 ± (7.70 - 7.72) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms193.71 ± (192.69 - 194.73) ms193.22 ± (192.24 - 194.21) ms-0.3%
process.time_to_main_ms455.16 ± (454.13 - 456.20) ms455.75 ± (454.79 - 456.71) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.49 ± (36.45 - 36.54) MB36.48 ± (36.45 - 36.52) MB-0.0%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.27 ± (192.93 - 193.66) ms193.32 ± (193.40 - 194.21) ms+0.0%✅⬆️
.NET Framework 4.8 - Bailout
duration196.91 ± (196.84 - 197.26) ms197.89 ± (197.78 - 198.74) ms+0.5%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1119.26 ± (1120.21 - 1128.61) ms1115.46 ± (1125.59 - 1136.07) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms187.86 ± (187.51 - 188.22) ms188.71 ± (188.27 - 189.14) ms+0.4%✅⬆️
process.time_to_main_ms80.79 ± (80.60 - 80.99) ms80.73 ± (80.54 - 80.91) ms-0.1%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.05 - 16.10) MB16.10 ± (16.07 - 16.13) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.82 ± (187.52 - 188.12) ms187.69 ± (187.34 - 188.04) ms-0.1%
process.time_to_main_ms82.02 ± (81.88 - 82.16) ms82.27 ± (82.10 - 82.44) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.08 - 16.13) MB16.15 ± (16.12 - 16.17) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.5%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms399.99 ± (397.40 - 402.58) ms406.20 ± (403.24 - 409.16) ms+1.6%✅⬆️
process.time_to_main_ms474.10 ± (473.44 - 474.77) ms476.65 ± (475.91 - 477.40) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.61 ± (58.48 - 58.74) MB58.75 ± (58.64 - 58.87) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms193.04 ± (192.68 - 193.41) ms192.16 ± (191.84 - 192.49) ms-0.5%
process.time_to_main_ms70.30 ± (70.14 - 70.46) ms70.26 ± (70.04 - 70.47) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.21 - 16.40) MB16.31 ± (16.22 - 16.41) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.90 ± (191.59 - 192.20) ms191.69 ± (191.42 - 191.96) ms-0.1%
process.time_to_main_ms71.15 ± (71.05 - 71.25) ms71.03 ± (70.91 - 71.14) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.27 ± (16.13 - 16.41) MB16.39 ± (16.31 - 16.48) MB+0.8%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 20)20 ± (20 - 20)+3.2%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms409.65 ± (407.36 - 411.93) ms408.36 ± (406.12 - 410.61) ms-0.3%
process.time_to_main_ms442.67 ± (442.14 - 443.20) ms444.24 ± (443.60 - 444.87) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.84 ± (58.69 - 58.99) MB59.16 ± (59.03 - 59.28) MB+0.5%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (30 - 30)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms192.24 ± (191.83 - 192.64) ms192.97 ± (192.50 - 193.44) ms+0.4%✅⬆️
process.time_to_main_ms69.89 ± (69.66 - 70.11) ms69.97 ± (69.76 - 70.18) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.71 - 11.77) MB11.71 ± (11.69 - 11.74) MB-0.2%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.2%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms190.13 ± (189.82 - 190.45) ms189.86 ± (189.59 - 190.13) ms-0.1%
process.time_to_main_ms70.51 ± (70.42 - 70.60) ms70.43 ± (70.31 - 70.55) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.85 ± (11.82 - 11.88) MB11.81 ± (11.77 - 11.85) MB-0.4%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.2%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms366.55 ± (365.09 - 368.01) ms366.75 ± (365.03 - 368.47) ms+0.1%✅⬆️
process.time_to_main_ms428.97 ± (428.34 - 429.60) ms428.74 ± (428.23 - 429.24) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.90 ± (47.87 - 47.93) MB47.92 ± (47.89 - 47.95) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
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 (7689) - mean (76ms)  : 70, 82
    master - mean (74ms)  : 70, 79

    section Bailout
    This PR (7689) - mean (79ms)  : 74, 84
    master - mean (80ms)  : 75, 84

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (1,073ms)  : 1006, 1140
    master - mean (1,066ms)  : 999, 1133

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 (7689) - mean (117ms)  : 110, 125
    master - mean (117ms)  : 111, 124

    section Bailout
    This PR (7689) - mean (118ms)  : 112, 125
    master - mean (119ms)  : 111, 127

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (759ms)  : 718, 800
    master - mean (758ms)  : 721, 795

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

    section Bailout
    This PR (7689) - mean (105ms)  : 99, 112
    master - mean (106ms)  : 99, 113

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (709ms)  : 680, 738
    master - mean (706ms)  : 680, 733

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7689) - mean (104ms)  : 98, 110
    master - mean (103ms)  : 96, 110

    section Bailout
    This PR (7689) - mean (105ms)  : 99, 111
    master - mean (106ms)  : 100, 112

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (680ms)  : 643, 717
    master - mean (683ms)  : 652, 715

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 (7689) - mean (194ms)  : 190, 198
    master - mean (193ms)  : 189, 197

    section Bailout
    This PR (7689) - mean (198ms)  : 193, 203
    master - mean (197ms)  : 195, 199

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (1,131ms)  : 1049, 1213
    master - mean (1,124ms)  : 1062, 1187

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 (7689) - mean (278ms)  : 271, 285
    master - mean (277ms)  : 272, 282

    section Bailout
    This PR (7689) - mean (278ms)  : 274, 282
    master - mean (279ms)  : 273, 284

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (913ms)  : 869, 956
    master - mean (908ms)  : 856, 960

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7689) - mean (271ms)  : 265, 276
    master - mean (271ms)  : 267, 276

    section Bailout
    This PR (7689) - mean (271ms)  : 268, 274
    master - mean (271ms)  : 268, 275

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (888ms)  : 837, 938
    master - mean (883ms)  : 843, 922

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7689) - mean (273ms)  : 266, 280
    master - mean (272ms)  : 266, 278

    section Bailout
    This PR (7689) - mean (270ms)  : 266, 273
    master - mean (271ms)  : 266, 275

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (827ms)  : 804, 849
    master - mean (827ms)  : 808, 847

Loading

@anna-git anna-git changed the title [Config registry] Analyzers for ConfigurationBuilder, ConfigurationKeys, PlatformKeys [ConfigRegistry] Analyzers for platform and ConfigurationBuilder Oct 22, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from c983088 to 9e2a61b Compare October 22, 2025 17:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from c1f7943 to 56bd199 Compare October 22, 2025 17:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch 2 times, most recently from f242046 to 153e7b3 Compare October 22, 2025 18:14
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 56bd199 to e52fd10 Compare October 22, 2025 18:14
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 153e7b3 to bd34118 Compare October 22, 2025 18:27
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 0c28972 to bea714d Compare October 29, 2025 17:15
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 2a09875 to 279b292 Compare October 29, 2025 17:15
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from bea714d to a6668f3 Compare October 29, 2025 17:48
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 279b292 to 9860a88 Compare October 29, 2025 17:49
anna-git added a commit that referenced this pull request Oct 30, 2025
… keys (#7688)

## Context

Part of **Configuration Inversion (Step 2)** - Stack progress:
1. [#7548](#7548) - Add
GitLab step and JSON configuration file
2. **→ [#7688](#7688) -
[Config registry] Reorganize keys, split config keys and platform
keys(this PR)**
3. [#7698](#7698) -
Generate ConfigurationKeys with source generator
4. [#7689](#7689) -
Aliases handling and analyzers
5. [#7697](#7697) -
Replace manual ConfigurationKeys by generated ones in the whole solution
## Summary

Separates platform-specific environment variables into `PlatformKeys`
class and adds Roslyn analyzers to enforce proper usage of configuration
keys throughout the codebase.

## Changes

**Platform Keys Separation:**
- Created `PlatformKeys` class for external platform environment
variables (AWS, Azure, GCP, Kubernetes, CLR Profiler), those that don't
start with DD_ and come from other platforms.
- Updated all references throughout codebase to use `PlatformKeys` for
platform-specific variables
- Keeps `ConfigurationKeys` focused only on Datadog configuration

**Roslyn Analyzers:**
- **DD0007**: Platform key analyzer - Enforces use of `PlatformKeys` for
external platform environment variables
- **DD0008**: ConfigurationBuilder analyzer - Enforces use of
`ConfigurationKeys` or `PlatformKeys` constants in
`ConfigurationBuilder.WithKeys()` calls
- Prevents hardcoded strings and ensures type safety

**Configuration Mapping:**
- Added `configuration_keys_mapping.json` to map environment variable
names to their `ConfigurationKeys` constant names, so that we avoid
renaming hundreds of variables according to automatically source
generated deducted ones.
- Enables preservation of original constant names during refactoring
- Supports source generator integration

**Code Updates:**
- Updated `TracerSettings`, test files, and profiler code to use
`PlatformKeys`
- Replaced manual `ConfigurationKeys` with generated version from
`supported-configurations.json`
- Added missing `DD_TRACE_LOG_PATH` to configuration registry

## Motivation

Ensures clean separation between Datadog and platform configuration by:
- Preventing accidental mixing of platform and Datadog keys
- Enforcing compile-time validation of configuration key usage
- Making it clear which keys are owned by Datadog vs external platforms
- Catching configuration errors at build time instead of runtime

## Validation

- Roslyn analyzers run on every build
- All existing tests pass with updated key references
- Analyzers report clear diagnostic messages for violations

## Related Work

This PR builds on the configuration registry foundation established in
#7548:
- **Commit `2639cf0`** added `supported-configurations.json` with ~280
keys, aliases, deprecations, and GitLab CI validation
- **Commit `70e632e`** added
[supported-configurations-docs.yaml](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml:0:0-0:0)
with XML documentation for automated doc generation
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from a6668f3 to d90d571 Compare October 30, 2025 18:03
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch 2 times, most recently from 3197af6 to e6d6574 Compare October 30, 2025 20:47
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 6ccb01e to ed3a6bc Compare October 31, 2025 01:39
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch 2 times, most recently from dcd2f3c to 196d5e0 Compare October 31, 2025 21:41
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from f3473db to 5a68b3b Compare November 25, 2025 16:33
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 196d5e0 to 3d682bd Compare November 25, 2025 16:33
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 5a68b3b to affec1a Compare November 25, 2025 20:08
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch 3 times, most recently from 667cda0 to 888141d Compare November 25, 2025 20:51
anna-git added a commit that referenced this pull request Nov 26, 2025
…#7698)

## Context

Part of **Configuration Inversion (Step 3)** - Stack progress:
1. [#7548](#7548) - Add
GitLab step and JSON configuration file
2. [#7688](#7688) -
Cleanup configuration / platform keys + analyzers
3. **→ [#7698](#7698) -
Generate ConfigurationKeys with source generator (this PR)**
4. [#7689](#7689) -
Aliases handling via source generator
5. [#7697](#7697) -
Replace manual ConfigurationKeys by generated ones in the whole solution

## Summary

Adds source generator to auto-generate `ConfigurationKeys` from
`supported-configurations.json` with name mapping to preserve existing
constant names.

## Changes

**Source Generator:**
-
[ConfigurationKeysGenerator](cci:7://file:///var/folders/4j/q1f1tvc503g_thnq6p79cp500000gp/T/SourceGeneratedDocuments/D0E9C9C62821E2CB6FADE080/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator:0:0-0:0)
reads `supported-configurations.json` and
[supported-configurations-docs.yaml](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml:0:0-0:0)
- Auto-generates `ConfigurationKeys` with nested product classes
(AppSec, CIVisibility, OpenTelemetry, etc.)
- Generates XML documentation and `[Obsolete]` attributes from JSON

**Configuration Mapping:**
- `configuration_keys_mapping.json` maps env vars to original constant
names (e.g., `DD_TRACE_ENABLED` → `TraceEnabled`)
- Avoids refactoring hundreds of references across codebase

**Updates:**
- Added missing `DD_TRACE_ACTIVITY_LISTENER_ENABLED` key
- Committed temporary
[ConfigurationKeys2.g.cs](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys2.g.cs:0:0-0:0)
files for validation

## Motivation

Makes `supported-configurations.json` the single source of truth while
preserving existing constant names to avoid massive refactoring.

## Test Coverage

- Added `ConfigurationKeysGeneratorTests.cs` with comprehensive unit
tests
- Tests validate generator output, XML documentation generation, and
obsolete attribute application
- Tests cover nested product classes, deprecations, and YAML
documentation integration
- All existing tests pass without modification

## Related Work

Builds on #7548 (configuration registry) and #7688 (PlatformKeys
separation + analyzers).
Base automatically changed from anna/config-inversion-configuration-aliases-switch-3 to master November 26, 2025 10:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 888141d to 1a1742c Compare November 28, 2025 14:31
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

TY!

@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 1a1742c to 13b5134 Compare December 1, 2025 15:59
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.

5 participants