-
Notifications
You must be signed in to change notification settings - Fork 150
[Config Registry] 5/7 Replace manual ConfigurationKeys by generated ones in the whole solution #7931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Config Registry] 5/7 Replace manual ConfigurationKeys by generated ones in the whole solution #7931
Conversation
This comment has been minimized.
This comment has been minimized.
d18480f to
c04dbe5
Compare
95b0301 to
39a7db5
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7931 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 5.92 KB | 6 KB | 80 B | 1.35% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 11.2μs | 43.8ns | 169ns | 0 | 0 | 0 | 5.49 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.5μs | 71.2ns | 356ns | 0 | 0 | 0 | 5.71 KB |
| master | StartStopWithChild |
net472 | 22.3μs | 124ns | 756ns | 0.97 | 0.323 | 0.108 | 5.92 KB |
| #7931 | StartStopWithChild |
net6.0 | 10.7μs | 58.7ns | 342ns | 0 | 0 | 0 | 5.49 KB |
| #7931 | StartStopWithChild |
netcoreapp3.1 | 13.9μs | 72.6ns | 348ns | 0 | 0 | 0 | 5.7 KB |
| #7931 | StartStopWithChild |
net472 | 22.1μs | 109ns | 486ns | 0.985 | 0.328 | 0.109 | 6 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 | 1.29ms | 381ns | 1.47μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.38ms | 368ns | 1.42μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.74ms | 2.76μs | 10.7μs | 0 | 0 | 0 | 3.26 KB |
| #7931 | WriteAndFlushEnrichedTraces |
net6.0 | 1.25ms | 77.6ns | 290ns | 0 | 0 | 0 | 2.7 KB |
| #7931 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.4ms | 109ns | 407ns | 0 | 0 | 0 | 2.7 KB |
| #7931 | WriteAndFlushEnrichedTraces |
net472 | 1.69ms | 166ns | 599ns | 0 | 0 | 0 | 3.26 KB |
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 | 6.11ns | 41.4ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.38μs | 7.72ns | 48.8ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.01μs | 0.769ns | 2.98ns | 0.191 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.41μs | 33.4ns | 129ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 8.87μs | 47.1ns | 231ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 8.36μs | 13.5ns | 50.7ns | 0.752 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 333ns | 0.197ns | 0.765ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 392ns | 2.13ns | 12ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 309ns | 0.0176ns | 0.0682ns | 0.0436 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.52μs | 33.9ns | 163ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.82μs | 38.1ns | 157ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.69μs | 1.42ns | 5.48ns | 0.572 | 0 | 0 | 3.8 KB |
| #7931 | AllCycleSimpleBody |
net6.0 | 1.09μs | 1.08ns | 4.2ns | 0 | 0 | 0 | 1.22 KB |
| #7931 | AllCycleSimpleBody |
netcoreapp3.1 | 1.41μs | 7.88ns | 53.4ns | 0 | 0 | 0 | 1.2 KB |
| #7931 | AllCycleSimpleBody |
net472 | 1.11μs | 0.702ns | 2.63ns | 0.194 | 0 | 0 | 1.23 KB |
| #7931 | AllCycleMoreComplexBody |
net6.0 | 7.41μs | 1.59ns | 5.5ns | 0 | 0 | 0 | 4.72 KB |
| #7931 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.09μs | 42.6ns | 170ns | 0 | 0 | 0 | 4.62 KB |
| #7931 | AllCycleMoreComplexBody |
net472 | 7.68μs | 2.76ns | 10.7ns | 0.73 | 0 | 0 | 4.74 KB |
| #7931 | ObjectExtractorSimpleBody |
net6.0 | 329ns | 1.63ns | 7.31ns | 0 | 0 | 0 | 280 B |
| #7931 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 399ns | 2.21ns | 14ns | 0 | 0 | 0 | 272 B |
| #7931 | ObjectExtractorSimpleBody |
net472 | 301ns | 0.0825ns | 0.32ns | 0.044 | 0 | 0 | 281 B |
| #7931 | ObjectExtractorMoreComplexBody |
net6.0 | 6.44μs | 2.38ns | 9.23ns | 0 | 0 | 0 | 3.78 KB |
| #7931 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.76μs | 40.6ns | 195ns | 0 | 0 | 0 | 3.69 KB |
| #7931 | ObjectExtractorMoreComplexBody |
net472 | 6.71μs | 4.53ns | 16.9ns | 0.572 | 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.8μs | 245ns | 883ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 97.5μs | 233ns | 872ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 11.2ns | 43.2ns | 4.9 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 148μs | 33ns | 128ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 200μs | 209ns | 808ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 264μs | 40.4ns | 157ns | 0 | 0 | 0 | 2.14 KB |
| #7931 | EncodeArgs |
net6.0 | 78.5μs | 141ns | 546ns | 0 | 0 | 0 | 32.4 KB |
| #7931 | EncodeArgs |
netcoreapp3.1 | 98.9μs | 51.6ns | 193ns | 0 | 0 | 0 | 32.4 KB |
| #7931 | EncodeArgs |
net472 | 108μs | 10.4ns | 40.3ns | 4.86 | 0 | 0 | 32.5 KB |
| #7931 | EncodeLegacyArgs |
net6.0 | 145μs | 13.2ns | 49.4ns | 0 | 0 | 0 | 2.14 KB |
| #7931 | EncodeLegacyArgs |
netcoreapp3.1 | 201μs | 201ns | 778ns | 0 | 0 | 0 | 2.14 KB |
| #7931 | EncodeLegacyArgs |
net472 | 263μs | 16.9ns | 63.1ns | 0 | 0 | 0 | 2.14 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 422μs | 1.33μs | 4.62μs | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 448μs | 2.1μs | 7.86μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 496μs | 389ns | 1.46μs | 0 | 0 | 0 | 0 b |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 308μs | 1.45μs | 5.61μs | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 335μs | 1.44μs | 5.19μs | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 363μs | 650ns | 2.52μs | 0 | 0 | 0 | 0 b |
| #7931 | RunWafRealisticBenchmark |
net6.0 | 415μs | 783ns | 2.71μs | 0 | 0 | 0 | 4.55 KB |
| #7931 | RunWafRealisticBenchmark |
netcoreapp3.1 | 449μs | 2.96μs | 28.2μs | 0 | 0 | 0 | 4.48 KB |
| #7931 | RunWafRealisticBenchmark |
net472 | 486μs | 665ns | 2.58μs | 0 | 0 | 0 | 0 b |
| #7931 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 305μs | 1E+03ns | 3.6μs | 0 | 0 | 0 | 2.24 KB |
| #7931 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 323μs | 1.47μs | 6.25μs | 0 | 0 | 0 | 2.22 KB |
| #7931 | RunWafRealisticBenchmarkWithAttack |
net472 | 363μs | 278ns | 1μs | 0 | 0 | 0 | 0 b |
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 | 84.2μs | 245ns | 883ns | 0 | 0 | 0 | 18.97 KB |
| master | SendRequest |
netcoreapp3.1 | 96.6μs | 306ns | 1.78μs | 0 | 0 | 0 | 21.18 KB |
| master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #7931 | SendRequest |
net6.0 | 83.4μs | 97.3ns | 337ns | 0 | 0 | 0 | 18.97 KB |
| #7931 | SendRequest |
netcoreapp3.1 | 97.2μs | 328ns | 1.64μs | 0 | 0 | 0 | 21.18 KB |
| #7931 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 2.06ms | 9.96μs | 39.9μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 3.91ms | 1.21μs | 4.53μs | 0 | 0 | 0 | 640.05 KB |
| master | OriginalCharSlice |
net472 | 2.78ms | 961ns | 3.72μs | 0 | 0 | 0 | 638.98 KB |
| master | OptimizedCharSlice |
net6.0 | 1.47ms | 252ns | 907ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
netcoreapp3.1 | 2.79ms | 619ns | 2.23μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
net472 | 2.01ms | 654ns | 2.45μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.04ms | 1.82μs | 7.06μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.89ms | 965ns | 3.74μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.14ms | 400ns | 1.55μs | 0 | 0 | 0 | 0 b |
| #7931 | OriginalCharSlice |
net6.0 | 1.98ms | 1.36μs | 5.28μs | 0 | 0 | 0 | 640 KB |
| #7931 | OriginalCharSlice |
netcoreapp3.1 | 3.95ms | 1.39μs | 5.19μs | 0 | 0 | 0 | 640.05 KB |
| #7931 | OriginalCharSlice |
net472 | 2.73ms | 438ns | 1.64μs | 0 | 0 | 0 | 638.98 KB |
| #7931 | OptimizedCharSlice |
net6.0 | 1.46ms | 689ns | 2.58μs | 0 | 0 | 0 | 0 b |
| #7931 | OptimizedCharSlice |
netcoreapp3.1 | 2.84ms | 1.14μs | 4.41μs | 0 | 0 | 0 | 0 b |
| #7931 | OptimizedCharSlice |
net472 | 2.05ms | 765ns | 2.86μs | 0 | 0 | 0 | 0 b |
| #7931 | OptimizedCharSliceWithPool |
net6.0 | 1.07ms | 752ns | 2.81μs | 0 | 0 | 0 | 0 b |
| #7931 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.9ms | 768ns | 2.88μs | 0 | 0 | 0 | 0 b |
| #7931 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 718ns | 2.78μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ Fewer allocations 🎉
Slower ⚠️ in #7931
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.275
639,927.01
815,846.63
Fewer allocations 🎉 in #7931
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
42.21 KB
41.77 KB
-435 B
-1.03%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.275 | 639,927.01 | 815,846.63 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 42.21 KB | 41.77 KB | -435 B | -1.03% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 706μs | 336ns | 1.26μs | 0 | 0 | 0 | 41.62 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 648μs | 3.43μs | 17.1μs | 0 | 0 | 0 | 42.21 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 860μs | 3.89μs | 14μs | 4.46 | 0 | 0 | 55.89 KB |
| #7931 | WriteAndFlushEnrichedTraces |
net6.0 | 689μs | 610ns | 2.28μs | 0 | 0 | 0 | 41.78 KB |
| #7931 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 814μs | 2.2μs | 7.94μs | 0 | 0 | 0 | 41.77 KB |
| #7931 | WriteAndFlushEnrichedTraces |
net472 | 876μs | 3.99μs | 16μs | 4.46 | 0 | 0 | 56.11 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.87μs | 0.936ns | 3.62ns | 0 | 0 | 0 | 968 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.63μs | 11.9ns | 46.3ns | 0 | 0 | 0 | 960 B |
| master | ExecuteNonQuery |
net472 | 2.7μs | 2.1ns | 7.87ns | 0.148 | 0 | 0 | 931 B |
| #7931 | ExecuteNonQuery |
net6.0 | 1.86μs | 0.571ns | 2.14ns | 0 | 0 | 0 | 968 B |
| #7931 | ExecuteNonQuery |
netcoreapp3.1 | 2.49μs | 9.91ns | 37.1ns | 0 | 0 | 0 | 960 B |
| #7931 | ExecuteNonQuery |
net472 | 2.77μs | 2.03ns | 7.61ns | 0.138 | 0 | 0 | 931 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.72μs | 6.92ns | 26.8ns | 0 | 0 | 0 | 952 B |
| master | CallElasticsearch |
netcoreapp3.1 | 2.16μs | 11.2ns | 52.3ns | 0 | 0 | 0 | 968 B |
| master | CallElasticsearch |
net472 | 3.39μs | 4.54ns | 17.6ns | 0.137 | 0 | 0 | 955 B |
| master | CallElasticsearchAsync |
net6.0 | 1.73μs | 0.981ns | 3.67ns | 0 | 0 | 0 | 928 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.28μs | 9.88ns | 38.3ns | 0 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 3.48μs | 3.62ns | 14ns | 0.156 | 0 | 0 | 1.01 KB |
| #7931 | CallElasticsearch |
net6.0 | 1.69μs | 1.16ns | 4.49ns | 0 | 0 | 0 | 952 B |
| #7931 | CallElasticsearch |
netcoreapp3.1 | 2.15μs | 7.78ns | 30.1ns | 0 | 0 | 0 | 968 B |
| #7931 | CallElasticsearch |
net472 | 3.4μs | 5.85ns | 22.7ns | 0.136 | 0 | 0 | 955 B |
| #7931 | CallElasticsearchAsync |
net6.0 | 1.76μs | 3.76ns | 14.5ns | 0 | 0 | 0 | 928 B |
| #7931 | CallElasticsearchAsync |
netcoreapp3.1 | 2.33μs | 9.62ns | 37.3ns | 0 | 0 | 0 | 1.02 KB |
| #7931 | CallElasticsearchAsync |
net472 | 3.46μs | 1.52ns | 5.89ns | 0.156 | 0 | 0 | 1.01 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.76μs | 7.45ns | 28.8ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.31μs | 7.47ns | 28.9ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
net472 | 2.54μs | 2.95ns | 11.4ns | 0.126 | 0 | 0 | 858 B |
| #7931 | ExecuteAsync |
net6.0 | 1.8μs | 9.1ns | 40.7ns | 0 | 0 | 0 | 896 B |
| #7931 | ExecuteAsync |
netcoreapp3.1 | 2.35μs | 7.43ns | 28.8ns | 0 | 0 | 0 | 896 B |
| #7931 | ExecuteAsync |
net472 | 2.51μs | 1.3ns | 5.03ns | 0.126 | 0 | 0 | 858 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.82μs | 14.8ns | 57.3ns | 0 | 0 | 0 | 2.29 KB |
| master | SendAsync |
netcoreapp3.1 | 8.4μs | 34.4ns | 133ns | 0 | 0 | 0 | 2.83 KB |
| master | SendAsync |
net472 | 11.8μs | 10.8ns | 41.9ns | 0.474 | 0 | 0 | 3.08 KB |
| #7931 | SendAsync |
net6.0 | 6.67μs | 6.19ns | 24ns | 0 | 0 | 0 | 2.29 KB |
| #7931 | SendAsync |
netcoreapp3.1 | 8.65μs | 24ns | 92.8ns | 0 | 0 | 0 | 2.83 KB |
| #7931 | SendAsync |
net472 | 11.7μs | 10.5ns | 40.5ns | 0.465 | 0 | 0 | 3.08 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7931
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
256.94 KB
259.58 KB
2.63 KB
1.02%
Fewer allocations 🎉 in #7931
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
274.72 KB
249.74 KB
-24.98 KB
-9.09%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 256.94 KB | 259.58 KB | 2.63 KB | 1.02% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 274.72 KB | 249.74 KB | -24.98 KB | -9.09% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45.1μs | 245ns | 1.27μs | 0 | 0 | 0 | 42.51 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 49μs | 260ns | 1.3μs | 0 | 0 | 0 | 42.54 KB |
| master | StringConcatBenchmark |
net472 | 57.2μs | 247ns | 986ns | 0 | 0 | 0 | 49.15 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 446μs | 2.06μs | 7.98μs | 0 | 0 | 0 | 256.94 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 530μs | 991ns | 4.95μs | 0 | 0 | 0 | 274.72 KB |
| master | StringConcatAspectBenchmark |
net472 | 399μs | 2.3μs | 19.4μs | 0 | 0 | 0 | 271.01 KB |
| #7931 | StringConcatBenchmark |
net6.0 | 44.6μs | 247ns | 1.4μs | 0 | 0 | 0 | 42.51 KB |
| #7931 | StringConcatBenchmark |
netcoreapp3.1 | 50μs | 252ns | 1.71μs | 0 | 0 | 0 | 42.54 KB |
| #7931 | StringConcatBenchmark |
net472 | 56.4μs | 287ns | 1.25μs | 0 | 0 | 0 | 49.15 KB |
| #7931 | StringConcatAspectBenchmark |
net6.0 | 474μs | 2.28μs | 9.41μs | 0 | 0 | 0 | 259.58 KB |
| #7931 | StringConcatAspectBenchmark |
netcoreapp3.1 | 499μs | 1.37μs | 5.98μs | 0 | 0 | 0 | 249.74 KB |
| #7931 | StringConcatAspectBenchmark |
net472 | 406μs | 2.21μs | 12.5μs | 0 | 0 | 0 | 270.34 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.68μs | 12.8ns | 51.1ns | 0 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.61μs | 18.1ns | 85ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.82μs | 4.62ns | 17.9ns | 0.246 | 0 | 0 | 1.6 KB |
| #7931 | EnrichedLog |
net6.0 | 2.76μs | 4.43ns | 17.2ns | 0 | 0 | 0 | 1.69 KB |
| #7931 | EnrichedLog |
netcoreapp3.1 | 3.51μs | 10.7ns | 38.8ns | 0 | 0 | 0 | 1.7 KB |
| #7931 | EnrichedLog |
net472 | 3.88μs | 3.94ns | 14.7ns | 0.251 | 0 | 0 | 1.6 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 | 85.5ns | 320ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 127μs | 117ns | 423ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 166μs | 192ns | 743ns | 0 | 0 | 0 | 4.51 KB |
| #7931 | EnrichedLog |
net6.0 | 122μs | 111ns | 416ns | 0 | 0 | 0 | 4.31 KB |
| #7931 | EnrichedLog |
netcoreapp3.1 | 128μs | 112ns | 432ns | 0 | 0 | 0 | 4.31 KB |
| #7931 | EnrichedLog |
net472 | 167μs | 28.3ns | 106ns | 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 | 5.08μs | 24.9ns | 108ns | 0 | 0 | 0 | 2.24 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.82μs | 27.1ns | 105ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.58μs | 6.43ns | 24.9ns | 0.301 | 0 | 0 | 2.05 KB |
| #7931 | EnrichedLog |
net6.0 | 5.08μs | 5.06ns | 18.9ns | 0 | 0 | 0 | 2.24 KB |
| #7931 | EnrichedLog |
netcoreapp3.1 | 6.94μs | 19ns | 73.7ns | 0 | 0 | 0 | 2.26 KB |
| #7931 | EnrichedLog |
net472 | 7.47μs | 4.11ns | 15.4ns | 0.299 | 0 | 0 | 2.05 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.96μs | 2.53ns | 9.46ns | 0 | 0 | 0 | 1.12 KB |
| master | SendReceive |
netcoreapp3.1 | 2.51μs | 12.3ns | 53.6ns | 0 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.9μs | 1.4ns | 5.42ns | 0.177 | 0 | 0 | 1.12 KB |
| #7931 | SendReceive |
net6.0 | 1.93μs | 2.16ns | 8.38ns | 0 | 0 | 0 | 1.12 KB |
| #7931 | SendReceive |
netcoreapp3.1 | 2.6μs | 5.98ns | 23.2ns | 0 | 0 | 0 | 1.14 KB |
| #7931 | SendReceive |
net472 | 2.92μs | 4.74ns | 18.4ns | 0.176 | 0 | 0 | 1.12 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.36μs | 19.6ns | 73.3ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.85μs | 13.3ns | 51.5ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.7μs | 11.5ns | 44.5ns | 0.301 | 0 | 0 | 2.03 KB |
| #7931 | EnrichedLog |
net6.0 | 4.45μs | 4.34ns | 15ns | 0 | 0 | 0 | 1.58 KB |
| #7931 | EnrichedLog |
netcoreapp3.1 | 5.92μs | 8.02ns | 30ns | 0 | 0 | 0 | 1.63 KB |
| #7931 | EnrichedLog |
net472 | 6.62μs | 7.29ns | 28.2ns | 0.299 | 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 | 768ns | 0.295ns | 1.14ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
netcoreapp3.1 | 953ns | 5.07ns | 26.3ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
net472 | 889ns | 0.15ns | 0.539ns | 0.0823 | 0 | 0 | 522 B |
| master | StartFinishScope |
net6.0 | 897ns | 4.1ns | 16.4ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.13μs | 5.44ns | 21.1ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
net472 | 1.1μs | 0.248ns | 0.961ns | 0.0935 | 0 | 0 | 602 B |
| master | StartFinishTwoScopes |
net6.0 | 1.84μs | 0.671ns | 2.6ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
netcoreapp3.1 | 2.21μs | 11.1ns | 49.6ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
net472 | 2.14μs | 0.392ns | 1.52ns | 0.161 | 0 | 0 | 1.08 KB |
| #7931 | StartFinishSpan |
net6.0 | 774ns | 0.155ns | 0.578ns | 0 | 0 | 0 | 520 B |
| #7931 | StartFinishSpan |
netcoreapp3.1 | 957ns | 4.48ns | 22.8ns | 0 | 0 | 0 | 520 B |
| #7931 | StartFinishSpan |
net472 | 886ns | 0.147ns | 0.531ns | 0.0799 | 0 | 0 | 522 B |
| #7931 | StartFinishScope |
net6.0 | 906ns | 4.67ns | 20.9ns | 0 | 0 | 0 | 640 B |
| #7931 | StartFinishScope |
netcoreapp3.1 | 1.16μs | 6.4ns | 36.2ns | 0 | 0 | 0 | 640 B |
| #7931 | StartFinishScope |
net472 | 1.09μs | 0.281ns | 1.09ns | 0.0934 | 0 | 0 | 602 B |
| #7931 | StartFinishTwoScopes |
net6.0 | 1.82μs | 9.78ns | 53.6ns | 0 | 0 | 0 | 1.19 KB |
| #7931 | StartFinishTwoScopes |
netcoreapp3.1 | 2.28μs | 11.3ns | 52ns | 0 | 0 | 0 | 1.19 KB |
| #7931 | StartFinishTwoScopes |
net472 | 2.18μs | 0.434ns | 1.68ns | 0.164 | 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.05μs | 0.41ns | 1.53ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.36μs | 6.81ns | 31.2ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
net472 | 1.47μs | 0.812ns | 3.04ns | 0.0885 | 0 | 0 | 602 B |
| #7931 | RunOnMethodBegin |
net6.0 | 1.05μs | 4.9ns | 19.6ns | 0 | 0 | 0 | 640 B |
| #7931 | RunOnMethodBegin |
netcoreapp3.1 | 1.31μs | 7ns | 35ns | 0 | 0 | 0 | 640 B |
| #7931 | RunOnMethodBegin |
net472 | 1.4μs | 0.463ns | 1.79ns | 0.091 | 0 | 0 | 602 B |
c04dbe5 to
400c48a
Compare
39a7db5 to
7b7e9bf
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7931) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7931) - mean (76ms) : 70, 83
master - mean (75ms) : 70, 80
section Bailout
This PR (7931) - mean (79ms) : 74, 85
master - mean (79ms) : 74, 84
section CallTarget+Inlining+NGEN
This PR (7931) - mean (1,086ms) : 1009, 1163
master - mean (1,064ms) : 1014, 1114
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 (7931) - mean (118ms) : 110, 126
master - mean (116ms) : 110, 122
section Bailout
This PR (7931) - mean (117ms) : 109, 125
master - mean (119ms) : 112, 125
section CallTarget+Inlining+NGEN
This PR (7931) - mean (768ms) : 731, 806
master - mean (760ms) : 722, 799
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7931) - mean (103ms) : 97, 110
master - mean (103ms) : 97, 109
section Bailout
This PR (7931) - mean (106ms) : 100, 113
master - mean (104ms) : 98, 110
section CallTarget+Inlining+NGEN
This PR (7931) - mean (709ms) : 674, 743
master - mean (702ms) : 675, 729
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7931) - mean (103ms) : 97, 109
master - mean (101ms) : 94, 109
section Bailout
This PR (7931) - mean (104ms) : 97, 110
master - mean (103ms) : 98, 109
section CallTarget+Inlining+NGEN
This PR (7931) - mean (679ms) : 640, 719
master - mean (666ms) : 643, 689
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 (7931) - mean (196ms) : 190, 202
master - mean (195ms) : 189, 201
section Bailout
This PR (7931) - mean (198ms) : 194, 203
master - mean (199ms) : 195, 204
section CallTarget+Inlining+NGEN
This PR (7931) - mean (1,127ms) : 1072, 1182
master - mean (1,133ms) : 1058, 1208
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 (7931) - mean (280ms) : 274, 285
master - mean (279ms) : 272, 286
section Bailout
This PR (7931) - mean (281ms) : 272, 289
master - mean (281ms) : 273, 290
section CallTarget+Inlining+NGEN
This PR (7931) - mean (915ms) : 874, 956
master - mean (916ms) : 868, 965
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7931) - mean (274ms) : 267, 281
master - mean (274ms) : 265, 282
section Bailout
This PR (7931) - mean (274ms) : 266, 282
master - mean (273ms) : 267, 279
section CallTarget+Inlining+NGEN
This PR (7931) - mean (892ms) : 851, 933
master - mean (898ms) : 853, 943
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7931) - mean (272ms) : 265, 279
master - mean (273ms) : 266, 280
section Bailout
This PR (7931) - mean (272ms) : 265, 279
master - mean (271ms) : 266, 276
section CallTarget+Inlining+NGEN
This PR (7931) - mean (833ms) : 808, 858
master - mean (833ms) : 811, 855
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…any string key (#7689) ## Context Part of **Configuration Inversion (Step 4)** - Stack progress: 1. [#7548](#7548) - Add GitLab step and JSON configuration file 2. [#7688](#7688) - Cleanup configuration / platform keys + analyzers 3. [#7698](#7698) - Source generator for ConfigurationKeys 4. **→ [#7689](#7689) - Aliases handling and analyzers (this PR)** 5. [#7931](#7931) - Replace manual ConfigurationKeys with generated version 6. #[7932](#7932 Forbid use of System.Environment methods and adapt everywhere ## 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](cci:2://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.Logging.cs:9:0-58:1)/`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).
Co-authored-by: Andrew Lock <[email protected]>
7b7e9bf to
8ba62d5
Compare
andrewlock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 assuming it's like the one that got accidentally merged 😄
…ersion (#7944) ## Summary of changes Due to this [Rider](https://youtrack.jetbrains.com/projects/RIDER/issues/RIDER-132634/Source-Generated-files-missing-when-using-System.Text.Json) issue , the IDE doesn't index source generated files using the last version of the package properly which considerably degrades the dev experience. And following the merge [of this PR](#7931), we now have the issue: <img width="2148" height="980" alt="image" src="https://github.com/user-attachments/assets/5c113a18-9126-4a57-9cda-eb1168a41876" /> It still builds but Rider doesn't see the generated sources and generates errors and doesn't autocompletes or index anything. ## Reason for change Downgrade the package version to fix the dev experience. ## Implementation details ## Test coverage ## Other details <!-- Fixes #{issue} --> <!--⚠️ Note: Where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. MergeQueue is NOT enabled in this repository. If you have write access to the repo, the PR has 1-2 approvals (see above), and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #apm-dotnet channel in Slack. -->
…apt everywhere (#7932) ## Context Part of **Configuration Inversion (Step 6)** - Stack progress: 1. [#7548](#7548) - Add GitLab step and JSON configuration file 2. [#7688](#7688) - Cleanup configuration / platform keys + source generator 3. [#7698](#7698) - Aliases handling via source generator 4. [#7689](#7689) - Analyzers for platform and ConfigurationBuilder 5. [#7931](#7931) - Replace manual ConfigurationKeys by generated ones in the whole solution 6. **→ [#7932](#7932) - Forbid use of System.Environment methods and adapt everywhere (this PR)** 7. [#7937](#7937) - Integration names to generated keys I'll update the PR summary to mention the YAML documentation file: ## Summary of changes Banned direct `System.Environment.GetEnvironmentVariable()` usage and migrated all environment variable access to use `EnvironmentHelpers` with strongly-typed [ConfigurationKeys](cci:2://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs:15:0-737:1) and `PlatformKeys` constants. ### Key changes: - **Banned `System.Environment.GetEnvironmentVariable()`** via `BannedApiAnalyzers` - **Added `EnvironmentGetEnvironmentVariableAnalyzer` (DD0009)** to enforce [ConfigurationKeys](cci:2://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs:15:0-737:1)/`PlatformKeys` usage only - **Nested `PlatformKeys` by category** (Ci, Aws, AzureAppService, ServiceFabric, DotNet) - **Migrated ~50+ files** across CI Visibility, AWS Lambda, AppSec, Telemetry, Profiler, and Agent components - **Added missing keys** to [supported-configurations.json](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations.json:0:0-0:0) and their documentation to [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) ## Reason for change Direct `System.Environment.GetEnvironmentVariable()` calls with string literals are error-prone. Centralizing through `EnvironmentHelpers` with strongly-typed constants provides compile-time validation, discoverability, and refactoring safety. ## Implementation details 1. **Banned API enforcement** - Added `BannedSymbols.txt` and configured `.editorconfig` to treat RS0030 as error (vendored code excluded) 2. **Custom analyzer** - DD0009 validates all `EnvironmentHelpers` calls accept only [ConfigurationKeys](cci:2://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs:15:0-737:1)/`PlatformKeys` constants, rejecting hardcoded strings 3. **PlatformKeys organization** - Nested by category for better discoverability 4. **EnvironmentHelpers refactoring** - Added overloads for nested class constants, maintained backward compatibility 5. **Configuration documentation** - Added missing configuration keys to [supported-configurations.json](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations.json:0:0-0:0) and comprehensive XML documentation to [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), which the source generator uses to generate XML doc comments in [ConfigurationKeys](cci:2://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs:15:0-737:1) classes ## Test coverage - ✅ Comprehensive analyzer tests covering valid/invalid scenarios - ✅ All existing unit tests pass - ✅ Banned API analyzer correctly flags direct `System.Environment` usage ## Other details +2,600/-940 lines. No breaking changes, negligible performance impact.
(This PR is actually #7697 that accidentally got closed)
Context
Part of Configuration Inversion (Step 5) - Stack progress:
Summary of changes
Fixed the ConfigurationKeysGenerator to properly read and apply the configuration_keys_mapping.json file, and extracted common file header comments to a reusable constant.
Key changes:
"mappings"field as an object instead of an arrayConstants.ConfigurationGeneratorCommentfor reuse across multiple generatorsReason for change
The configuration_keys_mapping.json file was being ignored during code generation, causing the generator to produce incorrect constant names. This meant that any manual edits to constant names in the mapping file were not being respected, and the generated code would use auto-generated names instead of the explicitly mapped ones.
Additionally, the file header comments explaining that files are auto-generated were duplicated across generators, violating DRY principles.
Implementation details
Fixed array extraction logic: Replaced the call to JsonReader.ExtractJsonObjectSection() with custom array extraction code that:
"mappings":key in the JSON[bracket]Resolved variable scope issue: Reused existing
inStringandescapeNextvariables from the outer scope instead of redeclaring them, fixing compilation errors.Centralized header comments: Created
Constants.ConfigurationGeneratorCommentcontaining the standardized auto-generation notice and updated both generators to use it.Test coverage
Other details
This fix ensures that the explicit naming conventions defined in configuration_keys_mapping.json are respected, maintaining consistency with the existing codebase and preventing future confusion when constant names don't match their expected values.