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:

  • 2 benchmarks are faster, with geometric mean 1.824
  • 1 benchmarks are slower, with geometric mean 2.496
  • 5 benchmarks have fewer allocations
  • 4 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‑netcoreapp3.1 5.69 KB 5.74 KB 54 B 0.95%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.8μs 60.3ns 376ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14.4μs 74.8ns 359ns 0 0 0 5.69 KB
master StartStopWithChild net472 22μs 114ns 536ns 0.973 0.324 0.108 6.05 KB
#7689 StartStopWithChild net6.0 10.5μs 56.1ns 297ns 0 0 0 5.5 KB
#7689 StartStopWithChild netcoreapp3.1 13.8μs 55.2ns 214ns 0 0 0 5.74 KB
#7689 StartStopWithChild net472 22.3μs 113ns 505ns 0.897 0.199 0 6.04 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 952μs 391ns 1.41μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 142ns 550ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 413ns 1.6μs 0 0 0 3.31 KB
#7689 WriteAndFlushEnrichedTraces net6.0 928μs 264ns 1.02μs 0 0 0 2.71 KB
#7689 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 338ns 1.31μs 0 0 0 2.7 KB
#7689 WriteAndFlushEnrichedTraces net472 1.18ms 180ns 696ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
master ObjectExtractorSimpleBody net6.0 340ns 0.246ns 0.919ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 396ns 2.18ns 11.9ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 308ns 0.17ns 0.658ns 0.0434 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.23μs 33.3ns 173ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 38.1ns 157ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.69μs 3.18ns 12.3ns 0.57 0 0 3.8 KB
#7689 AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7689 AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7689 AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7689 AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7689 AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7689 AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7689 ObjectExtractorSimpleBody net6.0 316ns 1.74ns 10.4ns 0 0 0 280 B
#7689 ObjectExtractorSimpleBody netcoreapp3.1 395ns 2.2ns 13ns 0 0 0 272 B
#7689 ObjectExtractorSimpleBody net472 297ns 0.0477ns 0.185ns 0.0433 0 0 281 B
#7689 ObjectExtractorMoreComplexBody net6.0 6.44μs 32.1ns 151ns 0 0 0 3.78 KB
#7689 ObjectExtractorMoreComplexBody netcoreapp3.1 7.79μs 3.92ns 15.2ns 0 0 0 3.69 KB
#7689 ObjectExtractorMoreComplexBody net472 6.67μs 5.32ns 20.6ns 0.601 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.9μs 106ns 409ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.8μs 295ns 1.14μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 22.8ns 88.4ns 4.89 0 0 32.51 KB
master EncodeLegacyArgs net6.0 144μs 13.8ns 53.4ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 202μs 340ns 1.27μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 264μs 45.6ns 176ns 0 0 0 2.16 KB
#7689 EncodeArgs net6.0 74.5μs 359ns 1.48μs 0 0 0 32.4 KB
#7689 EncodeArgs netcoreapp3.1 96.5μs 230ns 891ns 0 0 0 32.4 KB
#7689 EncodeArgs net472 110μs 16.2ns 60.7ns 4.95 0 0 32.51 KB
#7689 EncodeLegacyArgs net6.0 144μs 46.9ns 162ns 0 0 0 2.15 KB
#7689 EncodeLegacyArgs netcoreapp3.1 199μs 211ns 817ns 0 0 0 2.14 KB
#7689 EncodeLegacyArgs net472 261μs 64.1ns 231ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7689

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.496 297,095.98 741,431.25

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 393μs 217ns 840ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 415μs 96.2ns 347ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 427μs 27.3ns 98.4ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 283μs 35.1ns 131ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 225ns 870ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 310μs 30ns 116ns 0 0 0 2.29 KB
#7689 RunWafRealisticBenchmark net6.0 390μs 76.7ns 277ns 0 0 0 4.55 KB
#7689 RunWafRealisticBenchmark netcoreapp3.1 411μs 172ns 595ns 0 0 0 4.48 KB
#7689 RunWafRealisticBenchmark net472 426μs 30.4ns 109ns 0 0 0 4.66 KB
#7689 RunWafRealisticBenchmarkWithAttack net6.0 285μs 32.5ns 126ns 0 0 0 2.24 KB
#7689 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 672μs 14.8μs 148μs 0 0 0 2.22 KB
#7689 RunWafRealisticBenchmarkWithAttack net472 308μs 25.1ns 97.2ns 0 0 0 2.29 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 60.5μs 55.6ns 215ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.7μs 150ns 563ns 0 0 0 17.42 KB
master SendRequest net472 0.00267ns 0.00131ns 0.00506ns 0 0 0 0 b
#7689 SendRequest net6.0 61.3μs 315ns 1.51μs 0 0 0 14.52 KB
#7689 SendRequest netcoreapp3.1 71.6μs 130ns 468ns 0 0 0 17.42 KB
#7689 SendRequest net472 0.00628ns 0.00247ns 0.00958ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7689

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1.127 898,105.36 796,985.16

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1 B 4 B 3 B 300.00%

