Skip to content

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Sep 24, 2025

As part of Config inversion second step, this is part of stack:
Add gitlab step and json configuration file > #7548
Cleanup config keys constants, check them against local json file > #7556
Aliases handling > #7565
Analyzers to guard platform and configurationbuilder > #7575

Summary of changes

  • Split platform-specific environment variables from Datadog configuration keys by creating a new PlatformKeys class
  • Added Nuke build step CheckConfigurationKeysAgainstJsonValidations to validate that all ConfigurationKeys constants are present in supported-configurations.json
  • Updated all references throughout the codebase to use PlatformKeys for external platform environment variables
  • Added missing DD_TRACE_ACTIVITY_LISTENER_ENABLED key to ConfigurationKeys
  • Fixed profiler-related key references to use appropriate classes

Reason for change

After adding supported-configurations.json in PR #7548, we need to ensure that:

  1. All configuration keys defined in ConfigurationKeys class are documented in the JSON file
  2. Platform-specific environment variables (from AWS, Azure, GCP, etc.) are separated from Datadog configuration keys
  3. The JSON file remains synchronized with the codebase as new keys are added

Without this validation, developers could:

  • Add new configuration keys to ConfigurationKeys but forget to add them to supported-configurations.json
  • Mix platform environment variables with Datadog configuration, making the JSON file confusing
  • Create inconsistencies between the code and documentation

Implementation details

PlatformKeys class creation:

  • Extracted platform-specific environment variables from ConfigurationKeys into new PlatformKeys class
  • Platform keys include:
    • AWS: AWS_LAMBDA_FUNCTION_NAME, AWS_REGION, etc.
    • Azure App Service: WEBSITE_SITE_NAME, WEBSITE_RESOURCE_GROUP, etc.
    • Azure Functions: FUNCTIONS_WORKER_RUNTIME, FUNCTIONS_EXTENSION_VERSION, etc.
    • GCP Functions: FUNCTION_NAME, FUNCTION_REGION, K_SERVICE, etc.
    • CLR Profiler: CORECLR_PROFILER, CORECLR_PROFILER_PATH, COR_PROFILER, etc.
    • Kubernetes: KUBERNETES_SERVICE_HOST, DD_ENTITY_ID, etc.

Nuke validation step:

Target CheckConfigurationKeysAgainstJsonValidations => _ => _
    .Description("Validates that all ConfigurationKeys constants are present in supported-configurations.json")
    .After(CompileManagedSrc)
    .Executes(() =>
    {
        // 1. Parse supported-configurations.json
        // 2. Use reflection to extract all const string fields from ConfigurationKeys
        // 3. Compare and report:
        //    - Keys in code but missing from JSON (ERROR)
        //    - Keys in JSON but missing from code (WARNING)
    });

Validation logic:

  • Loads the net6.0 assembly to analyze ConfigurationKeys class
  • Extracts all public const string fields from ConfigurationKeys and nested classes
  • Compares against supportedConfigurations, aliases, and deprecations sections in JSON
  • Reports errors if keys are defined in code but not documented in JSON
  • Reports warnings if keys are in JSON but not in code (potential cleanup needed)

Updated references:

  • TracerSettings: Changed Azure/AWS/GCP key references to use PlatformKeys
  • Test files: Updated to use PlatformKeys for platform environment variables
  • Profiler code: Fixed references to use appropriate key classes

Added missing key:

  • DD_TRACE_ACTIVITY_LISTENER_ENABLED was being used in code but not defined as a constant

Test coverage

  • Nuke step runs after CompileManagedSrc to validate synchronization
  • Uses reflection to analyze compiled assemblies, ensuring accuracy
  • Reports detailed error messages with field paths (e.g., ConfigurationKeys.AzureAppService.SiteNameKey)
  • All existing tests updated to use correct key classes

Other details

Benefits:

  • Prevents drift: Compile-time check ensures JSON stays synchronized with code
  • Clear separation: Platform keys vs Datadog configuration keys are now distinct
  • Better documentation: supported-configurations.json only contains Datadog-specific keys
  • Easier maintenance: Developers get immediate feedback if they forget to update JSON

Example validation output:

