Skip to content

Conversation

@anna-git
Copy link
Contributor

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

Context

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

  1. #7548 - Add GitLab step and JSON configuration file
  2. #7688 - Cleanup configuration / platform keys + analyzers
  3. #7698 - Generate ConfigurationKeys with source generator (this PR)
  4. #7689 - Aliases handling via source generator
  5. #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 reads supported-configurations.json and supported-configurations-docs.yaml
  • 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_ENABLEDTraceEnabled)
  • Avoids refactoring hundreds of references across codebase

Updates:

  • Added missing DD_TRACE_ACTIVITY_LISTENER_ENABLED key
  • Committed temporary ConfigurationKeys2.g.cs 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).

@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from bd34118 to cbb3933 Compare October 22, 2025 19:40
@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-configuration-aliases-switch-3 branch from cbb3933 to 1cb1163 Compare October 22, 2025 20:12
@pr-commenter
Copy link

pr-commenter bot commented Oct 22, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7698 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.188
  • 10 benchmarks have fewer allocations
  • 5 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 ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.9μs 56.6ns 265ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14μs 72.6ns 340ns 0 0 0 5.73 KB
master StartStopWithChild net472 21.8μs 114ns 605ns 1.01 0.337 0.112 6.05 KB
#7698 StartStopWithChild net6.0 10.2μs 50ns 229ns 0 0 0 5.53 KB
#7698 StartStopWithChild netcoreapp3.1 13.6μs 66.5ns 274ns 0 0 0 5.72 KB
#7698 StartStopWithChild net472 22.1μs 114ns 547ns 0.999 0.333 0.111 6.06 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.35 KB 3.31 KB -46 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 935μs 44.1ns 159ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 480ns 1.86μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.23ms 428ns 1.66μs 0 0 0 3.35 KB
#7698 WriteAndFlushEnrichedTraces net6.0 934μs 56.6ns 212ns 0 0 0 2.7 KB
#7698 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 171ns 661ns 0 0 0 2.7 KB
#7698 WriteAndFlushEnrichedTraces net472 1.21ms 428ns 1.6μs 0 0 0 3.31 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 5.4ns 22.9ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.37μs 7.87ns 63.9ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.01μs 0.432ns 1.62ns 0.191 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.28μs 34.1ns 132ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.17μs 45.4ns 203ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.68μs 5.18ns 20.1ns 0.735 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 333ns 1.73ns 8.46ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 399ns 2ns 8.24ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 299ns 0.164ns 0.637ns 0.0437 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.49μs 23.2ns 89.8ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 8.05μs 41.2ns 189ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.76μs 3.52ns 13.2ns 0.571 0 0 3.8 KB
#7698 AllCycleSimpleBody net6.0 1.09μs 0.736ns 2.75ns 0 0 0 1.22 KB
#7698 AllCycleSimpleBody netcoreapp3.1 1.43μs 8.21ns 59.8ns 0 0 0 1.2 KB
#7698 AllCycleSimpleBody net472 1.01μs 0.934ns 3.5ns 0.191 0 0 1.23 KB
#7698 AllCycleMoreComplexBody net6.0 7.14μs 37.6ns 180ns 0 0 0 4.72 KB
#7698 AllCycleMoreComplexBody netcoreapp3.1 8.88μs 47.4ns 242ns 0 0 0 4.62 KB
#7698 AllCycleMoreComplexBody net472 7.62μs 3.64ns 14.1ns 0.73 0 0 4.74 KB
#7698 ObjectExtractorSimpleBody net6.0 341ns 1.84ns 10.2ns 0 0 0 280 B
#7698 ObjectExtractorSimpleBody netcoreapp3.1 407ns 2.25ns 13.7ns 0 0 0 272 B
#7698 ObjectExtractorSimpleBody net472 302ns 0.116ns 0.449ns 0.0441 0 0 281 B
#7698 ObjectExtractorMoreComplexBody net6.0 6.41μs 31.7ns 145ns 0 0 0 3.78 KB
#7698 ObjectExtractorMoreComplexBody netcoreapp3.1 7.9μs 39.8ns 182ns 0 0 0 3.69 KB
#7698 ObjectExtractorMoreComplexBody net472 6.66μs 2.5ns 9ns 0.599 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 240ns 930ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.7μs 205ns 796ns 0 0 0 32.4 KB
master EncodeArgs net472 110μs 15.5ns 60.1ns 4.98 0 0 32.51 KB
master EncodeLegacyArgs net6.0 149μs 42ns 151ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 128ns 480ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 264μs 142ns 531ns 0 0 0 2.16 KB
#7698 EncodeArgs net6.0 78.4μs 266ns 1.03μs 0 0 0 32.4 KB
#7698 EncodeArgs netcoreapp3.1 95.8μs 327ns 1.27μs 0 0 0 32.4 KB
#7698 EncodeArgs net472 109μs 9.45ns 36.6ns 4.9 0 0 32.51 KB
#7698 EncodeLegacyArgs net6.0 145μs 11.1ns 40ns 0 0 0 2.14 KB
#7698 EncodeLegacyArgs netcoreapp3.1 202μs 107ns 413ns 0 0 0 2.14 KB
#7698 EncodeLegacyArgs net472 265μs 57.5ns 215ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7698

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