Fewer allocations 🎉 in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 6 B 0 b -6 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.89ms 919ns 3.44μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.12ms 7.88μs 30.5μs 0 0 0 640 KB
master OriginalCharSlice net472 2.55ms 190ns 713ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.38ms 243ns 940ns 0 0 0 4 B
master OptimizedCharSlice netcoreapp3.1 1.66ms 343ns 1.28μs 0 0 0 1 B
master OptimizedCharSlice net472 1.93ms 157ns 607ns 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 898μs 98.8ns 383ns 0 0 0 1 B
master OptimizedCharSliceWithPool netcoreapp3.1 811μs 166ns 621ns 0 0 0 6 B
master OptimizedCharSliceWithPool net472 1.15ms 114ns 440ns 0 0 0 0 b
#7689 OriginalCharSlice net6.0 1.89ms 5.84μs 21.9μs 0 0 0 640 KB
#7689 OriginalCharSlice netcoreapp3.1 2.14ms 9.84μs 38.1μs 0 0 0 640 KB
#7689 OriginalCharSlice net472 2.6ms 188ns 676ns 100 0 0 641.95 KB
#7689 OptimizedCharSlice net6.0 1.36ms 460ns 1.78μs 0 0 0 4 B
#7689 OptimizedCharSlice netcoreapp3.1 1.68ms 258ns 999ns 0 0 0 1 B
#7689 OptimizedCharSlice net472 1.93ms 1.13μs 4.39μs 0 0 0 0 b
#7689 OptimizedCharSliceWithPool net6.0 797μs 66.8ns 259ns 0 0 0 4 B
#7689 OptimizedCharSliceWithPool netcoreapp3.1 811μs 219ns 847ns 0 0 0 0 b
#7689 OptimizedCharSliceWithPool net472 1.13ms 85.9ns 333ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.24 KB 41.85 KB -396 B -0.94%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 742μs 2.01μs 7.79μs 0 0 0 41.64 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 726μs 1.04μs 4.04μs 0 0 0 42.24 KB
master WriteAndFlushEnrichedTraces net472 904μs 4.57μs 21μs 4.46 0 0 55.96 KB
#7689 WriteAndFlushEnrichedTraces net6.0 711μs 3.62μs 17.7μs 0 0 0 41.74 KB
#7689 WriteAndFlushEnrichedTraces netcoreapp3.1 776μs 6.66μs 66μs 0 0 0 41.85 KB
#7689 WriteAndFlushEnrichedTraces net472 836μs 2.69μs 10.1μs 8.33 0 0 56.01 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 1.95μs 0.533ns 1.99ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.6μs 1.89ns 6.81ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.91μs 3.49ns 13.5ns 0.143 0.0143 0 987 B
#7689 ExecuteNonQuery net6.0 1.83μs 8.49ns 32.9ns 0 0 0 1.02 KB
#7689 ExecuteNonQuery netcoreapp3.1 2.66μs 7.73ns 28.9ns 0 0 0 1.02 KB
#7689 ExecuteNonQuery net472 2.83μs 3.7ns 14.3ns 0.154 0.014 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.68μs 8.33ns 36.3ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.2μs 5.6ns 21.7ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.5μs 4.22ns 16.3ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.83μs 5.3ns 19.1ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.36μs 10.9ns 42.2ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.6μs 2.09ns 8.08ns 0.163 0 0 1.1 KB
#7689 CallElasticsearch net6.0 1.7μs 6.33ns 24.5ns 0 0 0 1.03 KB
#7689 CallElasticsearch netcoreapp3.1 2.19μs 10.8ns 46ns 0 0 0 1.03 KB
#7689 CallElasticsearch net472 3.5μs 1.67ns 6.45ns 0.157 0 0 1.04 KB
#7689 CallElasticsearchAsync net6.0 1.8μs 8.97ns 37ns 0 0 0 1.01 KB
#7689 CallElasticsearchAsync netcoreapp3.1 2.36μs 11.9ns 52ns 0 0 0 1.08 KB
#7689 CallElasticsearchAsync net472 3.84μs 2.2ns 8.24ns 0.172 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.88μs 8.97ns 35.9ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.44μs 5.09ns 19.7ns 0 0 0 952 B
master ExecuteAsync net472 2.63μs 2.23ns 8.63ns 0.143 0 0 915 B
#7689 ExecuteAsync net6.0 1.84μs 7.33ns 28.4ns 0 0 0 952 B
#7689 ExecuteAsync netcoreapp3.1 2.43μs 12.5ns 58.8ns 0 0 0 952 B
#7689 ExecuteAsync net472 2.58μs 0.896ns 3.47ns 0.142 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.86μs 6.71ns 26ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.72μs 26.2ns 102ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 7.61ns 28.5ns 0.487 0 0 3.18 KB
#7689 SendAsync net6.0 6.78μs 23.3ns 90.3ns 0 0 0 2.36 KB
#7689 SendAsync netcoreapp3.1 8.41μs 33.1ns 128ns 0 0 0 2.9 KB
#7689 SendAsync net472 12.4μs 11ns 42.7ns 0.49 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7689

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 2.951 1,546,250.00 524,000.00