Configuration keys defined in ConfigurationKeys but missing from supported-configurations.json:
  - DD_TRACE_ENABLED (defined as ConfigurationKeys.TraceEnabled)
  - DD_SERVICE (defined as ConfigurationKeys.ServiceName)

Configuration keys in supported-configurations.json but not defined in ConfigurationKeys:
  - DD_DEPRECATED_KEY

Future improvements:

  • Could add a code fix/analyzer to automatically suggest adding keys to JSON
  • Could generate JSON file automatically from ConfigurationKeys class
  • Could add validation to CI pipeline to block PRs that break synchronization

This PR builds on #7548 (add supported-configurations.json) and is a prerequisite for future PRs that will add Roslyn analyzers to enforce usage of these centralized constants.

@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch 2 times, most recently from 7dbf345 to 8d4256d Compare September 24, 2025 13:31
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from 65fbbec to 3bb22a8 Compare September 24, 2025 13:43
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Sep 24, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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

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

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

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

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

    section Baseline
    This PR (7556) - mean (68ms)  : 66, 71
     .   : milestone, 68,
    master - mean (68ms)  : 66, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (1,052ms)  : 999, 1105
     .   : milestone, 1052,
    master - mean (1,056ms)  : 985, 1127
     .   : milestone, 1056,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7556) - mean (107ms)  : 105, 108
     .   : milestone, 107,
    master - mean (106ms)  : 105, 108
     .   : milestone, 106,

    section Baseline
    This PR (7556) - mean (106ms)  : 103, 108
     .   : milestone, 106,
    master - mean (106ms)  : 103, 108
     .   : milestone, 106,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (742ms)  : 721, 763
     .   : milestone, 742,
    master - mean (750ms)  : 700, 799
     .   : milestone, 750,

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

    section Baseline
    This PR (7556) - mean (101ms)  : 98, 103
     .   : milestone, 101,
    master - mean (100ms)  : 98, 102
     .   : milestone, 100,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (774ms)  : 731, 816
     .   : milestone, 774,
    master - mean (779ms)  : 738, 820
     .   : milestone, 779,

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

    section Baseline
    This PR (7556) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 95
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (661ms)  : 646, 675
     .   : milestone, 661,
    master - mean (663ms)  : 648, 679
     .   : milestone, 663,

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

    section Baseline
    This PR (7556) - mean (194ms)  : 190, 198
     .   : milestone, 194,
    master - mean (194ms)  : 189, 199
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (1,168ms)  : 1111, 1226
     .   : milestone, 1168,
    master - mean (1,168ms)  : 1113, 1223
     .   : milestone, 1168,

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

    section Baseline
    This PR (7556) - mean (278ms)  : 272, 284
     .   : milestone, 278,
    master - mean (278ms)  : 273, 283
     .   : milestone, 278,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (940ms)  : 902, 979
     .   : milestone, 940,
    master - mean (944ms)  : 882, 1007
     .   : milestone, 944,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7556) - mean (282ms)  : 278, 286
     .   : milestone, 282,
    master - mean (282ms)  : 277, 287
     .   : milestone, 282,

    section Baseline
    This PR (7556) - mean (283ms)  : 278, 288
     .   : milestone, 283,
    master - mean (283ms)  : 276, 290
     .   : milestone, 283,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (998ms)  : 964, 1032
     .   : milestone, 998,
    master - mean (996ms)  : 957, 1035
     .   : milestone, 996,

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

    section Baseline
    This PR (7556) - mean (271ms)  : 264, 278
     .   : milestone, 271,
    master - mean (270ms)  : 266, 274
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (7556) - mean (853ms)  : 833, 873
     .   : milestone, 853,
    master - mean (857ms)  : 837, 877
     .   : milestone, 857,

Loading

@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from 3bb22a8 to cbb3593 Compare September 24, 2025 16:41
@anna-git anna-git changed the title Anna/config inversion check configurationkeys are in json [Config inversion] inversion check configurationkeys are in json Sep 25, 2025
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch 2 times, most recently from d340651 to aef9602 Compare September 25, 2025 12:24
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 8d4256d to afa84af Compare September 25, 2025 12:24
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch 2 times, most recently from 57a0761 to 437db7e Compare September 25, 2025 15:01
@datadog-datadog-prod-us1

This comment has been minimized.

@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from afa84af to 05247c7 Compare September 29, 2025 11:55
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from 437db7e to e4fb133 Compare September 29, 2025 11:55
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 05247c7 to c50a9c1 Compare September 29, 2025 12:26
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from e4fb133 to bc2ad02 Compare September 29, 2025 12:27
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from c50a9c1 to 7dbfceb Compare September 29, 2025 14:07
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch 2 times, most recently from 5a9a712 to 6d51e76 Compare September 29, 2025 14:12
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 7dbfceb to 56b17eb Compare September 29, 2025 15:37
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from 6d51e76 to f9bb5ba Compare September 29, 2025 15:37
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 56b17eb to 7fb125e Compare September 29, 2025 17:34
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from f9bb5ba to 1bc1b38 Compare September 29, 2025 17:34
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 7fb125e to 25fa9a0 Compare October 2, 2025 09:49
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch 2 times, most recently from 3ab9889 to e31264e Compare October 3, 2025 10:33
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 25fa9a0 to b7cefbd Compare October 6, 2025 14:23
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from e31264e to 416672b Compare October 6, 2025 14:23
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from b7cefbd to 6dfb9a9 Compare October 7, 2025 09:53
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from 416672b to be5f635 Compare October 7, 2025 09:53
@pr-commenter
Copy link

pr-commenter bot commented Oct 8, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7556 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.420
  • 1 benchmarks are slower, with geometric mean 1.118
  • 4 benchmarks have fewer allocations
  • 12 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.69 KB 5.72 KB 38 B 0.67%

Fewer allocations 🎉 in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.11 KB 6.07 KB -46 B -0.75%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.5μs 58.5ns 361ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14μs 70.9ns 333ns 0 0 0 5.69 KB
master StartStopWithChild net472 22.1μs 119ns 676ns 0.952 0.212 0 6.11 KB
#7556 StartStopWithChild net6.0 10.3μs 58.9ns 441ns 0 0 0 5.51 KB
#7556 StartStopWithChild netcoreapp3.1 13.2μs 68.8ns 323ns 0 0 0 5.72 KB
#7556 StartStopWithChild net472 22.2μs 113ns 494ns 0.996 0.332 0.111 6.07 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 927μs 173ns 624ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.05ms 599ns 2.32μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.18ms 71.7ns 268ns 0 0 0 3.31 KB
#7556 WriteAndFlushEnrichedTraces net6.0 929μs 224ns 867ns 0 0 0 2.7 KB
#7556 WriteAndFlushEnrichedTraces netcoreapp3.1 1.01ms 139ns 502ns 0 0 0 2.7 KB
#7556 WriteAndFlushEnrichedTraces net472 1.18ms 97.2ns 377ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7556

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑netcoreapp3.1 1.118 506,944.43 566,747.78

More allocations ⚠️ in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 178.25 KB 190.14 KB 11.89 KB 6.67%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 181.77 KB 193.64 KB 11.87 KB 6.53%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑netcoreapp3.1 184.01 KB 195.88 KB 11.87 KB 6.45%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑netcoreapp3.1 187.44 KB 199.31 KB 11.87 KB 6.33%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 203.96 KB 216.4 KB 12.44 KB 6.10%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 207.5 KB 219.94 KB 12.44 KB 6.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 345μs 1.64μs 6.75μs 0 0 0 178.25 KB
master AllCycleSimpleBody netcoreapp3.1 505μs 1.46μs 5.66μs 0 0 0 184.01 KB
master AllCycleSimpleBody net472 462μs 84ns 314ns 31.2 0 0 203.96 KB
master AllCycleMoreComplexBody net6.0 353μs 1.01μs 3.76μs 0 0 0 181.77 KB
master AllCycleMoreComplexBody netcoreapp3.1 502μs 1.71μs 6.61μs 0 0 0 187.44 KB
master AllCycleMoreComplexBody net472 472μs 97.3ns 351ns 32.4 0 0 207.5 KB
master ObjectExtractorSimpleBody net6.0 325ns 0.203ns 0.784ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 388ns 2.21ns 15.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 308ns 0.0144ns 0.05ns 0.0445 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.39μs 31.1ns 136ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.77μs 35.6ns 138ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.75μs 1.81ns 6.79ns 0.573 0 0 3.8 KB
#7556 AllCycleSimpleBody net6.0 364μs 1.33μs 4.98μs 0 0 0 190.14 KB
#7556 AllCycleSimpleBody netcoreapp3.1 568μs 1.58μs 6.1μs 0 0 0 195.88 KB
#7556 AllCycleSimpleBody net472 495μs 176ns 660ns 33.7 0 0 216.4 KB
#7556 AllCycleMoreComplexBody net6.0 375μs 390ns 1.46μs 0 0 0 193.64 KB
#7556 AllCycleMoreComplexBody netcoreapp3.1 546μs 2.28μs 8.82μs 0 0 0 199.31 KB
#7556 AllCycleMoreComplexBody net472 504μs 120ns 463ns 32.5 0 0 219.94 KB
#7556 ObjectExtractorSimpleBody net6.0 324ns 0.137ns 0.492ns 0 0 0 280 B
#7556 ObjectExtractorSimpleBody netcoreapp3.1 397ns 2.23ns 12.4ns 0 0 0 272 B
#7556 ObjectExtractorSimpleBody net472 301ns 0.0171ns 0.0641ns 0.0439 0 0 281 B
#7556 ObjectExtractorMoreComplexBody net6.0 6.32μs 30.6ns 130ns 0 0 0 3.78 KB
#7556 ObjectExtractorMoreComplexBody netcoreapp3.1 7.84μs 17.5ns 67.6ns 0 0 0 3.69 KB
#7556 ObjectExtractorMoreComplexBody net472 6.66μs 1.03ns 3.97ns 0.6 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 78.7μs 87.4ns 327ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.3μs 231ns 896ns 0 0 0 32.4 KB
master EncodeArgs net472 109μs 13.2ns 49.4ns 4.9 0 0 32.51 KB
master EncodeLegacyArgs net6.0 147μs 193ns 749ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 198μs 183ns 709ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 265μs 109ns 423ns 0 0 0 2.16 KB
#7556 EncodeArgs net6.0 77μs 235ns 879ns 0 0 0 32.4 KB
#7556 EncodeArgs netcoreapp3.1 98.2μs 223ns 771ns 0 0 0 32.4 KB
#7556 EncodeArgs net472 110μs 79.1ns 274ns 4.96 0 0 32.51 KB
#7556 EncodeLegacyArgs net6.0 145μs 28.4ns 110ns 0 0 0 2.14 KB
#7556 EncodeLegacyArgs netcoreapp3.1 202μs 40.9ns 148ns 0 0 0 2.14 KB
#7556 EncodeLegacyArgs net472 264μs 216ns 835ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7556

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.120 874,284.38 412,466.67

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 409μs 147ns 510ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 819μs 11.4μs 113μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 434μs 80.3ns 311ns 0 0 0 4.68 KB
master RunWafRealisticBenchmarkWithAttack net6.0 296μs 62.9ns 244ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 224ns 866ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 312μs 56.3ns 218ns 0 0 0 2.29 KB
#7556 RunWafRealisticBenchmark net6.0 391μs 75.2ns 291ns 0 0 0 4.55 KB
#7556 RunWafRealisticBenchmark netcoreapp3.1 413μs 70.5ns 244ns 0 0 0 4.48 KB
#7556 RunWafRealisticBenchmark net472 435μs 13.8ns 49.6ns 0 0 0 4.66 KB
#7556 RunWafRealisticBenchmarkWithAttack net6.0 285μs 32.1ns 111ns 0 0 0 2.24 KB
#7556 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 297μs 46.5ns 168ns 0 0 0 2.22 KB
#7556 RunWafRealisticBenchmarkWithAttack net472 316μs 26.2ns 101ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 62μs 56.9ns 220ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.8μs 106ns 381ns 0 0 0 17.42 KB
master SendRequest net472 0.00389ns 0.0018ns 0.00698ns 0 0 0 0 b
#7556 SendRequest net6.0 61.7μs 61.6ns 239ns 0 0 0 14.52 KB
#7556 SendRequest netcoreapp3.1 71.7μs 54ns 209ns 0 0 0 17.42 KB
#7556 SendRequest net472 0.00112ns 0.000903ns 0.0035ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 4 B 7 B 3 B 75.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.95ms 609ns 2.28μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.06ms 4.72μs 17.7μs 0 0 0 640 KB
master OriginalCharSlice net472 2.71ms 1.73μs 6.7μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.51ms 210ns 814ns 0 0 0 4 B
master OptimizedCharSlice netcoreapp3.1 1.67ms 365ns 1.42μs 0 0 0 1 B
master OptimizedCharSlice net472 1.94ms 249ns 965ns 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 807μs 59.1ns 229ns 0 0 0 1 B
master OptimizedCharSliceWithPool netcoreapp3.1 835μs 151ns 586ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.2ms 197ns 738ns 0 0 0 0 b
#7556 OriginalCharSlice net6.0 1.88ms 6.39μs 24.7μs 0 0 0 640 KB
#7556 OriginalCharSlice netcoreapp3.1 2.08ms 7.2μs 26.9μs 0 0 0 640 KB
#7556 OriginalCharSlice net472 2.66ms 284ns 1.02μs 100 0 0 641.95 KB
#7556 OptimizedCharSlice net6.0 1.44ms 50ns 187ns 0 0 0 7 B
#7556 OptimizedCharSlice netcoreapp3.1 1.68ms 226ns 876ns 0 0 0 1 B
#7556 OptimizedCharSlice net472 1.94ms 175ns 679ns 0 0 0 0 b
#7556 OptimizedCharSliceWithPool net6.0 801μs 72.8ns 272ns 0 0 0 1 B
#7556 OptimizedCharSliceWithPool netcoreapp3.1 812μs 235ns 912ns 0 0 0 0 b
#7556 OptimizedCharSliceWithPool net472 1.18ms 88.5ns 343ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7556

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.181 765,567.19 648,112.72

More allocations ⚠️ in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.97 KB 56.63 KB 659 B 1.18%

Fewer allocations 🎉 in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.29 KB 41.84 KB -452 B -1.07%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 695μs 4.01μs 33.8μs 0 0 0 41.82 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 759μs 4.01μs 20.4μs 0 0 0 42.29 KB
master WriteAndFlushEnrichedTraces net472 987μs 3.03μs 11.3μs 4.81 0 0 55.97 KB
#7556 WriteAndFlushEnrichedTraces net6.0 737μs 4.1μs 27.2μs 0 0 0 41.82 KB
#7556 WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 2.74μs 10.6μs 0 0 0 41.84 KB
#7556 WriteAndFlushEnrichedTraces net472 890μs 2.66μs 10.3μs 8.33 0 0 56.63 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.92μs 9.49ns 39.1ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.57μs 11.6ns 44.8ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.77μs 5.69ns 21.3ns 0.15 0.0136 0 987 B
#7556 ExecuteNonQuery net6.0 1.96μs 8.59ns 29.8ns 0 0 0 1.02 KB
#7556 ExecuteNonQuery netcoreapp3.1 2.58μs 7.55ns 28.3ns 0 0 0 1.02 KB
#7556 ExecuteNonQuery net472 2.7μs 3.78ns 14.6ns 0.151 0.0137 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.75μs 7.58ns 36.4ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.32μs 11.3ns 46.7ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.5μs 4ns 15.5ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.84μs 6.28ns 24.3ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.43μs 8.84ns 34.2ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.88μs 3.58ns 13.4ns 0.173 0 0 1.1 KB
#7556 CallElasticsearch net6.0 1.73μs 8.89ns 41.7ns 0 0 0 1.03 KB
#7556 CallElasticsearch netcoreapp3.1 2.27μs 8.54ns 32ns 0 0 0 1.03 KB
#7556 CallElasticsearch net472 3.45μs 3.07ns 11.9ns 0.154 0 0 1.04 KB
#7556 CallElasticsearchAsync net6.0 1.86μs 1.67ns 6.47ns 0 0 0 1.01 KB
#7556 CallElasticsearchAsync netcoreapp3.1 2.41μs 1.58ns 6.13ns 0 0 0 1.08 KB
#7556 CallElasticsearchAsync net472 3.71μs 3.46ns 13.4ns 0.166 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 2.01μs 8.69ns 33.6ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.33μs 9.79ns 35.3ns 0 0 0 952 B
master ExecuteAsync net472 2.52μs 7.62ns 29.5ns 0.141 0 0 915 B
#7556 ExecuteAsync net6.0 1.92μs 7.47ns 28.9ns 0 0 0 952 B
#7556 ExecuteAsync netcoreapp3.1 2.38μs 6.18ns 23.9ns 0 0 0 952 B
#7556 ExecuteAsync net472 2.53μs 3.28ns 12.7ns 0.139 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.98μs 5.84ns 20.2ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.65μs 24.5ns 91.5ns 0 0 0 2.9 KB
master SendAsync net472 12.3μs 12.9ns 50.1ns 0.493 0 0 3.18 KB
#7556 SendAsync net6.0 7.12μs 9.79ns 37.9ns 0 0 0 2.36 KB
#7556 SendAsync netcoreapp3.1 8.49μs 21.6ns 83.6ns 0 0 0 2.9 KB
#7556 SendAsync net472 12.3μs 11.2ns 43.3ns 0.49 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7556

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 1.144 553,600.00 483,800.00

More allocations ⚠️ in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 42.78 KB 45.13 KB 2.34 KB 5.48%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 248.67 KB 257.59 KB 8.92 KB 3.59%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 286.72 KB 8.19 KB 2.94%

Fewer allocations 🎉 in #7556

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 277.88 KB 273.61 KB -4.27 KB -1.54%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.9 KB 43.78 KB -1.12 KB -2.49%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 51.7μs 809ns 8μs 0 0 0 44.9 KB
master StringConcatBenchmark netcoreapp3.1 50.4μs 444ns 4.28μs 0 0 0 42.78 KB
master StringConcatBenchmark net472 57.4μs 281ns 1.16μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 555μs 2.58μs 9.65μs 0 0 0 277.88 KB
master StringConcatAspectBenchmark netcoreapp3.1 523μs 2.44μs 9.11μs 0 0 0 248.67 KB
master StringConcatAspectBenchmark net472 404μs 2.29μs 16.8μs 0 0 0 278.53 KB
#7556 StringConcatBenchmark net6.0 44.3μs 239ns 1.78μs 0 0 0 43.78 KB
#7556 StringConcatBenchmark netcoreapp3.1 49.6μs 286ns 2.12μs 0 0 0 45.13 KB
#7556 StringConcatBenchmark net472 56.4μs 237ns 978ns 0 0 0 57.34 KB
#7556 StringConcatAspectBenchmark net6.0 485μs 1.69μs 7.38μs 0 0 0 273.61 KB
#7556 StringConcatAspectBenchmark netcoreapp3.1 494μs 2.03μs 7.31μs 0 0 0 257.59 KB
#7556 StringConcatAspectBenchmark net472 408μs 2.11μs 10.3μ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.48μs 8.94ns 34.6ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.58μs 12.9ns 50.1ns 0 0 0 1.7 KB
master EnrichedLog net472 3.78μs 6.93ns 26.9ns 0.246 0 0 1.64 KB
#7556 EnrichedLog net6.0 2.49μs 13.1ns 70.6ns 0 0 0 1.7 KB
#7556 EnrichedLog netcoreapp3.1 3.46μs 14.6ns 58.5ns 0 0 0 1.7 KB
#7556 EnrichedLog net472 3.76μs 3.97ns 15.4ns 0.243 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 125μs 546ns 2.5μs 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 127μs 133ns 498ns 0 0 0 4.31 KB
master EnrichedLog net472 167μs 105ns 405ns 0 0 0 4.52 KB
#7556 EnrichedLog net6.0 124μs 361ns 1.4μs 0 0 0 4.31 KB
#7556 EnrichedLog netcoreapp3.1 128μs 191ns 741ns 0 0 0 4.31 KB
#7556 EnrichedLog net472 167μs 40.9ns 153ns 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.98μs 10.8ns 41.6ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.8μs 13.1ns 50.6ns 0 0 0 2.26 KB
master EnrichedLog net472 7.26μs 5.4ns 20.9ns 0.325 0 0 2.08 KB
#7556 EnrichedLog net6.0 4.94μs 2.43ns 9.41ns 0 0 0 2.26 KB
#7556 EnrichedLog netcoreapp3.1 6.82μs 13.1ns 50.9ns 0 0 0 2.26 KB
#7556 EnrichedLog net472 7.51μs 9.16ns 35.5ns 0.298 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.94μs 10.1ns 50.5ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.86μs 7.7ns 29.8ns 0 0 0 1.2 KB
master SendReceive net472 3.05μs 4.77ns 18.5ns 0.186 0 0 1.2 KB
#7556 SendReceive net6.0 2.05μs 10.2ns 44.3ns 0 0 0 1.2 KB
#7556 SendReceive netcoreapp3.1 2.58μs 12.1ns 50ns 0 0 0 1.2 KB
#7556 SendReceive net472 3.11μs 2.83ns 10.9ns 0.187 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.16μs 17.2ns 61.9ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.47μs 12.8ns 49.6ns 0 0 0 1.63 KB
master EnrichedLog net472 6.43μs 4.53ns 16.3ns 0.322 0 0 2.03 KB
#7556 EnrichedLog net6.0 4.15μs 17.7ns 68.7ns 0 0 0 1.58 KB
#7556 EnrichedLog netcoreapp3.1 5.56μs 13.4ns 50.2ns 0 0 0 1.63 KB
#7556 EnrichedLog net472 6.65μs 8ns 31ns 0.298 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 742ns 3.39ns 13.6ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 919ns 0.601ns 2.33ns 0 0 0 576 B
master StartFinishSpan net472 891ns 0.563ns 2.18ns 0.0895 0 0 578 B
master StartFinishScope net6.0 878ns 4.86ns 24.8ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.14μs 6.1ns 32.3ns 0 0 0 696 B
master StartFinishScope net472 1.11μs 1.53ns 5.92ns 0.0995 0 0 658 B
#7556 StartFinishSpan net6.0 752ns 3.28ns 12.3ns 0 0 0 576 B
#7556 StartFinishSpan netcoreapp3.1 908ns 4.88ns 27.1ns 0 0 0 576 B
#7556 StartFinishSpan net472 908ns 0.353ns 1.37ns 0.0918 0 0 578 B
#7556 StartFinishScope net6.0 877ns 3.26ns 12.2ns 0 0 0 696 B
#7556 StartFinishScope netcoreapp3.1 1.18μs 4.63ns 18ns 0 0 0 696 B
#7556 StartFinishScope net472 1.09μs 0.447ns 1.73ns 0.104 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.03μs 5.57ns 31ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.45μs 6.05ns 23.4ns 0 0 0 696 B
master RunOnMethodBegin net472 1.44μs 0.394ns 1.42ns 0.101 0 0 658 B
#7556 RunOnMethodBegin net6.0 1.03μs 4.53ns 17ns 0 0 0 696 B
#7556 RunOnMethodBegin netcoreapp3.1 1.39μs 6.86ns 28.3ns 0 0 0 696 B
#7556 RunOnMethodBegin net472 1.43μs 1.09ns 4.21ns 0.0998 0 0 658 B

@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 1cfe73f to 096952f Compare October 10, 2025 11:32
@anna-git anna-git force-pushed the anna/config-inversion-check-configurationkeys-are-in-json branch from b202c12 to 1f81c8c Compare October 10, 2025 11:32
@anna-git anna-git changed the title [Config inversion] Cleanup configuration keys constants, and check them against local json file [Config registry] Cleanup configuration keys constants, and check them against local json file Oct 10, 2025
@anna-git anna-git marked this pull request as ready for review October 10, 2025 14:02
@anna-git anna-git requested review from a team as code owners October 10, 2025 14:02
@anna-git anna-git marked this pull request as draft October 13, 2025 22:37
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch from 096952f to 869594a Compare October 21, 2025 16:14
@anna-git anna-git force-pushed the anna/config-inversion-supported-config-file branch 5 times, most recently from 4b53dd1 to 70e632e Compare October 22, 2025 21:31
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.

1 participant