Fewer allocations 🎉 in #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 5.14 KB 4.86 KB -288 B -5.60%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0 3.17 KB 2.54 KB -624 B -19.70%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 424μs 856ns 3.09μs 0 0 0 5.14 KB
master RunWafRealisticBenchmark netcoreapp3.1 447μs 1.52μs 5.26μs 0 0 0 4.58 KB
master RunWafRealisticBenchmark net472 495μs 433ns 1.56μs 0 0 0 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 308μs 534ns 1.93μs 0 0 0 3.17 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 367μs 3.92μs 38μs 0 0 0 2.32 KB
master RunWafRealisticBenchmarkWithAttack net472 368μs 307ns 1.11μs 0 0 0 0 b
#7698 RunWafRealisticBenchmark net6.0 422μs 744ns 2.68μs 0 0 0 4.86 KB
#7698 RunWafRealisticBenchmark netcoreapp3.1 452μs 1.59μs 5.74μs 0 0 0 4.58 KB
#7698 RunWafRealisticBenchmark net472 501μs 416ns 1.56μs 0 0 0 8.19 KB
#7698 RunWafRealisticBenchmarkWithAttack net6.0 315μs 887ns 3.2μs 0 0 0 2.54 KB
#7698 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 359μs 3.28μs 31.8μs 0 0 0 2.32 KB
#7698 RunWafRealisticBenchmarkWithAttack net472 375μs 1.39μs 5.37μs 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μs 42.6ns 159ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.4μs 104ns 362ns 0 0 0 17.42 KB
master SendRequest net472 0.16ns 0.00366ns 0.0142ns 0 0 0 0 b
#7698 SendRequest net6.0 60.2μs 86.3ns 323ns 0 0 0 14.52 KB
#7698 SendRequest netcoreapp3.1 72.1μs 271ns 1.27μs 0 0 0 17.42 KB
#7698 SendRequest net472 0.157ns 0.00367ns 0.0142ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7698

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 #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 688 B 304 B -384 B -55.81%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 2.01ms 445ns 1.6μs 0 0 0 640.3 KB
master OriginalCharSlice netcoreapp3.1 3.97ms 1.07μs 3.99μs 0 0 0 640.1 KB
master OriginalCharSlice net472 2.61ms 816ns 3.16μs 0 0 0 647.17 KB
master OptimizedCharSlice net6.0 1.41ms 688ns 2.67μs 0 0 0 976 B
master OptimizedCharSlice netcoreapp3.1 2.78ms 1.29μs 4.82μs 0 0 0 104 B
master OptimizedCharSlice net472 1.94ms 436ns 1.63μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 1.01ms 814ns 3.15μs 0 0 0 688 B
master OptimizedCharSliceWithPool netcoreapp3.1 1.86ms 1.8μs 6.72μs 0 0 0 104 B
master OptimizedCharSliceWithPool net472 1.27ms 2.43μs 9.4μs 0 0 0 0 b
#7698 OriginalCharSlice net6.0 1.97ms 781ns 2.92μs 0 0 0 640.64 KB
#7698 OriginalCharSlice netcoreapp3.1 4.03ms 1.27μs 4.93μs 0 0 0 640.1 KB
#7698 OriginalCharSlice net472 2.62ms 702ns 2.72μs 0 0 0 647.17 KB
#7698 OptimizedCharSlice net6.0 1.44ms 614ns 2.3μs 0 0 0 976 B
#7698 OptimizedCharSlice netcoreapp3.1 2.83ms 1.45μs 5.63μs 0 0 0 104 B
#7698 OptimizedCharSlice net472 2.03ms 1.33μs 5.14μs 0 0 0 8.19 KB
#7698 OptimizedCharSliceWithPool net6.0 1.01ms 605ns 2.18μs 0 0 0 304 B
#7698 OptimizedCharSliceWithPool netcoreapp3.1 1.89ms 1.89μs 7.3μs 0 0 0 104 B
#7698 OptimizedCharSliceWithPool net472 1.15ms 1μs 3.89μs 0 0 0 8.19 KB
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 Fewer allocations 🎉

Faster 🎉 in #7698

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.188 768,220.09 646,591.96

Fewer allocations 🎉 in #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.36 KB 42.13 KB -228 B -0.54%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.03 KB 55.62 KB -412 B -0.74%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 709μs 3.94μs 24.9μs 0 0 0 41.63 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 770μs 2.93μs 13.4μs 0 0 0 42.36 KB
master WriteAndFlushEnrichedTraces net472 861μs 2.69μs 10μs 7.81 0 0 56.03 KB
#7698 WriteAndFlushEnrichedTraces net6.0 666μs 1.31μs 4.89μs 0 0 0 41.62 KB
#7698 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 672ns 2.52μs 0 0 0 42.13 KB
#7698 WriteAndFlushEnrichedTraces net472 871μs 3.94μs 15.8μs 4.46 0 0 55.62 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 10.5ns 52.3ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.59μs 10.7ns 41.3ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.73μs 1.01ns 3.77ns 0.151 0 0 987 B
#7698 ExecuteNonQuery net6.0 1.9μs 8.61ns 33.3ns 0 0 0 1.02 KB
#7698 ExecuteNonQuery netcoreapp3.1 2.72μs 3.43ns 13.3ns 0 0 0 1.02 KB
#7698 ExecuteNonQuery net472 2.8μs 4.18ns 16.2ns 0.152 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.68μs 9.06ns 48.8ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.33μs 9.54ns 36.9ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.55μs 5.4ns 20.9ns 0.16 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.78μs 8.8ns 37.3ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.46μs 11.4ns 45.5ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.83μs 1.42ns 4.91ns 0.174 0 0 1.1 KB
#7698 CallElasticsearch net6.0 1.71μs 7.76ns 30.1ns 0 0 0 1.03 KB
#7698 CallElasticsearch netcoreapp3.1 2.32μs 10.7ns 38.7ns 0 0 0 1.03 KB
#7698 CallElasticsearch net472 3.63μs 4.32ns 16.7ns 0.161 0 0 1.04 KB
#7698 CallElasticsearchAsync net6.0 1.79μs 4.53ns 17.5ns 0 0 0 1.01 KB
#7698 CallElasticsearchAsync netcoreapp3.1 2.47μs 8.94ns 34.6ns 0 0 0 1.08 KB
#7698 CallElasticsearchAsync net472 3.81μs 2.05ns 7.93ns 0.173 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.89μs 6.44ns 24.9ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.45μs 9.74ns 37.7ns 0 0 0 952 B
master ExecuteAsync net472 2.61μs 3.17ns 12.3ns 0.142 0 0 915 B
#7698 ExecuteAsync net6.0 1.87μs 9.26ns 39.3ns 0 0 0 952 B
#7698 ExecuteAsync netcoreapp3.1 2.37μs 11.7ns 49.8ns 0 0 0 952 B
#7698 ExecuteAsync net472 2.69μs 4.07ns 15.8ns 0.134 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.93μs 17.6ns 65.9ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.36μs 23.5ns 90.9ns 0 0 0 2.9 KB
master SendAsync net472 12.4μs 8.43ns 31.5ns 0.5 0 0 3.18 KB
#7698 SendAsync net6.0 7.08μs 23ns 89.1ns 0 0 0 2.36 KB
#7698 SendAsync netcoreapp3.1 8.36μs 16.9ns 65.4ns 0 0 0 2.9 KB
#7698 SendAsync net472 12.2μs 7.59ns 28.4ns 0.49 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 256.53 KB 272.97 KB 16.44 KB 6.41%

Fewer allocations 🎉 in #7698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 43.42 KB 42.74 KB -680 B -1.57%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 275.57 KB 260.04 KB -15.53 KB -5.63%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 73.73 KB 65.54 KB -8.19 KB -11.11%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 417.82 KB 286.72 KB -131.1 KB -31.38%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.6μs 144ns 841ns 0 0 0 43.64 KB
master StringConcatBenchmark netcoreapp3.1 50.5μs 295ns 2.49μs 0 0 0 43.42 KB
master StringConcatBenchmark net472 57.6μs 130ns 504ns 0 0 0 73.73 KB
master StringConcatAspectBenchmark net6.0 494μs 1.78μs 6.4μs 0 0 0 275.57 KB
master StringConcatAspectBenchmark netcoreapp3.1 512μs 2.35μs 8.46μs 0 0 0 256.53 KB
master StringConcatAspectBenchmark net472 407μs 2.17μs 15.8μs 0 0 0 417.82 KB
#7698 StringConcatBenchmark net6.0 46.7μs 359ns 3.44μs 0 0 0 43.78 KB
#7698 StringConcatBenchmark netcoreapp3.1 48.8μs 275ns 1.67μs 0 0 0 42.74 KB
#7698 StringConcatBenchmark net472 56.6μs 241ns 932ns 0 0 0 65.54 KB
#7698 StringConcatAspectBenchmark net6.0 466μs 1.4μs 6.11μs 0 0 0 260.04 KB
#7698 StringConcatAspectBenchmark netcoreapp3.1 522μs 1.56μs 5.63μs 0 0 0 272.97 KB
#7698 StringConcatAspectBenchmark net472 397μs 1.42μs 5.29μs 0 0 0 286.72 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.73μs 1.19ns 4.61ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.63μs 15.6ns 60.3ns 0 0 0 1.7 KB
master EnrichedLog net472 3.72μs 2.28ns 8.82ns 0.26 0 0 1.64 KB
#7698 EnrichedLog net6.0 2.67μs 1.69ns 6.55ns 0 0 0 1.7 KB
#7698 EnrichedLog netcoreapp3.1 3.59μs 13.4ns 52ns 0 0 0 1.7 KB
#7698 EnrichedLog net472 3.84μs 1.92ns 7.45ns 0.251 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 124μs 80.4ns 290ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 129μs 174ns 628ns 0 0 0 4.31 KB
master EnrichedLog net472 168μs 127ns 494ns 0 0 0 4.52 KB
#7698 EnrichedLog net6.0 125μs 164ns 612ns 0 0 0 4.31 KB
#7698 EnrichedLog netcoreapp3.1 129μs 463ns 1.73μs 0 0 0 4.31 KB
#7698 EnrichedLog net472 167μs 108ns 419ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.8μs 23.5ns 91.1ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.79μs 17.7ns 68.6ns 0 0 0 2.26 KB
master EnrichedLog net472 7.53μs 8.52ns 33ns 0.302 0 0 2.08 KB
#7698 EnrichedLog net6.0 5.07μs 5.41ns 20.9ns 0 0 0 2.26 KB
#7698 EnrichedLog netcoreapp3.1 6.73μs 21.1ns 81.9ns 0 0 0 2.26 KB
#7698 EnrichedLog net472 7.63μs 6.85ns 26.5ns 0.301 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.97μs 1.52ns 5.89ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.49μs 12.1ns 48.5ns 0 0 0 1.2 KB
master SendReceive net472 3.24μs 5.93ns 23ns 0.179 0 0 1.2 KB
#7698 SendReceive net6.0 1.99μs 9.62ns 40.8ns 0 0 0 1.2 KB
#7698 SendReceive netcoreapp3.1 2.56μs 13.4ns 64.5ns 0 0 0 1.2 KB
#7698 SendReceive net472 3.07μs 7.35ns 28.5ns 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.35μs 1.22ns 4.56ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.98μs 20.3ns 78.7ns 0 0 0 1.63 KB
master EnrichedLog net472 6.46μs 5.54ns 20.7ns 0.321 0 0 2.03 KB
#7698 EnrichedLog net6.0 4.51μs 21.4ns 82.8ns 0 0 0 1.58 KB
#7698 EnrichedLog netcoreapp3.1 5.91μs 9.66ns 36.1ns 0 0 0 1.63 KB
#7698 EnrichedLog net472 6.62μs 9.26ns 35.9ns 0.297 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 780ns 0.208ns 0.804ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 971ns 5.33ns 30.6ns 0 0 0 576 B
master StartFinishSpan net472 909ns 0.0952ns 0.356ns 0.091 0 0 578 B
master StartFinishScope net6.0 924ns 4.81ns 24.5ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.15μs 5.92ns 26.5ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.311ns 1.21ns 0.0995 0 0 658 B
#7698 StartFinishSpan net6.0 801ns 3.78ns 15.1ns 0 0 0 576 B
#7698 StartFinishSpan netcoreapp3.1 968ns 5.05ns 23.7ns 0 0 0 576 B
#7698 StartFinishSpan net472 938ns 0.0849ns 0.318ns 0.09 0 0 578 B
#7698 StartFinishScope net6.0 928ns 0.157ns 0.608ns 0 0 0 696 B
#7698 StartFinishScope netcoreapp3.1 1.14μs 6.2ns 30.4ns 0 0 0 696 B
#7698 StartFinishScope net472 1.13μs 0.348ns 1.25ns 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.08μs 5.26ns 21.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.4μs 6.19ns 22.3ns 0 0 0 696 B
master RunOnMethodBegin net472 1.45μs 1.54ns 5.95ns 0.102 0 0 658 B
#7698 RunOnMethodBegin net6.0 1.11μs 0.654ns 2.53ns 0 0 0 696 B
#7698 RunOnMethodBegin netcoreapp3.1 1.43μs 4.1ns 15.9ns 0 0 0 696 B
#7698 RunOnMethodBegin net472 1.54μs 2.35ns 9.09ns 0.0991 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 This PR (7698) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration76.58 ± (76.88 - 77.83) ms77.32 ± (77.78 - 78.73) ms+1.0%✅⬆️
.NET Framework 4.8 - Bailout
duration79.89 ± (79.75 - 80.39) ms80.06 ± (80.33 - 81.23) ms+0.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1069.02 ± (1074.30 - 1086.47) ms1081.77 ± (1080.79 - 1089.13) ms+1.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms23.11 ± (23.02 - 23.19) ms23.30 ± (23.21 - 23.39) ms+0.8%✅⬆️
process.time_to_main_ms88.63 ± (88.10 - 89.16) ms90.81 ± (90.23 - 91.38) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.92) MB10.95 ± (10.95 - 10.95) MB+0.3%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms23.13 ± (23.05 - 23.20) ms23.14 ± (23.07 - 23.21) ms+0.1%✅⬆️
process.time_to_main_ms90.91 ± (90.48 - 91.35) ms92.26 ± (91.80 - 92.72) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.99 ± (10.99 - 10.99) MB+0.2%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms224.13 ± (222.61 - 225.64) ms228.23 ± (226.74 - 229.72) ms+1.8%✅⬆️
process.time_to_main_ms508.07 ± (506.50 - 509.65) ms514.79 ± (513.44 - 516.14) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.75 ± (47.73 - 47.77) MB47.80 ± (47.78 - 47.82) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.2%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms22.21 ± (22.11 - 22.30) ms22.36 ± (22.28 - 22.45) ms+0.7%✅⬆️
process.time_to_main_ms79.15 ± (78.68 - 79.62) ms80.94 ± (80.54 - 81.34) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.60) MB10.66 ± (10.65 - 10.66) MB+0.5%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.99 ± (21.91 - 22.07) ms22.05 ± (21.97 - 22.14) ms+0.3%✅⬆️
process.time_to_main_ms79.90 ± (79.44 - 80.36) ms80.25 ± (79.84 - 80.66) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.64 - 10.65) MB10.69 ± (10.68 - 10.69) MB+0.4%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms215.28 ± (213.75 - 216.81) ms214.63 ± (212.94 - 216.33) ms-0.3%
process.time_to_main_ms479.77 ± (478.42 - 481.12) ms482.27 ± (480.97 - 483.56) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.00 ± (47.97 - 48.02) MB48.10 ± (48.07 - 48.12) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms20.18 ± (20.10 - 20.27) ms20.32 ± (20.24 - 20.40) ms+0.7%✅⬆️
process.time_to_main_ms77.50 ± (77.08 - 77.92) ms77.42 ± (76.96 - 77.89) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.67) MB7.67 ± (7.66 - 7.67) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.18 ± (20.10 - 20.26) ms20.22 ± (20.14 - 20.31) ms+0.2%✅⬆️
process.time_to_main_ms79.10 ± (78.64 - 79.56) ms78.74 ± (78.36 - 79.11) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.73) MB7.72 ± (7.71 - 7.73) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms195.31 ± (194.33 - 196.29) ms196.95 ± (195.92 - 197.97) ms+0.8%✅⬆️
process.time_to_main_ms469.22 ± (467.79 - 470.65) ms469.92 ± (468.53 - 471.31) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.47 ± (36.43 - 36.51) MB36.55 ± (36.52 - 36.59) MB+0.2%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration194.66 ± (194.42 - 195.26) ms195.02 ± (195.10 - 195.98) ms+0.2%✅⬆️
.NET Framework 4.8 - Bailout
duration199.71 ± (199.41 - 200.23) ms198.50 ± (198.20 - 198.75) ms-0.6%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1116.86 ± (1121.99 - 1131.74) ms1119.71 ± (1121.32 - 1130.98) ms+0.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms189.21 ± (188.79 - 189.63) ms190.02 ± (189.68 - 190.36) ms+0.4%✅⬆️
process.time_to_main_ms81.67 ± (81.41 - 81.92) ms81.64 ± (81.44 - 81.85) ms-0.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.09 - 16.16) MB16.10 ± (16.08 - 16.13) MB-0.1%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.4%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms189.91 ± (189.49 - 190.33) ms190.48 ± (190.02 - 190.95) ms+0.3%✅⬆️
process.time_to_main_ms83.39 ± (83.18 - 83.60) ms83.48 ± (83.26 - 83.70) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.13 - 16.17) MB16.14 ± (16.12 - 16.17) MB-0.1%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.2%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms399.61 ± (397.31 - 401.92) ms404.58 ± (401.91 - 407.24) ms+1.2%✅⬆️
process.time_to_main_ms478.43 ± (477.43 - 479.44) ms478.39 ± (477.34 - 479.44) ms-0.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.71 ± (58.60 - 58.83) MB58.70 ± (58.59 - 58.82) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.99 ± (192.67 - 193.30) ms194.62 ± (194.18 - 195.07) ms+0.8%✅⬆️
process.time_to_main_ms70.44 ± (70.28 - 70.61) ms70.83 ± (70.64 - 71.03) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.36 ± (16.29 - 16.44) MB16.35 ± (16.32 - 16.37) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+2.4%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.87 ± (191.63 - 192.12) ms194.31 ± (193.83 - 194.80) ms+1.3%✅⬆️
process.time_to_main_ms71.55 ± (71.44 - 71.66) ms71.81 ± (71.67 - 71.95) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.45 ± (16.37 - 16.53) MB16.43 ± (16.36 - 16.50) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+1.5%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms418.29 ± (415.63 - 420.96) ms420.72 ± (417.44 - 424.00) ms+0.6%✅⬆️
process.time_to_main_ms445.57 ± (444.83 - 446.30) ms442.67 ± (442.09 - 443.26) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed59.16 ± (59.04 - 59.27) MB58.85 ± (58.72 - 58.98) MB-0.5%
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (29 - 30)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms191.55 ± (191.12 - 191.98) ms193.56 ± (193.10 - 194.02) ms+1.1%✅⬆️
process.time_to_main_ms70.41 ± (70.24 - 70.59) ms70.46 ± (70.28 - 70.63) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.78 - 11.83) MB11.66 ± (11.65 - 11.68) MB-1.2%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms191.44 ± (191.10 - 191.78) ms193.97 ± (193.39 - 194.55) ms+1.3%✅⬆️
process.time_to_main_ms71.39 ± (71.24 - 71.53) ms71.93 ± (71.72 - 72.13) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.87 ± (11.84 - 11.90) MB11.71 ± (11.69 - 11.73) MB-1.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms367.00 ± (365.53 - 368.48) ms371.11 ± (369.60 - 372.63) ms+1.1%✅⬆️
process.time_to_main_ms433.07 ± (432.47 - 433.66) ms435.06 ± (434.33 - 435.80) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.85 ± (47.83 - 47.88) MB47.88 ± (47.85 - 47.91) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.2%✅⬆️
Comparison explanation

Execution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (78ms)  : 71, 85
    master - mean (77ms)  : 71, 84

    section Bailout
    This PR (7698) - mean (81ms)  : 74, 87
    master - mean (80ms)  : 75, 85

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (1,085ms)  : 1026, 1144
    master - mean (1,080ms)  : 989, 1172

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (123ms)  : 110, 135
    master - mean (119ms)  : 109, 129

    section Bailout
    This PR (7698) - mean (124ms)  : 114, 133
    master - mean (122ms)  : 113, 131

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (785ms)  : 740, 831
    master - mean (773ms)  : 727, 820

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (111ms)  : 101, 121
    master - mean (109ms)  : 98, 119

    section Bailout
    This PR (7698) - mean (110ms)  : 102, 117
    master - mean (109ms)  : 100, 118

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (743ms)  : 696, 789
    master - mean (727ms)  : 686, 769

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (107ms)  : 97, 117
    master - mean (106ms)  : 99, 114

    section Bailout
    This PR (7698) - mean (108ms)  : 99, 116
    master - mean (108ms)  : 98, 118

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (712ms)  : 679, 745
    master - mean (702ms)  : 666, 739

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (196ms)  : 190, 201
    master - mean (195ms)  : 191, 199

    section Bailout
    This PR (7698) - mean (198ms)  : 196, 201
    master - mean (200ms)  : 196, 204

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (1,126ms)  : 1055, 1198
    master - mean (1,127ms)  : 1056, 1197

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (280ms)  : 274, 287
    master - mean (279ms)  : 273, 286

    section Bailout
    This PR (7698) - mean (283ms)  : 276, 289
    master - mean (282ms)  : 272, 292

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (920ms)  : 862, 978
    master - mean (922ms)  : 875, 968

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (274ms)  : 265, 283
    master - mean (272ms)  : 266, 278

    section Bailout
    This PR (7698) - mean (274ms)  : 268, 280
    master - mean (272ms)  : 269, 274

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (894ms)  : 845, 942
    master - mean (902ms)  : 854, 950

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7698) - mean (274ms)  : 265, 282
    master - mean (272ms)  : 265, 278

    section Bailout
    This PR (7698) - mean (276ms)  : 262, 290
    master - mean (273ms)  : 267, 279

    section CallTarget+Inlining+NGEN
    This PR (7698) - mean (840ms)  : 816, 864
    master - mean (831ms)  : 806, 856

Loading

@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 51a880e to bc30cd6 Compare October 22, 2025 22:48
@datadog-official

This comment has been minimized.

@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from bc30cd6 to c57648c Compare October 23, 2025 10:19
@anna-git anna-git changed the title [ConfigRegistry] Aliases handling via source generator [ConfigRegistry] Generate ConfigurationKeys from json and yaml file for docs Oct 23, 2025
@anna-git anna-git changed the title [ConfigRegistry] Generate ConfigurationKeys from json and yaml file for docs [ConfigRegistry] Generate ConfigurationKeys with source generator Oct 23, 2025
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch 3 times, most recently from 2133185 to 13488c5 Compare October 23, 2025 12:16
@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 force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 13488c5 to a31063c Compare October 23, 2025 13:26
@anna-git anna-git changed the title [ConfigRegistry] Generate ConfigurationKeys with source generator [ConfigRegistry] 3/5 Generate ConfigurationKeys with source generator Oct 23, 2025
@anna-git anna-git marked this pull request as ready for review October 24, 2025 10:26
@anna-git anna-git requested review from a team as code owners October 24, 2025 10:26
@lucaspimentel
Copy link
Member

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🎉

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

Base automatically changed from anna/config-inversion-configuration-keys-rework-2 to master October 30, 2025 17:12
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch 3 times, most recently from 6ccb01e to ed3a6bc Compare October 31, 2025 01:39
@anna-git
Copy link
Contributor Author

Nice, LGTM.

The generation work is somewhat heavy so I was just randomly wondering if we should try to add some sort of caching layer to not-regenerate everything on the first project load if nothing has changed, but I'm not sure exactly how to do that or anything right now, so just mentioning it as food for thought 😄

like keeping a file somewhere containing a hash of the 3 files? and comparing the hash on load?
Maybe if we see build is too long, we could try adding it later to cut down some time?

@andrewlock
Copy link
Member

Nice, LGTM.
The generation work is somewhat heavy so I was just randomly wondering if we should try to add some sort of caching layer to not-regenerate everything on the first project load if nothing has changed, but I'm not sure exactly how to do that or anything right now, so just mentioning it as food for thought 😄

like keeping a file somewhere containing a hash of the 3 files? and comparing the hash on load? Maybe if we see build is too long, we could try adding it later to cut down some time?

Yeah, something like that 🙂 Honestly it was only a random idea, and in general you shouldn't write files from source generators (they have analyzers to make sure you don't) so it would mean adding something somewhere we could read it. Not something I've ever tried or anything, no idea if it would be worth it, and absolutely not suggesting you should do it, just something I might R&D one day 😄

diagnostics.AddRange(yamlResult.Errors);
diagnostics.AddRange(mappingResult.Errors);

if (jsonResult.Value is null)
Copy link
Member

@lucaspimentel lucaspimentel Nov 5, 2025

Choose a reason for hiding this comment

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

jsonResult.Value can never be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it could be if the json array is empty.. but this would certainly be a bug..

}

// Generate source code even if there are errors (use empty configuration as fallback)
var configData = result.Value ?? new ConfigurationData(new Dictionary<string, ConfigEntry>(), null);
Copy link
Member

Choose a reason for hiding this comment

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

result.Value can never be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it could be given that MergeResults return a null wrapped if the json doc is not present.. but this shouldn't happen...

var trimmedLine = line.TrimStart();

// Check if line contains seealso tag (self-closing /> or closing </seealso>) as we need to extract it
if (trimmedLine.StartsWith("<seealso") && (trimmedLine.Contains("/>") || trimmedLine.Contains("</seealso>")))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (trimmedLine.StartsWith("<seealso") && (trimmedLine.Contains("/>") || trimmedLine.Contains("</seealso>")))
if (trimmedLine.StartsWith("<seealso", StringComparison.Ordinal) && (trimmedLine.Contains("/>") || trimmedLine.Contains("</seealso>")))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes changed in 28e3698

{
foreach (var productName in productNames)
{
if (pascalName!.Length > productName.Length &&
Copy link
Member

Choose a reason for hiding this comment

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

pascalName can't be null?

Suggested change
if (pascalName!.Length > productName.Length &&
if (pascalName.Length > productName.Length &&

Copy link
Contributor Author

@anna-git anna-git Nov 25, 2025

Choose a reason for hiding this comment

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

yes, changed in 85deee3

Copy link
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

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

only some nit-picky comments about nullability and string comparisons

/// <summary>
/// Configuration key to enable or disable the ActivityListener.
/// </summary>
public const string ActivityListenerEnabled = "DD_TRACE_ACTIVITY_LISTENER_ENABLED";
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for follow-up: This key logically belongs with the OpenTelemetry set of environment variables

Copy link
Contributor Author

@anna-git anna-git Nov 25, 2025

Choose a reason for hiding this comment

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

thanks, changed in 8776673

}

[Fact]
public void SortsEntriesAlphabetically()
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit to be even more precise

Suggested change
public void SortsEntriesAlphabetically()
public void SortsEntriesAlphabeticallyByEnvironmentVariable()

Copy link
Contributor Author

@anna-git anna-git Nov 25, 2025

Choose a reason for hiding this comment

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

yes! changed in 85deee3

Copy link
Contributor

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

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

LGTM. I actually reviewed this only looking at the generated files and tests, and by that measure these changes look great 👍🏼

@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from f3473db to 5a68b3b Compare November 25, 2025 16:33
@anna-git anna-git force-pushed the anna/config-inversion-configuration-aliases-switch-3 branch from 5a68b3b to affec1a Compare November 25, 2025 20:08
@anna-git anna-git merged commit 68dfdf8 into master Nov 26, 2025
151 checks passed
@anna-git anna-git deleted the anna/config-inversion-configuration-aliases-switch-3 branch November 26, 2025 10:26
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 26, 2025
andrewlock added a commit that referenced this pull request Nov 26, 2025
## Summary of changes

- Fix broken `master` due to concurrent merges of conflicting 

## Reason for change

#7698 moved to defining references in yaml, and in #7723, some of those
references moved, which broke the build

## Implementation details

Update the YAML file and rebuild

## Test coverage

If it builds, we're good!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants