Skip to content

Conversation

@anna-git
Copy link
Contributor

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

Context

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

  1. #7548 - Add GitLab step and JSON configuration file
  2. #7688 - [Config registry] Reorganize keys, split config keys and platform keys(this PR)
  3. #7698 - Generate ConfigurationKeys with source generator
  4. #7689 - Aliases handling and analyzers
  5. #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 with XML documentation for automated doc generation

@anna-git anna-git changed the title Anna/config inversion configuration keys rework 2 [Config registry] Cleanup configuration keys constants, and check them against local json file Oct 21, 2025
@anna-git anna-git changed the title [Config registry] Cleanup configuration keys constants, and check them against local json file [Config registry] Cleanup configuration / platform keys + source generator Oct 21, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from 8232d48 to d72f4ac Compare October 21, 2025 16:41
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 869594a to f45278f Compare October 22, 2025 17:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from d72f4ac to f242046 Compare October 22, 2025 17:26
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from f45278f to d40a9fb Compare October 22, 2025 18:14
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch 2 times, most recently from 153e7b3 to 9501463 Compare October 22, 2025 18:27
@pr-commenter
Copy link

pr-commenter bot commented Oct 22, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7688 compared to master:

  • 1 benchmarks are slower, with geometric mean 2.452
  • 9 benchmarks have fewer allocations
  • 3 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 ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7688

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.07 KB 6.01 KB -55 B -0.91%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.6μs 55.3ns 271ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 14μs 58.6ns 227ns 0 0 0 5.71 KB
master StartStopWithChild net472 22μs 101ns 392ns 0.858 0.214 0 6.07 KB
#7688 StartStopWithChild net6.0 10.9μs 61ns 405ns 0 0 0 5.51 KB
#7688 StartStopWithChild netcoreapp3.1 14.3μs 34.1ns 132ns 0 0 0 5.71 KB
#7688 StartStopWithChild net472 22μs 116ns 637ns 0.99 0.44 0.11 6.01 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 930μs 71.2ns 266ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 365ns 1.42μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 1.22μs 4.74μs 0 0 0 3.31 KB
#7688 WriteAndFlushEnrichedTraces net6.0 927μs 281ns 1.09μs 0 0 0 2.71 KB
#7688 WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 681ns 2.55μs 0 0 0 2.7 KB
#7688 WriteAndFlushEnrichedTraces net472 1.2ms 128ns 497ns 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 316ns 1.8ns 12.7ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 400ns 2.15ns 11.4ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 299ns 0.0591ns 0.229ns 0.0437 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.28μs 28.9ns 112ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.67μs 35.4ns 146ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.76μs 7.11ns 27.5ns 0.571 0 0 3.8 KB
#7688 AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7688 AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7688 AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7688 AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7688 AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7688 AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7688 ObjectExtractorSimpleBody net6.0 324ns 1.74ns 9.38ns 0 0 0 280 B
#7688 ObjectExtractorSimpleBody netcoreapp3.1 405ns 1.98ns 8.16ns 0 0 0 272 B
#7688 ObjectExtractorSimpleBody net472 304ns 0.0331ns 0.128ns 0.0445 0 0 281 B
#7688 ObjectExtractorMoreComplexBody net6.0 6.31μs 2.86ns 11.1ns 0 0 0 3.78 KB
#7688 ObjectExtractorMoreComplexBody netcoreapp3.1 7.74μs 39.2ns 171ns 0 0 0 3.69 KB
#7688 ObjectExtractorMoreComplexBody net472 6.72μs 2.16ns 8.35ns 0.571 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.3μs 180ns 697ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.7μs 131ns 507ns 0 0 0 32.4 KB
master EncodeArgs net472 109μs 9.68ns 37.5ns 4.91 0 0 32.51 KB
master EncodeLegacyArgs net6.0 145μs 20.7ns 74.5ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 249ns 964ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 57.3ns 214ns 0 0 0 2.16 KB
#7688 EncodeArgs net6.0 77.2μs 232ns 869ns 0 0 0 32.4 KB
#7688 EncodeArgs netcoreapp3.1 97.4μs 40.1ns 155ns 0 0 0 32.4 KB
#7688 EncodeArgs net472 108μs 77.9ns 302ns 4.9 0 0 32.51 KB
#7688 EncodeLegacyArgs net6.0 145μs 336ns 1.3μs 0 0 0 2.14 KB
#7688 EncodeLegacyArgs netcoreapp3.1 196μs 225ns 871ns 0 0 0 2.14 KB
#7688 EncodeLegacyArgs net472 262μs 18.1ns 65.2ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7688

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.452 296,938.72 728,209.98

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 395μs 67.9ns 254ns 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 412μs 84.6ns 305ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 425μs 49.2ns 190ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 285μs 58.1ns 218ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 297μs 193ns 723ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 309μs 38.7ns 150ns 0 0 0 2.29 KB
#7688 RunWafRealisticBenchmark net6.0 394μs 115ns 447ns 0 0 0 4.55 KB
#7688 RunWafRealisticBenchmark netcoreapp3.1 414μs 366ns 1.42μs 0 0 0 4.48 KB
#7688 RunWafRealisticBenchmark net472 429μs 43.6ns 169ns 0 0 0 4.66 KB
#7688 RunWafRealisticBenchmarkWithAttack net6.0 293μs 44.3ns 171ns 0 0 0 2.24 KB
#7688 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 644μs 14.5μs 145μs 0 0 0 2.22 KB
#7688 RunWafRealisticBenchmarkWithAttack net472 310μs 29ns 108ns 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 61.3μs 61.4ns 238ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 70.9μs 186ns 672ns 0 0 0 17.42 KB
master SendRequest net472 3.56E‑05ns 3.56E‑05ns 0.000138ns 0 0 0 0 b
#7688 SendRequest net6.0 61.7μs 57.9ns 224ns 0 0 0 14.52 KB
#7688 SendRequest netcoreapp3.1 73μs 69.3ns 268ns 0 0 0 17.42 KB
#7688 SendRequest net472 0.0014ns 0.000976ns 0.00365ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7688

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 7 B 5 B -2 B -28.57%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 5 B 2 B -3 B -60.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 73 B 0 b -73 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 6 B 0 b -6 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 0 b -47 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.91ms 1.12μs 4.04μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.17ms 8.08μs 30.2μs 0 0 0 640 KB
master OriginalCharSlice net472 2.57ms 107ns 401ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.35ms 247ns 956ns 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.7ms 385ns 1.49μs 0 0 0 1 B
master OptimizedCharSlice net472 1.93ms 433ns 1.68μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 836μs 41.6ns 156ns 0 0 0 5 B
master OptimizedCharSliceWithPool netcoreapp3.1 855μs 148ns 573ns 0 0 0 6 B
master OptimizedCharSliceWithPool net472 1.16ms 140ns 504ns 0 0 0 47 B
#7688 OriginalCharSlice net6.0 1.92ms 3.9μs 14.6μs 0 0 0 640.01 KB
#7688 OriginalCharSlice netcoreapp3.1 2.09ms 7.8μs 30.2μs 0 0 0 640 KB
#7688 OriginalCharSlice net472 2.73ms 471ns 1.83μs 100 0 0 641.95 KB
#7688 OptimizedCharSlice net6.0 1.4ms 164ns 613ns 0 0 0 5 B
#7688 OptimizedCharSlice netcoreapp3.1 1.72ms 340ns 1.32μs 0 0 0 1 B
#7688 OptimizedCharSlice net472 1.92ms 256ns 957ns 0 0 0 0 b
#7688 OptimizedCharSliceWithPool net6.0 848μs 38.4ns 144ns 0 0 0 2 B
#7688 OptimizedCharSliceWithPool netcoreapp3.1 851μs 227ns 881ns 0 0 0 0 b
#7688 OptimizedCharSliceWithPool net472 1.15ms 102ns 395ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 753μs 2.32μs 9μs 0 0 0 41.89 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 719μs 2.26μs 8.47μs 0 0 0 41.75 KB
master WriteAndFlushEnrichedTraces net472 907μs 2.35μs 8.8μs 4.46 0 0 55.66 KB
#7688 WriteAndFlushEnrichedTraces net6.0 707μs 781ns 3.03μs 0 0 0 41.73 KB
#7688 WriteAndFlushEnrichedTraces netcoreapp3.1 664μs 1.77μs 6.63μs 0 0 0 41.94 KB
#7688 WriteAndFlushEnrichedTraces net472 905μs 2.46μs 9.22μs 8.33 0 0 55.54 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.97μs 5.96ns 23.1ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.61μs 7.33ns 28.4ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.76μs 3.59ns 13.9ns 0.151 0.0137 0 987 B
#7688 ExecuteNonQuery net6.0 1.95μs 4.51ns 17.5ns 0 0 0 1.02 KB
#7688 ExecuteNonQuery netcoreapp3.1 2.63μs 3.86ns 14.9ns 0 0 0 1.02 KB
#7688 ExecuteNonQuery net472 2.85μs 3.68ns 14.2ns 0.156 0.0142 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.69μs 7.66ns 28.7ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.19μs 7.77ns 30.1ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.55μs 1.98ns 7.4ns 0.161 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.94μs 1.98ns 7.4ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.44μs 11ns 42.5ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.62μs 2.47ns 9.25ns 0.163 0 0 1.1 KB
#7688 CallElasticsearch net6.0 1.75μs 9.28ns 46.4ns 0 0 0 1.03 KB
#7688 CallElasticsearch netcoreapp3.1 2.26μs 6.3ns 24.4ns 0 0 0 1.03 KB
#7688 CallElasticsearch net472 3.57μs 1.77ns 6.85ns 0.16 0 0 1.04 KB
#7688 CallElasticsearchAsync net6.0 1.85μs 1.37ns 5.31ns 0 0 0 1.01 KB
#7688 CallElasticsearchAsync netcoreapp3.1 2.34μs 0.534ns 2ns 0 0 0 1.08 KB
#7688 CallElasticsearchAsync net472 3.65μs 3.09ns 12ns 0.163 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 2.04μs 6.49ns 25.1ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.47μs 9.32ns 36.1ns 0 0 0 952 B
master ExecuteAsync net472 2.68μs 1.49ns 5.77ns 0.134 0 0 915 B
#7688 ExecuteAsync net6.0 1.92μs 4.78ns 18.5ns 0 0 0 952 B
#7688 ExecuteAsync netcoreapp3.1 2.41μs 5.07ns 19ns 0 0 0 952 B
#7688 ExecuteAsync net472 2.63μs 0.656ns 2.54ns 0.145 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.83μs 17.1ns 64.1ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.79μs 13.8ns 53.3ns 0 0 0 2.9 KB
master SendAsync net472 12.3μs 9.71ns 37.6ns 0.493 0 0 3.18 KB
#7688 SendAsync net6.0 7.13μs 8.42ns 30.4ns 0 0 0 2.36 KB
#7688 SendAsync netcoreapp3.1 8.4μs 18ns 69.8ns 0 0 0 2.9 KB
#7688 SendAsync net472 12.4μs 12ns 46.5ns 0.493 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7688

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 256.02 KB 276.79 KB 20.77 KB 8.11%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 254.53 KB 273.01 KB 18.48 KB 7.26%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 42.64 KB 45.49 KB 2.85 KB 6.68%

Fewer allocations 🎉 in #7688

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.5 KB 43.54 KB -968 B -2.18%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.72 KB 278.53 KB -8.19 KB -2.86%
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 43.9μs 180ns 721ns 0 0 0 44.5 KB
master StringConcatBenchmark netcoreapp3.1 46.8μs 217ns 813ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 56.3μs 260ns 974ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 449μs 1.56μs 5.83μs 0 0 0 256.02 KB
master StringConcatAspectBenchmark netcoreapp3.1 485μs 1.22μs 4.4μs 0 0 0 254.53 KB
master StringConcatAspectBenchmark net472 399μs 1.76μs 6.57μs 0 0 0 286.72 KB
#7688 StringConcatBenchmark net6.0 42.4μs 174ns 603ns 0 0 0 43.54 KB
#7688 StringConcatBenchmark netcoreapp3.1 49.6μs 335ns 3.2μs 0 0 0 45.49 KB
#7688 StringConcatBenchmark net472 58.3μs 295ns 1.32μs 0 0 0 57.34 KB
#7688 StringConcatAspectBenchmark net6.0 475μs 1.98μs 6.86μs 0 0 0 276.79 KB
#7688 StringConcatAspectBenchmark netcoreapp3.1 520μs 1.87μs 6.99μs 0 0 0 273.01 KB
#7688 StringConcatAspectBenchmark net472 405μs 2.11μs 10.3μ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.61μs 1.08ns 4.17ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.6μs 14.9ns 57.9ns 0 0 0 1.7 KB
master EnrichedLog net472 3.9μs 2.82ns 10.9ns 0.254 0 0 1.64 KB
#7688 EnrichedLog net6.0 2.62μs 1.93ns 7.48ns 0 0 0 1.7 KB
#7688 EnrichedLog netcoreapp3.1 3.67μs 2.78ns 10.8ns 0 0 0 1.7 KB
#7688 EnrichedLog net472 3.92μs 1.87ns 7.24ns 0.257 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 123μs 22.8ns 82.4ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 127μs 49.5ns 185ns 0 0 0 4.31 KB
master EnrichedLog net472 167μs 119ns 462ns 0 0 0 4.51 KB
#7688 EnrichedLog net6.0 123μs 49.6ns 192ns 0 0 0 4.31 KB
#7688 EnrichedLog netcoreapp3.1 128μs 227ns 819ns 0 0 0 4.31 KB
#7688 EnrichedLog net472 166μs 24.7ns 92.3ns 0 0 0 4.51 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.93μs 8ns 29.9ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.73μs 17.9ns 69.4ns 0 0 0 2.26 KB
master EnrichedLog net472 7.75μs 6.16ns 23.8ns 0.31 0 0 2.08 KB
#7688 EnrichedLog net6.0 4.96μs 22ns 79.4ns 0 0 0 2.26 KB
#7688 EnrichedLog netcoreapp3.1 6.87μs 6.04ns 23.4ns 0 0 0 2.26 KB
#7688 EnrichedLog net472 7.68μs 7.31ns 28.3ns 0.307 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 1.98μs 9.85ns 40.6ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.75μs 3.7ns 13.3ns 0 0 0 1.2 KB
master SendReceive net472 3.14μs 3.69ns 14.3ns 0.188 0 0 1.2 KB
#7688 SendReceive net6.0 1.94μs 9.65ns 36.1ns 0 0 0 1.2 KB
#7688 SendReceive netcoreapp3.1 2.54μs 6.77ns 26.2ns 0 0 0 1.2 KB
#7688 SendReceive net472 3.1μs 3.1ns 12ns 0.185 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 4.28ns 16.6ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.65μs 14.1ns 54.6ns 0 0 0 1.63 KB
master EnrichedLog net472 6.59μs 5.55ns 21.5ns 0.295 0 0 2.03 KB
#7688 EnrichedLog net6.0 4.26μs 20.9ns 86.2ns 0 0 0 1.58 KB
#7688 EnrichedLog netcoreapp3.1 5.6μs 8.05ns 30.1ns 0 0 0 1.63 KB
#7688 EnrichedLog net472 6.93μs 5.92ns 22.9ns 0.31 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 782ns 0.563ns 2.11ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 968ns 0.489ns 1.83ns 0 0 0 576 B
master StartFinishSpan net472 936ns 0.436ns 1.69ns 0.0889 0 0 578 B
master StartFinishScope net6.0 901ns 4.66ns 22.3ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.18μs 5.98ns 27.4ns 0 0 0 696 B
master StartFinishScope net472 1.15μs 0.298ns 1.15ns 0.104 0 0 658 B
#7688 StartFinishSpan net6.0 772ns 3.93ns 18.4ns 0 0 0 576 B
#7688 StartFinishSpan netcoreapp3.1 948ns 4.84ns 21.1ns 0 0 0 576 B
#7688 StartFinishSpan net472 916ns 0.422ns 1.58ns 0.0917 0 0 578 B
#7688 StartFinishScope net6.0 942ns 0.695ns 2.69ns 0 0 0 696 B
#7688 StartFinishScope netcoreapp3.1 1.17μs 5.57ns 22.3ns 0 0 0 696 B
#7688 StartFinishScope net472 1.12μs 0.0865ns 0.312ns 0.102 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.04μs 5.62ns 28.6ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.4μs 5.97ns 23.1ns 0 0 0 696 B
master RunOnMethodBegin net472 1.48μs 1.17ns 4.04ns 0.103 0 0 658 B
#7688 RunOnMethodBegin net6.0 1.07μs 5.72ns 26.8ns 0 0 0 696 B
#7688 RunOnMethodBegin netcoreapp3.1 1.44μs 4.38ns 17ns 0 0 0 696 B
#7688 RunOnMethodBegin net472 1.46μs 0.858ns 3.32ns 0.102 0 0 658 B

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

dd-trace-dotnet-ci-bot bot commented Oct 22, 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 (7688) - mean (76ms)  : 74, 77
     .   : milestone, 76,
    master - mean (75ms)  : 74, 77
     .   : milestone, 75,

    section Baseline
    This PR (7688) - mean (72ms)  : 70, 74
     .   : milestone, 72,
    master - mean (71ms)  : 68, 75
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (1,064ms)  : 1002, 1126
     .   : milestone, 1064,
    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 (7688) - mean (112ms)  : 107, 117
     .   : milestone, 112,
    master - mean (110ms)  : 108, 112
     .   : milestone, 110,

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

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (761ms)  : 728, 793
     .   : milestone, 761,
    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 (7688) - mean (99ms)  : 96, 101
     .   : milestone, 99,
    master - mean (98ms)  : 96, 100
     .   : milestone, 98,

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

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (730ms)  : 666, 795
     .   : milestone, 730,
    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 (7688) - mean (97ms)  : 95, 100
     .   : milestone, 97,
    master - mean (98ms)  : 95, 100
     .   : milestone, 98,

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

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (676ms)  : 659, 694
     .   : milestone, 676,
    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 (7688) - mean (199ms)  : 192, 205
     .   : milestone, 199,
    master - mean (196ms)  : 193, 199
     .   : milestone, 196,

    section Baseline
    This PR (7688) - mean (195ms)  : 187, 202
     .   : milestone, 195,
    master - mean (193ms)  : 189, 197
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (1,177ms)  : 1115, 1240
     .   : milestone, 1177,
    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 (7688) - mean (279ms)  : 274, 284
     .   : milestone, 279,
    master - mean (278ms)  : 273, 283
     .   : milestone, 278,

    section Baseline
    This PR (7688) - mean (280ms)  : 274, 285
     .   : milestone, 280,
    master - mean (276ms)  : 271, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (946ms)  : 910, 983
     .   : milestone, 946,
    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 (7688) - mean (271ms)  : 267, 276
     .   : milestone, 271,
    master - mean (270ms)  : 266, 274
     .   : milestone, 270,

    section Baseline
    This PR (7688) - mean (272ms)  : 265, 278
     .   : milestone, 272,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (935ms)  : 880, 990
     .   : milestone, 935,
    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 (7688) - mean (271ms)  : 266, 275
     .   : milestone, 271,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

    section Baseline
    This PR (7688) - mean (271ms)  : 266, 276
     .   : milestone, 271,
    master - mean (269ms)  : 265, 273
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (7688) - mean (856ms)  : 831, 880
     .   : milestone, 856,
    master - mean (857ms)  : 836, 878
     .   : milestone, 857,

Loading

@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from d40a9fb to 26d4bf8 Compare October 22, 2025 20:12
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from 9501463 to 25e86cb Compare October 22, 2025 20:12
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 26d4bf8 to 4b53dd1 Compare October 22, 2025 21:25
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from 25e86cb to f3c200d Compare October 22, 2025 21:25
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 4b53dd1 to 70e632e Compare October 22, 2025 21:31
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from f3c200d to 75c1854 Compare October 22, 2025 21:31
@anna-git anna-git changed the title [Config registry] Cleanup configuration / platform keys + source generator [Config registry] Reorganize keys, sSplit config keys and platform keys Oct 23, 2025
@anna-git anna-git changed the title [Config registry] Reorganize keys, sSplit config keys and platform keys [Config registry] Reorganize keys, split config keys and platform keys Oct 23, 2025
@anna-git anna-git marked this pull request as ready for review October 23, 2025 10:05
@anna-git anna-git requested review from a team as code owners October 23, 2025 10:05
@anna-git anna-git requested review from a team as code owners October 23, 2025 10:05
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 70e632e to d88e3da Compare October 23, 2025 13:26
@anna-git anna-git force-pushed the anna/config-inversion-configuration-keys-rework-2 branch from 75c1854 to 631521a Compare October 23, 2025 13:26
@anna-git anna-git changed the title [Config registry] Reorganize keys, split config keys and platform keys [Config registry] 2/5 Reorganize keys, split config keys and platform keys Oct 23, 2025
@lucaspimentel
Copy link
Member

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