More allocations ⚠️ in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 250.46 KB 259.72 KB 9.26 KB 3.70%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.78 KB 44.76 KB 984 B 2.25%

Fewer allocations 🎉 in #7689

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 42.92 KB 42.64 KB -280 B -0.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.02 KB 278.53 KB -7.49 KB -2.62%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 335.15 KB 279.62 KB -55.53 KB -16.57%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 41.7μs 209ns 886ns 0 0 0 43.78 KB
master StringConcatBenchmark netcoreapp3.1 47.8μs 164ns 658ns 0 0 0 42.92 KB
master StringConcatBenchmark net472 57μs 261ns 1.04μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 441μs 645ns 2.23μs 0 0 0 250.46 KB
master StringConcatAspectBenchmark netcoreapp3.1 1.55ms 2.22μs 8.32μs 0 0 0 335.15 KB
master StringConcatAspectBenchmark net472 411μs 2.06μs 8.72μs 0 0 0 286.02 KB
#7689 StringConcatBenchmark net6.0 50.2μs 766ns 7.55μs 0 0 0 44.76 KB
#7689 StringConcatBenchmark netcoreapp3.1 49.4μs 254ns 1.16μs 0 0 0 42.64 KB
#7689 StringConcatBenchmark net472 57.5μs 268ns 1μs 0 0 0 57.34 KB
#7689 StringConcatAspectBenchmark net6.0 450μs 1.02μs 3.66μs 0 0 0 259.72 KB
#7689 StringConcatAspectBenchmark netcoreapp3.1 527μs 2.57μs 11.2μs 0 0 0 279.62 KB
#7689 StringConcatAspectBenchmark net472 399μs 2.09μs 10.2μs 0 0 0 278.53 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.63μs 4.76ns 17.8ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.54μs 18.5ns 90.6ns 0 0 0 1.71 KB
master EnrichedLog net472 3.84μs 1.57ns 5.87ns 0.25 0 0 1.64 KB
#7689 EnrichedLog net6.0 2.67μs 12.7ns 50.7ns 0 0 0 1.7 KB
#7689 EnrichedLog netcoreapp3.1 3.58μs 16.8ns 67.3ns 0 0 0 1.7 KB
#7689 EnrichedLog net472 3.94μs 3.58ns 13.9ns 0.256 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 124μs 89.6ns 323ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 25.6ns 92.4ns 0 0 0 4.31 KB
master EnrichedLog net472 168μs 42.9ns 166ns 0 0 0 4.52 KB
#7689 EnrichedLog net6.0 124μs 77.5ns 268ns 0 0 0 4.31 KB
#7689 EnrichedLog netcoreapp3.1 128μs 180ns 697ns 0 0 0 4.31 KB
#7689 EnrichedLog net472 168μs 39.2ns 146ns 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 4.97μs 13.2ns 51ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.8μs 12.1ns 46.8ns 0 0 0 2.26 KB
master EnrichedLog net472 7.7μs 8.85ns 34.3ns 0.307 0 0 2.08 KB
#7689 EnrichedLog net6.0 5.24μs 1.77ns 6.85ns 0 0 0 2.26 KB
#7689 EnrichedLog netcoreapp3.1 7.2μs 28ns 108ns 0 0 0 2.26 KB
#7689 EnrichedLog net472 7.6μs 4.55ns 17.6ns 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 0.971ns 3.5ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.69μs 1.35ns 5.25ns 0 0 0 1.2 KB
master SendReceive net472 3.18μs 2.59ns 10ns 0.19 0 0 1.2 KB
#7689 SendReceive net6.0 2μs 10ns 42.6ns 0 0 0 1.2 KB
#7689 SendReceive netcoreapp3.1 2.56μs 9.79ns 37.9ns 0 0 0 1.2 KB
#7689 SendReceive net472 3.07μs 0.586ns 2.19ns 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.4μs 14.9ns 57.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.73μs 19.8ns 76.5ns 0 0 0 1.63 KB
master EnrichedLog net472 6.71μs 5.97ns 22.3ns 0.299 0 0 2.03 KB
#7689 EnrichedLog net6.0 4.37μs 3.3ns 11.9ns 0 0 0 1.58 KB
#7689 EnrichedLog netcoreapp3.1 5.67μs 8.95ns 33.5ns 0 0 0 1.63 KB
#7689 EnrichedLog net472 6.56μs 10.3ns 40ns 0.293 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 790ns 0.365ns 1.41ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 981ns 5.14ns 26.2ns 0 0 0 576 B
master StartFinishSpan net472 920ns 0.55ns 2.06ns 0.0882 0 0 578 B
master StartFinishScope net6.0 912ns 3.36ns 12.6ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.17μs 6.25ns 31.3ns 0 0 0 696 B
master StartFinishScope net472 1.16μs 1.07ns 4.14ns 0.105 0 0 658 B
#7689 StartFinishSpan net6.0 764ns 3.7ns 16.1ns 0 0 0 576 B
#7689 StartFinishSpan netcoreapp3.1 948ns 4.6ns 23ns 0 0 0 576 B
#7689 StartFinishSpan net472 953ns 0.65ns 2.52ns 0.0872 0 0 578 B
#7689 StartFinishScope net6.0 926ns 0.201ns 0.778ns 0 0 0 696 B
#7689 StartFinishScope netcoreapp3.1 1.14μs 5.78ns 27.1ns 0 0 0 696 B
#7689 StartFinishScope net472 1.17μs 0.39ns 1.41ns 0.1 0 0 658 B
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.06μs 5.42ns 26.5ns 0 0 0 697 B
master RunOnMethodBegin netcoreapp3.1 1.41μs 7.25ns 34.8ns 0 0 0 696 B
master RunOnMethodBegin net472 1.43μs 0.56ns 2.1ns 0.1 0 0 658 B
#7689 RunOnMethodBegin net6.0 1.05μs 5.37ns 25.2ns 0 0 0 696 B
#7689 RunOnMethodBegin netcoreapp3.1 1.4μs 7ns 30.5ns 0 0 0 696 B
#7689 RunOnMethodBegin net472 1.45μs 0.839ns 3.25ns 0.101 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 the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (75ms)  : 73, 78
     .   : milestone, 75,
    master - mean (75ms)  : 74, 77
     .   : milestone, 75,

    section Baseline
    This PR (7689) - mean (71ms)  : 69, 73
     .   : milestone, 71,
    master - mean (71ms)  : 68, 75
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (1,086ms)  : 1012, 1160
     .   : milestone, 1086,
    master - mean (1,072ms)  : 992, 1152
     .   : milestone, 1072,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (112ms)  : 109, 115
     .   : milestone, 112,
    master - mean (110ms)  : 108, 112
     .   : milestone, 110,

    section Baseline
    This PR (7689) - mean (110ms)  : 107, 113
     .   : milestone, 110,
    master - mean (110ms)  : 107, 112
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (781ms)  : 741, 821
     .   : milestone, 781,
    master - mean (761ms)  : 733, 788
     .   : milestone, 761,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (99ms)  : 97, 101
     .   : milestone, 99,
    master - mean (98ms)  : 96, 100
     .   : milestone, 98,

    section Baseline
    This PR (7689) - mean (98ms)  : 95, 100
     .   : milestone, 98,
    master - mean (97ms)  : 94, 101
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (738ms)  : 686, 791
     .   : milestone, 738,
    master - mean (729ms)  : 671, 788
     .   : milestone, 729,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (98ms)  : 95, 100
     .   : milestone, 98,
    master - mean (98ms)  : 95, 100
     .   : milestone, 98,

    section Baseline
    This PR (7689) - mean (97ms)  : 95, 100
     .   : milestone, 97,
    master - mean (97ms)  : 94, 99
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (678ms)  : 658, 697
     .   : milestone, 678,
    master - mean (679ms)  : 661, 698
     .   : milestone, 679,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (198ms)  : 194, 201
     .   : milestone, 198,
    master - mean (196ms)  : 193, 199
     .   : milestone, 196,

    section Baseline
    This PR (7689) - mean (194ms)  : 189, 198
     .   : milestone, 194,
    master - mean (193ms)  : 189, 197
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (1,203ms)  : 1123, 1282
     .   : milestone, 1203,
    master - mean (1,164ms)  : 1108, 1219
     .   : milestone, 1164,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (281ms)  : 275, 286
     .   : milestone, 281,
    master - mean (278ms)  : 273, 283
     .   : milestone, 278,

    section Baseline
    This PR (7689) - mean (281ms)  : 275, 288
     .   : milestone, 281,
    master - mean (276ms)  : 271, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (968ms)  : 915, 1021
     .   : milestone, 968,
    master - mean (944ms)  : 905, 982
     .   : milestone, 944,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (274ms)  : 266, 282
     .   : milestone, 274,
    master - mean (270ms)  : 266, 274
     .   : milestone, 270,

    section Baseline
    This PR (7689) - mean (274ms)  : 266, 283
     .   : milestone, 274,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (950ms)  : 899, 1001
     .   : milestone, 950,
    master - mean (926ms)  : 881, 971
     .   : milestone, 926,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7689) - mean (274ms)  : 269, 278
     .   : milestone, 274,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

    section Baseline
    This PR (7689) - mean (274ms)  : 266, 282
     .   : milestone, 274,
    master - mean (269ms)  : 265, 273
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (7689) - mean (867ms)  : 842, 891
     .   : milestone, 867,
    master - mean (857ms)  : 836, 878
     .   : milestone, 857,

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 49e2acf to 51a880e Compare October 22, 2025 21:31
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 071fbd4 to 0a751b8 Compare October 22, 2025 21:31
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Oct 22, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

IpcClientTest from Datadog.Trace.Tests.Ci.Ipc.IpcTests (Datadog)
Expected finalValue.ClientValue to be 20, but found 19 (difference of -1).

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 59b8625 | Docs | Was this helpful? Give us feedback!

@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 0a751b8 to f5dd040 Compare October 22, 2025 22:22
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 51a880e to bc30cd6 Compare October 22, 2025 22:48
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from f5dd040 to df4a547 Compare October 22, 2025 22:48
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from bc30cd6 to c57648c Compare October 23, 2025 10:19
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from df4a547 to 45fc601 Compare October 23, 2025 10:20
@anna-git anna-git changed the title [ConfigRegistry] Analyzers for platform and ConfigurationBuilder [ConfigRegistry] Aliases handling and analyzers to prevent using any string key Oct 23, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from c57648c to f88de4c Compare October 23, 2025 11:00
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 45fc601 to 556354c Compare October 23, 2025 11:01
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from f88de4c to 2133185 Compare October 23, 2025 11:40
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 556354c to d74bc6d Compare October 23, 2025 11:40
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 2133185 to 13488c5 Compare October 23, 2025 12:16
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch 2 times, most recently from 4eeaecd to a471afd Compare October 23, 2025 12:31
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 13488c5 to a31063c Compare October 23, 2025 13:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from a471afd to 98f03b8 Compare October 23, 2025 13:26
@anna-git anna-git changed the title [ConfigRegistry] Aliases handling and analyzers to prevent using any string key [ConfigRegistry] 4/5 Aliases handling and analyzers to prevent using any string key Oct 23, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-analyzers-4 branch from 98f03b8 to 59b8625 Compare October 23, 2025 16:07
@anna-git anna-git marked this pull request as ready for review October 24, 2025 10:26
@lucaspimentel
Copy link
Member

@codex review

Copy link

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

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.

ℹ️ 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 on lines +22 to +39
public HasKeys WithIntegrationKey(string integrationName) => new(
_source,
_telemetry,
string.Format(IntegrationSettings.IntegrationEnabledKey, integrationName.ToUpperInvariant()),
[
string.Format(IntegrationSettings.IntegrationEnabledKey, integrationName),
$"DD_{integrationName}_ENABLED"
]);

public HasKeys WithIntegrationAnalyticsKey(string integrationName) => new(
_source,
_telemetry,
#pragma warning disable 618 // App analytics is deprecated, but still used
string.Format(IntegrationSettings.AnalyticsEnabledKey, integrationName.ToUpperInvariant()),
[
string.Format(IntegrationSettings.AnalyticsEnabledKey, integrationName),
#pragma warning restore 618
$"DD_{integrationName}_ANALYTICS_ENABLED"

Choose a reason for hiding this comment

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

P1 Badge Uppercase integration aliases to preserve DD_ compatibility*

The new integration helpers build alias keys using the raw integrationName string (string.Format(..., integrationName) and "DD_{integrationName}_ENABLED"). For most integrations that value is mixed‑case (e.g., Kafka, AspNetCore). On Linux and other case‑sensitive configuration sources, these aliases will no longer match the documented uppercase aliases such as DD_KAFKA_ENABLED or DD_ASPNETCORE_ENABLED, so existing deployments relying on the legacy keys will stop working. The main key still resolves because it’s uppercased, but the alias is effectively broken. Consider uppercasing the alias strings (integrationName.ToUpperInvariant()) so the fallback works regardless of platform casing.

Useful? React with 👍 / 👎.

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.

2 participants