-
Notifications
You must be signed in to change notification settings - Fork 151
[ConfigRegistry] 4/5 Aliases handling and analyzers to prevent using any string key #7689
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
base: master
Are you sure you want to change the base?
Conversation
be32003 to
c983088
Compare
acaf6cf to
c1f7943
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7689 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 | 6.06 KB | 6.11 KB | 50 B | 0.83% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.5μs | 57.7ns | 346ns | 0 | 0 | 0 | 5.52 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.9μs | 66.8ns | 259ns | 0 | 0 | 0 | 5.7 KB |
| master | StartStopWithChild |
net472 | 22.3μs | 119ns | 665ns | 0.977 | 0.326 | 0.109 | 6.06 KB |
| #7689 | StartStopWithChild |
net6.0 | 11μs | 58.5ns | 298ns | 0 | 0 | 0 | 5.51 KB |
| #7689 | StartStopWithChild |
netcoreapp3.1 | 14μs | 27.7ns | 107ns | 0 | 0 | 0 | 5.72 KB |
| #7689 | StartStopWithChild |
net472 | 22.2μs | 124ns | 816ns | 0.963 | 0.214 | 0 | 6.11 KB |
Benchmarks.Trace.AgentWriterBenchmark - Unknown 🤷 Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| master | WriteAndFlushEnrichedTraces |
net472 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| #7689 | WriteAndFlushEnrichedTraces |
net6.0 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| #7689 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| #7689 | WriteAndFlushEnrichedTraces |
net472 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 1.08μs | 5.94ns | 36.1ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.42μs | 7.96ns | 51ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.06μs | 0.817ns | 3.16ns | 0.191 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.31μs | 34.6ns | 147ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 8.87μs | 45.6ns | 204ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.61μs | 6.65ns | 25.8ns | 0.722 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 325ns | 1.83ns | 10.7ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 396ns | 0.266ns | 1.03ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 301ns | 0.313ns | 1.21ns | 0.0438 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.38μs | 32.1ns | 136ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.9μs | 39.2ns | 175ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.67μs | 2.3ns | 8.91ns | 0.6 | 0 | 0 | 3.8 KB |
| #7689 | AllCycleSimpleBody |
net6.0 | 1.08μs | 6.11ns | 45.3ns | 0 | 0 | 0 | 1.22 KB |
| #7689 | AllCycleSimpleBody |
netcoreapp3.1 | 1.42μs | 7.71ns | 44.3ns | 0 | 0 | 0 | 1.2 KB |
| #7689 | AllCycleSimpleBody |
net472 | 998ns | 0.622ns | 2.41ns | 0.194 | 0 | 0 | 1.23 KB |
| #7689 | AllCycleMoreComplexBody |
net6.0 | 7.22μs | 33ns | 128ns | 0 | 0 | 0 | 4.72 KB |
| #7689 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.04μs | 41.2ns | 160ns | 0 | 0 | 0 | 4.62 KB |
| #7689 | AllCycleMoreComplexBody |
net472 | 7.68μs | 7.68ns | 29.7ns | 0.721 | 0 | 0 | 4.74 KB |
| #7689 | ObjectExtractorSimpleBody |
net6.0 | 333ns | 0.183ns | 0.634ns | 0 | 0 | 0 | 280 B |
| #7689 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 417ns | 0.292ns | 1.05ns | 0 | 0 | 0 | 272 B |
| #7689 | ObjectExtractorSimpleBody |
net472 | 297ns | 0.269ns | 1.04ns | 0.0446 | 0 | 0 | 281 B |
| #7689 | ObjectExtractorMoreComplexBody |
net6.0 | 6.19μs | 33.7ns | 185ns | 0 | 0 | 0 | 3.78 KB |
| #7689 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.89μs | 39.2ns | 162ns | 0 | 0 | 0 | 3.69 KB |
| #7689 | ObjectExtractorMoreComplexBody |
net472 | 6.66μs | 2.62ns | 9.81ns | 0.57 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 76.1μs | 21.7ns | 78.3ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 97.1μs | 165ns | 639ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 19.6ns | 73.2ns | 4.91 | 0 | 0 | 32.51 KB |
| master | EncodeLegacyArgs |
net6.0 | 148μs | 46.7ns | 175ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 514ns | 1.99μs | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 265μs | 117ns | 420ns | 0 | 0 | 0 | 2.16 KB |
| #7689 | EncodeArgs |
net6.0 | 75.7μs | 352ns | 1.36μs | 0 | 0 | 0 | 32.4 KB |
| #7689 | EncodeArgs |
netcoreapp3.1 | 97.5μs | 213ns | 799ns | 0 | 0 | 0 | 32.4 KB |
| #7689 | EncodeArgs |
net472 | 110μs | 15.8ns | 61.2ns | 4.93 | 0 | 0 | 32.5 KB |
| #7689 | EncodeLegacyArgs |
net6.0 | 146μs | 49ns | 177ns | 0 | 0 | 0 | 2.15 KB |
| #7689 | EncodeLegacyArgs |
netcoreapp3.1 | 199μs | 387ns | 1.5μs | 0 | 0 | 0 | 2.14 KB |
| #7689 | EncodeLegacyArgs |
net472 | 262μs | 356ns | 1.38μs | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472
0 b
8.19 KB
8.19 KB
∞
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472
0 b
8.19 KB
8.19 KB
∞
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0
2.88 KB
3.17 KB
288 B
10.00%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0
5.14 KB
5.53 KB
384 B
7.47%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472 | 0 b | 8.19 KB | 8.19 KB | ∞ |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472 | 0 b | 8.19 KB | 8.19 KB | ∞ |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0 | 2.88 KB | 3.17 KB | 288 B | 10.00% |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 | 5.14 KB | 5.53 KB | 384 B | 7.47% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 424μs | 1.37μs | 5.49μs | 0 | 0 | 0 | 5.14 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 456μs | 2.64μs | 22.6μs | 0 | 0 | 0 | 4.58 KB |
| master | RunWafRealisticBenchmark |
net472 | 498μs | 377ns | 1.41μs | 0 | 0 | 0 | 0 b |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 327μs | 2.12μs | 20.9μs | 0 | 0 | 0 | 2.88 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 348μs | 3.27μs | 31.5μs | 0 | 0 | 0 | 2.32 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 372μs | 252ns | 909ns | 0 | 0 | 0 | 0 b |
| #7689 | RunWafRealisticBenchmark |
net6.0 | 434μs | 2.23μs | 13.9μs | 0 | 0 | 0 | 5.53 KB |
| #7689 | RunWafRealisticBenchmark |
netcoreapp3.1 | 460μs | 1.56μs | 5.63μs | 0 | 0 | 0 | 4.58 KB |
| #7689 | RunWafRealisticBenchmark |
net472 | 500μs | 479ns | 1.79μs | 0 | 0 | 0 | 8.19 KB |
| #7689 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 315μs | 1.01μs | 3.76μs | 0 | 0 | 0 | 3.17 KB |
| #7689 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 343μs | 1.92μs | 13.2μs | 0 | 0 | 0 | 2.32 KB |
| #7689 | RunWafRealisticBenchmarkWithAttack |
net472 | 376μs | 213ns | 769ns | 0 | 0 | 0 | 8.19 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net6.0 | 61.2μs | 71.7ns | 278ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 72.4μs | 169ns | 1.15μs | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00754ns | 0.0021ns | 0.00787ns | 0 | 0 | 0 | 0 b |
| #7689 | SendRequest |
net6.0 | 61.8μs | 93.2ns | 349ns | 0 | 0 | 0 | 14.52 KB |
| #7689 | SendRequest |
netcoreapp3.1 | 72.3μs | 337ns | 1.35μs | 0 | 0 | 0 | 17.42 KB |
| #7689 | SendRequest |
net472 | 0.00641ns | 0.00195ns | 0.00756ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #7689
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1
1.859
2,120,200.00
3,942,200.00
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1
1.634
1,726,100.00
2,820,450.00
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
1.128
1,397,450.00
1,575,900.00
More allocations ⚠️ in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472
0 b
8.19 KB
8.19 KB
∞
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472
0 b
8.19 KB
8.19 KB
∞
Fewer allocations 🎉 in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
640 B
304 B
-336 B
-52.50%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1 | 1.859 | 2,120,200.00 | 3,942,200.00 | |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 | 1.634 | 1,726,100.00 | 2,820,450.00 | |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 1.128 | 1,397,450.00 | 1,575,900.00 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 | 0 b | 8.19 KB | 8.19 KB | ∞ |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 | 0 b | 8.19 KB | 8.19 KB | ∞ |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 640 B | 304 B | -336 B | -52.50% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.88ms | 3.27μs | 12.7μs | 0 | 0 | 0 | 640.98 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.13ms | 6.12μs | 40.1μs | 0 | 0 | 0 | 640.1 KB |
| master | OriginalCharSlice |
net472 | 2.64ms | 668ns | 2.5μs | 0 | 0 | 0 | 647.17 KB |
| master | OptimizedCharSlice |
net6.0 | 1.4ms | 447ns | 1.67μs | 0 | 0 | 0 | 640 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.73ms | 5.65μs | 37.1μs | 0 | 0 | 0 | 104 B |
| master | OptimizedCharSlice |
net472 | 1.98ms | 544ns | 2.04μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.05ms | 1.25μs | 4.85μs | 0 | 0 | 0 | 640 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.86ms | 1.72μs | 6.65μs | 0 | 0 | 0 | 104 B |
| master | OptimizedCharSliceWithPool |
net472 | 1.23ms | 781ns | 3.02μs | 0 | 0 | 0 | 0 b |
| #7689 | OriginalCharSlice |
net6.0 | 2.03ms | 1.36μs | 5.08μs | 0 | 0 | 0 | 640.64 KB |
| #7689 | OriginalCharSlice |
netcoreapp3.1 | 3.94ms | 1.64μs | 6.14μs | 0 | 0 | 0 | 640.1 KB |
| #7689 | OriginalCharSlice |
net472 | 2.56ms | 1.38μs | 5.36μs | 0 | 0 | 0 | 647.17 KB |
| #7689 | OptimizedCharSlice |
net6.0 | 1.58ms | 969ns | 3.49μs | 0 | 0 | 0 | 304 B |
| #7689 | OptimizedCharSlice |
netcoreapp3.1 | 2.82ms | 634ns | 2.37μs | 0 | 0 | 0 | 104 B |
| #7689 | OptimizedCharSlice |
net472 | 1.96ms | 825ns | 3.09μs | 0 | 0 | 0 | 8.19 KB |
| #7689 | OptimizedCharSliceWithPool |
net6.0 | 1.07ms | 2.28μs | 8.84μs | 0 | 0 | 0 | 640 B |
| #7689 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.9ms | 1.96μs | 7.58μs | 0 | 0 | 0 | 104 B |
| #7689 | OptimizedCharSliceWithPool |
net472 | 1.14ms | 495ns | 1.92μs | 0 | 0 | 0 | 8.19 KB |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0
41.77 KB
42.58 KB
813 B
1.95%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.77 KB | 42.58 KB | 813 B | 1.95% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 689μs | 2.8μs | 10.5μs | 0 | 0 | 0 | 41.77 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 802μs | 1.06μs | 3.95μs | 0 | 0 | 0 | 41.82 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 852μs | 2.34μs | 9.08μs | 8.33 | 0 | 0 | 56.22 KB |
| #7689 | WriteAndFlushEnrichedTraces |
net6.0 | 707μs | 3.99μs | 26.8μs | 0 | 0 | 0 | 42.58 KB |
| #7689 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 802μs | 4.07μs | 18.7μs | 0 | 0 | 0 | 41.85 KB |
| #7689 | WriteAndFlushEnrichedTraces |
net472 | 890μs | 3.75μs | 13.5μs | 4.46 | 0 | 0 | 55.97 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net6.0 | 2μs | 7.88ns | 29.5ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.59μs | 7.55ns | 29.2ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.77μs | 4.17ns | 16.1ns | 0.154 | 0 | 0 | 987 B |
| #7689 | ExecuteNonQuery |
net6.0 | 1.92μs | 3.32ns | 12.9ns | 0 | 0 | 0 | 1.02 KB |
| #7689 | ExecuteNonQuery |
netcoreapp3.1 | 2.56μs | 6.23ns | 24.1ns | 0 | 0 | 0 | 1.02 KB |
| #7689 | ExecuteNonQuery |
net472 | 2.67μs | 2.96ns | 11.5ns | 0.146 | 0 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.76μs | 2.98ns | 11.6ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.28μs | 4.74ns | 18.4ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.55μs | 2.98ns | 11.6ns | 0.16 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.8μs | 0.809ns | 2.92ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.41μs | 8.04ns | 31.1ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.62μs | 4.18ns | 16.2ns | 0.165 | 0 | 0 | 1.1 KB |
| #7689 | CallElasticsearch |
net6.0 | 1.76μs | 8.98ns | 41.2ns | 0 | 0 | 0 | 1.03 KB |
| #7689 | CallElasticsearch |
netcoreapp3.1 | 2.37μs | 5.76ns | 22.3ns | 0 | 0 | 0 | 1.03 KB |
| #7689 | CallElasticsearch |
net472 | 3.53μs | 5.88ns | 22ns | 0.158 | 0 | 0 | 1.04 KB |
| #7689 | CallElasticsearchAsync |
net6.0 | 1.87μs | 9.08ns | 38.5ns | 0 | 0 | 0 | 1.01 KB |
| #7689 | CallElasticsearchAsync |
netcoreapp3.1 | 2.35μs | 11.7ns | 52.2ns | 0 | 0 | 0 | 1.08 KB |
| #7689 | CallElasticsearchAsync |
net472 | 3.67μs | 3.45ns | 13.4ns | 0.165 | 0 | 0 | 1.1 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 1.96μs | 8.73ns | 33.8ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.34μs | 9.89ns | 38.3ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.57μs | 1.64ns | 6.12ns | 0.141 | 0 | 0 | 915 B |
| #7689 | ExecuteAsync |
net6.0 | 1.84μs | 1.7ns | 6.58ns | 0 | 0 | 0 | 952 B |
| #7689 | ExecuteAsync |
netcoreapp3.1 | 2.41μs | 9.99ns | 38.7ns | 0 | 0 | 0 | 952 B |
| #7689 | ExecuteAsync |
net472 | 2.72μs | 1.04ns | 4.01ns | 0.136 | 0 | 0 | 915 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net6.0 | 6.9μs | 8.06ns | 30.2ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.69μs | 28ns | 108ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.4μs | 11.4ns | 42.6ns | 0.495 | 0 | 0 | 3.18 KB |
| #7689 | SendAsync |
net6.0 | 6.93μs | 18.9ns | 73.3ns | 0 | 0 | 0 | 2.36 KB |
| #7689 | SendAsync |
netcoreapp3.1 | 8.43μs | 24.7ns | 95.6ns | 0 | 0 | 0 | 2.9 KB |
| #7689 | SendAsync |
net472 | 12μs | 9.01ns | 34.9ns | 0.48 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
43.1 KB
45.21 KB
2.1 KB
4.88%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
278.53 KB
290.08 KB
11.55 KB
4.15%
Fewer allocations 🎉 in #7689
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
44.1 KB
42.73 KB
-1.37 KB
-3.10%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
274.47 KB
257.26 KB
-17.22 KB
-6.27%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
65.54 KB
57.34 KB
-8.19 KB
-12.50%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 43.1 KB | 45.21 KB | 2.1 KB | 4.88% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 278.53 KB | 290.08 KB | 11.55 KB | 4.15% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 44.1 KB | 42.73 KB | -1.37 KB | -3.10% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 274.47 KB | 257.26 KB | -17.22 KB | -6.27% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 65.54 KB | 57.34 KB | -8.19 KB | -12.50% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45.1μs | 201ns | 698ns | 0 | 0 | 0 | 43.1 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 48.8μs | 174ns | 628ns | 0 | 0 | 0 | 44.1 KB |
| master | StringConcatBenchmark |
net472 | 56.2μs | 253ns | 979ns | 0 | 0 | 0 | 65.54 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 473μs | 2.03μs | 8.12μs | 0 | 0 | 0 | 278.65 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 509μs | 1.55μs | 6.77μs | 0 | 0 | 0 | 274.47 KB |
| master | StringConcatAspectBenchmark |
net472 | 412μs | 2.36μs | 17μs | 0 | 0 | 0 | 278.53 KB |
| #7689 | StringConcatBenchmark |
net6.0 | 47.7μs | 439ns | 4.17μs | 0 | 0 | 0 | 45.21 KB |
| #7689 | StringConcatBenchmark |
netcoreapp3.1 | 55.5μs | 313ns | 2.6μs | 0 | 0 | 0 | 42.73 KB |
| #7689 | StringConcatBenchmark |
net472 | 57.7μs | 120ns | 450ns | 0 | 0 | 0 | 57.34 KB |
| #7689 | StringConcatAspectBenchmark |
net6.0 | 485μs | 1.92μs | 8.13μs | 0 | 0 | 0 | 279.04 KB |
| #7689 | StringConcatAspectBenchmark |
netcoreapp3.1 | 518μs | 2.04μs | 7.37μs | 0 | 0 | 0 | 257.26 KB |
| #7689 | StringConcatAspectBenchmark |
net472 | 408μs | 2.12μs | 10.4μs | 0 | 0 | 0 | 290.08 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 2.72μs | 13.3ns | 58ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.63μs | 17.8ns | 71.2ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.86μs | 4.37ns | 16.9ns | 0.251 | 0 | 0 | 1.64 KB |
| #7689 | EnrichedLog |
net6.0 | 2.68μs | 13.5ns | 57.3ns | 0 | 0 | 0 | 1.7 KB |
| #7689 | EnrichedLog |
netcoreapp3.1 | 3.69μs | 18.6ns | 80.9ns | 0 | 0 | 0 | 1.7 KB |
| #7689 | EnrichedLog |
net472 | 3.99μs | 5.11ns | 19.8ns | 0.259 | 0 | 0 | 1.64 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 122μs | 103ns | 400ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 136μs | 770ns | 5.28μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 168μs | 82.2ns | 318ns | 0 | 0 | 0 | 4.51 KB |
| #7689 | EnrichedLog |
net6.0 | 123μs | 141ns | 508ns | 0 | 0 | 0 | 4.31 KB |
| #7689 | EnrichedLog |
netcoreapp3.1 | 128μs | 155ns | 560ns | 0 | 0 | 0 | 4.31 KB |
| #7689 | EnrichedLog |
net472 | 169μs | 157ns | 607ns | 0 | 0 | 0 | 4.52 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 5.01μs | 0.968ns | 3.75ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.93μs | 18.4ns | 71.3ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.6μs | 8.88ns | 34.4ns | 0.303 | 0 | 0 | 2.08 KB |
| #7689 | EnrichedLog |
net6.0 | 4.94μs | 18.3ns | 70.7ns | 0 | 0 | 0 | 2.26 KB |
| #7689 | EnrichedLog |
netcoreapp3.1 | 6.95μs | 25.5ns | 98.7ns | 0 | 0 | 0 | 2.26 KB |
| #7689 | EnrichedLog |
net472 | 7.57μs | 7.75ns | 30ns | 0.305 | 0 | 0 | 2.08 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net6.0 | 2μs | 1.83ns | 7.09ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.68μs | 5.16ns | 19.3ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.1μs | 2.24ns | 8.67ns | 0.187 | 0 | 0 | 1.2 KB |
| #7689 | SendReceive |
net6.0 | 1.91μs | 10.3ns | 49.3ns | 0 | 0 | 0 | 1.2 KB |
| #7689 | SendReceive |
netcoreapp3.1 | 2.66μs | 12.4ns | 49.5ns | 0 | 0 | 0 | 1.2 KB |
| #7689 | SendReceive |
net472 | 3.03μs | 0.981ns | 3.8ns | 0.183 | 0 | 0 | 1.2 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net6.0 | 4.39μs | 6.63ns | 24.8ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.78μs | 22.7ns | 87.9ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.34μs | 9.43ns | 36.5ns | 0.316 | 0 | 0 | 2.03 KB |
| #7689 | EnrichedLog |
net6.0 | 4.55μs | 1.89ns | 6.54ns | 0 | 0 | 0 | 1.58 KB |
| #7689 | EnrichedLog |
netcoreapp3.1 | 5.91μs | 18.3ns | 71ns | 0 | 0 | 0 | 1.63 KB |
| #7689 | EnrichedLog |
net472 | 6.69μs | 7.8ns | 30.2ns | 0.3 | 0 | 0 | 2.03 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net6.0 | 810ns | 3.74ns | 16.3ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 1μs | 5.05ns | 22ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 932ns | 0.196ns | 0.735ns | 0.0886 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 944ns | 0.324ns | 1.21ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.17μs | 2.34ns | 9.06ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.1μs | 0.162ns | 0.626ns | 0.104 | 0 | 0 | 658 B |
| master | StartFinishTwoScopes |
net6.0 | 1.77μs | 0.968ns | 3.75ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
netcoreapp3.1 | 2.23μs | 10.5ns | 43.2ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
net472 | 2.15μs | 1.42ns | 5.32ns | 0.161 | 0 | 0 | 1.08 KB |
| #7689 | StartFinishSpan |
net6.0 | 795ns | 0.283ns | 1.06ns | 0 | 0 | 0 | 576 B |
| #7689 | StartFinishSpan |
netcoreapp3.1 | 985ns | 4.74ns | 18.4ns | 0 | 0 | 0 | 576 B |
| #7689 | StartFinishSpan |
net472 | 914ns | 0.103ns | 0.384ns | 0.0916 | 0 | 0 | 578 B |
| #7689 | StartFinishScope |
net6.0 | 950ns | 3.52ns | 13.6ns | 0 | 0 | 0 | 696 B |
| #7689 | StartFinishScope |
netcoreapp3.1 | 1.18μs | 6.46ns | 35.4ns | 0 | 0 | 0 | 696 B |
| #7689 | StartFinishScope |
net472 | 1.13μs | 1.73ns | 6.68ns | 0.101 | 0 | 0 | 658 B |
| #7689 | StartFinishTwoScopes |
net6.0 | 1.76μs | 9.33ns | 47.6ns | 0 | 0 | 0 | 1.19 KB |
| #7689 | StartFinishTwoScopes |
netcoreapp3.1 | 2.22μs | 11.3ns | 51.8ns | 0 | 0 | 0 | 1.19 KB |
| #7689 | StartFinishTwoScopes |
net472 | 2.16μs | 0.878ns | 3.4ns | 0.163 | 0 | 0 | 1.08 KB |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 1.08μs | 0.384ns | 1.49ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.45μs | 7.3ns | 31.8ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.42μs | 0.877ns | 3.4ns | 0.0994 | 0 | 0 | 658 B |
| #7689 | RunOnMethodBegin |
net6.0 | 1.07μs | 5.44ns | 26.1ns | 0 | 0 | 0 | 696 B |
| #7689 | RunOnMethodBegin |
netcoreapp3.1 | 1.44μs | 7.06ns | 29.1ns | 0 | 0 | 0 | 696 B |
| #7689 | RunOnMethodBegin |
net472 | 1.44μs | 3.7ns | 14.3ns | 0.0998 | 0 | 0 | 658 B |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7689) 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 (7689) - mean (76ms) : 70, 82
master - mean (74ms) : 70, 79
section Bailout
This PR (7689) - mean (79ms) : 74, 84
master - mean (80ms) : 75, 84
section CallTarget+Inlining+NGEN
This PR (7689) - mean (1,073ms) : 1006, 1140
master - mean (1,066ms) : 999, 1133
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (117ms) : 110, 125
master - mean (117ms) : 111, 124
section Bailout
This PR (7689) - mean (118ms) : 112, 125
master - mean (119ms) : 111, 127
section CallTarget+Inlining+NGEN
This PR (7689) - mean (759ms) : 718, 800
master - mean (758ms) : 721, 795
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (105ms) : 99, 111
master - mean (105ms) : 99, 111
section Bailout
This PR (7689) - mean (105ms) : 99, 112
master - mean (106ms) : 99, 113
section CallTarget+Inlining+NGEN
This PR (7689) - mean (709ms) : 680, 738
master - mean (706ms) : 680, 733
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (104ms) : 98, 110
master - mean (103ms) : 96, 110
section Bailout
This PR (7689) - mean (105ms) : 99, 111
master - mean (106ms) : 100, 112
section CallTarget+Inlining+NGEN
This PR (7689) - mean (680ms) : 643, 717
master - mean (683ms) : 652, 715
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (194ms) : 190, 198
master - mean (193ms) : 189, 197
section Bailout
This PR (7689) - mean (198ms) : 193, 203
master - mean (197ms) : 195, 199
section CallTarget+Inlining+NGEN
This PR (7689) - mean (1,131ms) : 1049, 1213
master - mean (1,124ms) : 1062, 1187
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (278ms) : 271, 285
master - mean (277ms) : 272, 282
section Bailout
This PR (7689) - mean (278ms) : 274, 282
master - mean (279ms) : 273, 284
section CallTarget+Inlining+NGEN
This PR (7689) - mean (913ms) : 869, 956
master - mean (908ms) : 856, 960
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (271ms) : 265, 276
master - mean (271ms) : 267, 276
section Bailout
This PR (7689) - mean (271ms) : 268, 274
master - mean (271ms) : 268, 275
section CallTarget+Inlining+NGEN
This PR (7689) - mean (888ms) : 837, 938
master - mean (883ms) : 843, 922
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7689) - mean (273ms) : 266, 280
master - mean (272ms) : 266, 278
section Bailout
This PR (7689) - mean (270ms) : 266, 273
master - mean (271ms) : 266, 275
section CallTarget+Inlining+NGEN
This PR (7689) - mean (827ms) : 804, 849
master - mean (827ms) : 808, 847
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
c983088 to
9e2a61b
Compare
c1f7943 to
56bd199
Compare
f242046 to
153e7b3
Compare
56bd199 to
e52fd10
Compare
153e7b3 to
bd34118
Compare
0c28972 to
bea714d
Compare
2a09875 to
279b292
Compare
bea714d to
a6668f3
Compare
279b292 to
9860a88
Compare
… keys (#7688) ## Context Part of **Configuration Inversion (Step 2)** - Stack progress: 1. [#7548](#7548) - Add GitLab step and JSON configuration file 2. **→ [#7688](#7688) - [Config registry] Reorganize keys, split config keys and platform keys(this PR)** 3. [#7698](#7698) - Generate ConfigurationKeys with source generator 4. [#7689](#7689) - Aliases handling and analyzers 5. [#7697](#7697) - Replace manual ConfigurationKeys by generated ones in the whole solution ## Summary Separates platform-specific environment variables into `PlatformKeys` class and adds Roslyn analyzers to enforce proper usage of configuration keys throughout the codebase. ## Changes **Platform Keys Separation:** - Created `PlatformKeys` class for external platform environment variables (AWS, Azure, GCP, Kubernetes, CLR Profiler), those that don't start with DD_ and come from other platforms. - Updated all references throughout codebase to use `PlatformKeys` for platform-specific variables - Keeps `ConfigurationKeys` focused only on Datadog configuration **Roslyn Analyzers:** - **DD0007**: Platform key analyzer - Enforces use of `PlatformKeys` for external platform environment variables - **DD0008**: ConfigurationBuilder analyzer - Enforces use of `ConfigurationKeys` or `PlatformKeys` constants in `ConfigurationBuilder.WithKeys()` calls - Prevents hardcoded strings and ensures type safety **Configuration Mapping:** - Added `configuration_keys_mapping.json` to map environment variable names to their `ConfigurationKeys` constant names, so that we avoid renaming hundreds of variables according to automatically source generated deducted ones. - Enables preservation of original constant names during refactoring - Supports source generator integration **Code Updates:** - Updated `TracerSettings`, test files, and profiler code to use `PlatformKeys` - Replaced manual `ConfigurationKeys` with generated version from `supported-configurations.json` - Added missing `DD_TRACE_LOG_PATH` to configuration registry ## Motivation Ensures clean separation between Datadog and platform configuration by: - Preventing accidental mixing of platform and Datadog keys - Enforcing compile-time validation of configuration key usage - Making it clear which keys are owned by Datadog vs external platforms - Catching configuration errors at build time instead of runtime ## Validation - Roslyn analyzers run on every build - All existing tests pass with updated key references - Analyzers report clear diagnostic messages for violations ## Related Work This PR builds on the configuration registry foundation established in #7548: - **Commit `2639cf0`** added `supported-configurations.json` with ~280 keys, aliases, deprecations, and GitLab CI validation - **Commit `70e632e`** added [supported-configurations-docs.yaml](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml:0:0-0:0) with XML documentation for automated doc generation
a6668f3 to
d90d571
Compare
3197af6 to
e6d6574
Compare
6ccb01e to
ed3a6bc
Compare
dcd2f3c to
196d5e0
Compare
f3473db to
5a68b3b
Compare
196d5e0 to
3d682bd
Compare
5a68b3b to
affec1a
Compare
667cda0 to
888141d
Compare
…#7698) ## Context Part of **Configuration Inversion (Step 3)** - Stack progress: 1. [#7548](#7548) - Add GitLab step and JSON configuration file 2. [#7688](#7688) - Cleanup configuration / platform keys + analyzers 3. **→ [#7698](#7698) - Generate ConfigurationKeys with source generator (this PR)** 4. [#7689](#7689) - Aliases handling via source generator 5. [#7697](#7697) - Replace manual ConfigurationKeys by generated ones in the whole solution ## Summary Adds source generator to auto-generate `ConfigurationKeys` from `supported-configurations.json` with name mapping to preserve existing constant names. ## Changes **Source Generator:** - [ConfigurationKeysGenerator](cci:7://file:///var/folders/4j/q1f1tvc503g_thnq6p79cp500000gp/T/SourceGeneratedDocuments/D0E9C9C62821E2CB6FADE080/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator:0:0-0:0) reads `supported-configurations.json` and [supported-configurations-docs.yaml](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml:0:0-0:0) - Auto-generates `ConfigurationKeys` with nested product classes (AppSec, CIVisibility, OpenTelemetry, etc.) - Generates XML documentation and `[Obsolete]` attributes from JSON **Configuration Mapping:** - `configuration_keys_mapping.json` maps env vars to original constant names (e.g., `DD_TRACE_ENABLED` → `TraceEnabled`) - Avoids refactoring hundreds of references across codebase **Updates:** - Added missing `DD_TRACE_ACTIVITY_LISTENER_ENABLED` key - Committed temporary [ConfigurationKeys2.g.cs](cci:7://file:///Users/anna.yafi/go/src/github.com/DataDog/dd-trace-dotnet3/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys2.g.cs:0:0-0:0) files for validation ## Motivation Makes `supported-configurations.json` the single source of truth while preserving existing constant names to avoid massive refactoring. ## Test Coverage - Added `ConfigurationKeysGeneratorTests.cs` with comprehensive unit tests - Tests validate generator output, XML documentation generation, and obsolete attribute application - Tests cover nested product classes, deprecations, and YAML documentation integration - All existing tests pass without modification ## Related Work Builds on #7548 (configuration registry) and #7688 (PlatformKeys separation + analyzers).
888141d to
1a1742c
Compare
daniel-romano-DD
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.
TY!
…keys or platform keys
rerere
1a1742c to
13b5134
Compare
Context
Part of Configuration Inversion (Step 4) - Stack progress:
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:
ConfigKeyAliasesSwitcherGeneratorreads aliases fromsupported-configurations.jsonConfigurationBuilder Improvements:
ConfigurationBuilder.WithKeys()GetKeyWithAlias()method toIConfigurationSourceinterfaceIntegrationSettings Special Handling:
DD_TRACE_{INTEGRATION}_ENABLED)Roslyn Analyzers:
PlatformKeysAnalyzer- Enforces use ofPlatformKeysfor external platform environment variablesConfigurationBuilderWithKeysAnalyzer- Enforces use of ConfigurationKeys/PlatformKeysconstants inConfigurationBuilder.WithKeys()callsSpecial Cases:
DatadogLoggingFactoryto handle deprecatedDD_TRACE_LOG_PATHwith proper analyzer suppressionMotivation
Completes configuration inversion by:
supported-configurations.jsonTest Coverage
ConfigKeyAliasesSwitcherGeneratorTestswith comprehensive test coveragePlatformKeysAnalyzerTestswith 146 lines of testsConfigurationBuilderWithKeysAnalyzerTestswith 538 lines of testsRelated Work
Builds on #7548 (configuration registry), #7688 (PlatformKeys separation), and #7698 (source generator for ConfigurationKeys).