public const string ProfilingEnabled = "DD_PROFILING_ENABLED";
public const string CodeHotspotsEnabled = "DD_PROFILING_CODEHOTSPOTS_ENABLED";
public const string EndpointProfilingEnabled = "DD_PROFILING_ENDPOINT_COLLECTION_ENABLED";
public const string SsiDeployed = "DD_INJECTION_ENABLED";
Copy link
Member

Choose a reason for hiding this comment

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

IS DD_INJECTION_ENABLED a Profiler setting?


internal static partial class PlatformKeys
{
internal class Aws
Copy link
Member

Choose a reason for hiding this comment

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

This can also be a static class?


internal static partial class PlatformKeys
{
internal class AzureAppService
Copy link
Member

Choose a reason for hiding this comment

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

This can also be static?

/// <summary>
/// The instance name in Azure where the traced application is running.
/// </summary>
internal const string InstanceNameKey = "COMPUTERNAME";
Copy link
Member

Choose a reason for hiding this comment

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

COMPUTERNAME is a funny one because it's really a Windows env var, not specific to Azure App Services 😅 but this is fine.

/// <summary>
/// Platform key indicating the path to the .net core clr profiler
/// </summary>
public const string DotNetCoreClrProfiler = "CORECLR_PROFILER_PATH";
Copy link
Member

Choose a reason for hiding this comment

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

We can improve the comments and property names. Maybe something like

/// Platform key indicating the path to the .NET Core CLR profiler path
DotNetCoreClrProfilerPath     (add "Path")

/// Platform key indicating the path to the .NET Framework CLR profiler path
DotNetFrameworkClrPofilerPath (add "Path" and "Framework")

Also, should we nest these under a class like the others? PlatformKeys.DotNet.*?

/// Used to identify consumption plan functions. Consumption plans will either not have this variable,
/// or will have a value of "dynamic".
/// </summary>
public const string WebsiteSKU = "WEBSITE_SKU";
Copy link
Member

Choose a reason for hiding this comment

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

While you're in here, can you rename this property to WebsiteSku to follow .NET naming conventions?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants