Skip to content

Conversation

@andrewlock
Copy link
Member

@andrewlock andrewlock commented Nov 10, 2025

Summary of changes

A fix for #7724 to handle telemetry reporting in dynamic config "reset" scenarios

Reason for change

The system tests for #7724 were failing in some dynamic configuration scenarios. Specifically, the tests were sending remote config without any configuration values "i.e. 'reset to use defaults'" and were waiting a telemetry update. However, we never sent it, because there was "no telemetry to record".

Note that we did correctly apply the new configuration, we just didn't report the telemetry correctly, primarily due to limitations in the telemetry protocol. This PR adds a fix for that, and will be merged into #7724.

Implementation details

The solution is to "remember" the telemetry from the default mutable configuration values, without any dynamic sources, and "replay" this telemetry when we update telemetry. This feels kind of hacky, but it's something I suspected we might need to do, and had been avoiding up to this point because we do a "full reconfigure" anyway.

Test coverage

Added a specific unit test that mimics the behaviour of the system-test (i.e. an "empty" dynamic config response) and confirms the telemetry is recorded as expected

Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

Unlike other PRs in the stack, I'll merge this directly into #7724 to fix the tests there, just thought I'd keep this separate for easier reviewing

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@pr-commenter
Copy link

pr-commenter bot commented Nov 10, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7796 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.128
  • 7 benchmarks have fewer allocations
  • 3 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

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

Allocation changes below 0.5% are ignored.

Benchmark details

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

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.2μs 56.6ns 335ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 13.9μs 69.1ns 324ns 0 0 0 5.71 KB
master StartStopWithChild net472 22.4μs 121ns 663ns 0.914 0.229 0 6.07 KB
#7796 StartStopWithChild net6.0 10.4μs 56.7ns 326ns 0 0 0 5.53 KB
#7796 StartStopWithChild netcoreapp3.1 14.1μs 53.9ns 209ns 0 0 0 5.7 KB
#7796 StartStopWithChild net472 22.4μs 120ns 635ns 0.885 0.221 0 6.08 KB
Benchmarks.Trace.AgentWriterBenchmark - Unknown 🤷 Fewer allocations 🎉

Fewer allocations 🎉 in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 2.7 KB 0 b -2.7 KB -100.00%
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 2.7 KB 0 b -2.7 KB -100.00%
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.31 KB 0 b -3.31 KB -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 935μs 465ns 1.8μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 836ns 3.24μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 1.26μs 4.71μs 0 0 0 3.31 KB
#7796 WriteAndFlushEnrichedTraces net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7796 WriteAndFlushEnrichedTraces netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7796 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.1μs 1.56ns 6.03ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.41μs 7.97ns 52.2ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.03μs 2.6ns 10.1ns 0.193 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.4μs 5.62ns 21.8ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.06μs 43.5ns 185ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.69μs 4.77ns 18.5ns 0.731 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 341ns 1.66ns 6.84ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 395ns 2.15ns 11.9ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 300ns 0.0279ns 0.108ns 0.0443 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.34μs 29.2ns 117ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.79μs 38.5ns 149ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.68μs 1.6ns 6ns 0.601 0 0 3.8 KB
#7796 AllCycleSimpleBody net6.0 1.1μs 0.932ns 3.61ns 0 0 0 1.22 KB
#7796 AllCycleSimpleBody netcoreapp3.1 1.42μs 7.89ns 47.3ns 0 0 0 1.2 KB
#7796 AllCycleSimpleBody net472 1.07μs 0.289ns 1.08ns 0.193 0 0 1.23 KB
#7796 AllCycleMoreComplexBody net6.0 7.14μs 35.6ns 159ns 0 0 0 4.72 KB
#7796 AllCycleMoreComplexBody netcoreapp3.1 9.1μs 5.71ns 22.1ns 0 0 0 4.62 KB
#7796 AllCycleMoreComplexBody net472 7.61μs 5.65ns 21.9ns 0.722 0 0 4.74 KB
#7796 ObjectExtractorSimpleBody net6.0 336ns 1.67ns 7.47ns 0 0 0 280 B
#7796 ObjectExtractorSimpleBody netcoreapp3.1 394ns 2.21ns 14.1ns 0 0 0 272 B
#7796 ObjectExtractorSimpleBody net472 302ns 0.5ns 1.94ns 0.044 0 0 281 B
#7796 ObjectExtractorMoreComplexBody net6.0 6.33μs 33.5ns 164ns 0 0 0 3.78 KB
#7796 ObjectExtractorMoreComplexBody netcoreapp3.1 7.81μs 39.3ns 180ns 0 0 0 3.69 KB
#7796 ObjectExtractorMoreComplexBody net472 6.68μs 4.16ns 16.1ns 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 76.6μs 21.6ns 77.9ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.3μs 286ns 1.11μs 0 0 0 32.4 KB
master EncodeArgs net472 112μs 18.7ns 72.2ns 5.02 0 0 32.51 KB
master EncodeLegacyArgs net6.0 143μs 89.3ns 346ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 201μs 436ns 1.69μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 265μs 69.1ns 258ns 0 0 0 2.16 KB
#7796 EncodeArgs net6.0 76.5μs 82.3ns 319ns 0 0 0 32.4 KB
#7796 EncodeArgs netcoreapp3.1 98.9μs 233ns 902ns 0 0 0 32.4 KB
#7796 EncodeArgs net472 109μs 16.7ns 64.6ns 4.9 0 0 32.51 KB
#7796 EncodeLegacyArgs net6.0 145μs 66.3ns 257ns 0 0 0 2.15 KB
#7796 EncodeLegacyArgs netcoreapp3.1 201μs 247ns 956ns 0 0 0 2.14 KB
#7796 EncodeLegacyArgs net472 263μs 25.7ns 89.1ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 5.48 KB 6.1 KB 624 B 11.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 424μs 830ns 2.99μs 0 0 0 5.48 KB
master RunWafRealisticBenchmark netcoreapp3.1 465μs 2.95μs 28.3μs 0 0 0 4.58 KB
master RunWafRealisticBenchmark net472 496μs 603ns 2.33μs 0 0 0 8.19 KB
master RunWafRealisticBenchmarkWithAttack net6.0 313μs 923ns 3.81μs 0 0 0 3.79 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 367μs 3.77μs 36.6μs 0 0 0 2.32 KB
master RunWafRealisticBenchmarkWithAttack net472 372μs 265ns 954ns 0 0 0 8.19 KB
#7796 RunWafRealisticBenchmark net6.0 422μs 836ns 3.01μs 0 0 0 6.1 KB
#7796 RunWafRealisticBenchmark netcoreapp3.1 473μs 2.64μs 17.5μs 0 0 0 4.58 KB
#7796 RunWafRealisticBenchmark net472 513μs 518ns 1.94μs 0 0 0 8.19 KB
#7796 RunWafRealisticBenchmarkWithAttack net6.0 310μs 1.3μs 4.68μs 0 0 0 3.79 KB
#7796 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 341μs 1.34μs 4.84μs 0 0 0 2.32 KB
#7796 RunWafRealisticBenchmarkWithAttack net472 369μs 141ns 507ns 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 60.3μs 100ns 360ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.5μs 205ns 895ns 0 0 0 17.42 KB
master SendRequest net472 0.155ns 0.00363ns 0.0141ns 0 0 0 0 b
#7796 SendRequest net6.0 60.5μs 41.1ns 159ns 0 0 0 14.52 KB
#7796 SendRequest netcoreapp3.1 71.8μs 60.1ns 233ns 0 0 0 17.42 KB
#7796 SendRequest net472 0.145ns 0.00389ns 0.0151ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 304 B 976 B 672 B 221.05%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.89ms 651ns 2.35μs 0 0 0 640.3 KB
master OriginalCharSlice netcoreapp3.1 3.92ms 1.67μs 6.45μs 0 0 0 640.1 KB
master OriginalCharSlice net472 2.59ms 418ns 1.51μs 0 0 0 647.17 KB
master OptimizedCharSlice net6.0 1.48ms 921ns 3.45μs 0 0 0 304 B
master OptimizedCharSlice netcoreapp3.1 2.77ms 941ns 3.52μs 0 0 0 104 B
master OptimizedCharSlice net472 2ms 970ns 3.76μs 0 0 0 8.19 KB
master OptimizedCharSliceWithPool net6.0 1ms 364ns 1.31μs 0 0 0 640 B
master OptimizedCharSliceWithPool netcoreapp3.1 1.86ms 1.58μs 6.1μs 0 0 0 104 B
master OptimizedCharSliceWithPool net472 1.13ms 479ns 1.85μs 0 0 0 8.19 KB
#7796 OriginalCharSlice net6.0 1.93ms 3.16μs 11.8μs 0 0 0 640.64 KB
#7796 OriginalCharSlice netcoreapp3.1 3.88ms 639ns 2.39μs 0 0 0 640.1 KB
#7796 OriginalCharSlice net472 2.67ms 1.18μs 4.59μs 0 0 0 647.17 KB
#7796 OptimizedCharSlice net6.0 1.44ms 563ns 2.18μs 0 0 0 976 B
#7796 OptimizedCharSlice netcoreapp3.1 2.75ms 1.22μs 4.58μs 0 0 0 104 B
#7796 OptimizedCharSlice net472 2.11ms 983ns 3.81μs 0 0 0 8.19 KB
#7796 OptimizedCharSliceWithPool net6.0 1.01ms 1.26μs 4.88μs 0 0 0 640 B
#7796 OptimizedCharSliceWithPool netcoreapp3.1 1.89ms 2.04μs 7.61μs 0 0 0 104 B
#7796 OptimizedCharSliceWithPool net472 1.13ms 571ns 2.14μs 0 0 0 8.19 KB
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 42.55 KB 41.63 KB -917 B -2.16%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 654μs 3.07μs 11.5μs 0 0 0 42.55 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 803μs 3.78μs 14.6μs 0 0 0 41.8 KB
master WriteAndFlushEnrichedTraces net472 923μs 2.56μs 9.57μs 8.33 0 0 55.91 KB
#7796 WriteAndFlushEnrichedTraces net6.0 677μs 731ns 2.63μs 0 0 0 41.63 KB
#7796 WriteAndFlushEnrichedTraces netcoreapp3.1 764μs 2.14μs 8.29μs 0 0 0 41.79 KB
#7796 WriteAndFlushEnrichedTraces net472 951μs 4.49μs 22.5μs 8.33 0 0 56.15 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 7.06ns 26.4ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.59μs 5.44ns 21.1ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.72μs 0.557ns 2.09ns 0.149 0 0 987 B
#7796 ExecuteNonQuery net6.0 1.89μs 10.2ns 57.5ns 0 0 0 1.02 KB
#7796 ExecuteNonQuery netcoreapp3.1 2.68μs 7.31ns 28.3ns 0 0 0 1.02 KB
#7796 ExecuteNonQuery net472 2.73μs 3.39ns 13.1ns 0.154 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.77μs 8.1ns 31.4ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.31μs 11ns 46.8ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.53μs 5.31ns 20.6ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.83μs 9.71ns 47.6ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.43μs 1.47ns 5.49ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.66μs 4.36ns 16.9ns 0.165 0 0 1.1 KB
#7796 CallElasticsearch net6.0 1.73μs 8.55ns 39.2ns 0 0 0 1.03 KB
#7796 CallElasticsearch netcoreapp3.1 2.49μs 11.7ns 44ns 0 0 0 1.03 KB
#7796 CallElasticsearch net472 3.56μs 1.95ns 7.54ns 0.16 0 0 1.04 KB
#7796 CallElasticsearchAsync net6.0 1.87μs 9.06ns 36.2ns 0 0 0 1.01 KB
#7796 CallElasticsearchAsync netcoreapp3.1 2.49μs 4.8ns 17.9ns 0 0 0 1.08 KB
#7796 CallElasticsearchAsync net472 3.98μs 7.63ns 29.6ns 0.159 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.88μs 0.882ns 3.42ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.35μs 1.18ns 4.58ns 0 0 0 952 B
master ExecuteAsync net472 2.6μs 0.491ns 1.84ns 0.143 0 0 915 B
#7796 ExecuteAsync net6.0 1.95μs 6.38ns 24.7ns 0 0 0 952 B
#7796 ExecuteAsync netcoreapp3.1 2.37μs 8.98ns 34.8ns 0 0 0 952 B
#7796 ExecuteAsync net472 2.59μs 3.27ns 12.7ns 0.142 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.86μs 14.8ns 55.4ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.59μs 26ns 101ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 5.67ns 22ns 0.487 0 0 3.18 KB
#7796 SendAsync net6.0 7.09μs 5.35ns 20.7ns 0 0 0 2.36 KB
#7796 SendAsync netcoreapp3.1 8.75μs 28.7ns 111ns 0 0 0 2.9 KB
#7796 SendAsync net472 12.2μs 12.1ns 46.7ns 0.489 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 275.84 KB 286.72 KB 10.88 KB 3.94%

Fewer allocations 🎉 in #7796

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.87 KB 43.52 KB -352 B -0.80%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 275.52 KB 257.17 KB -18.35 KB -6.66%
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 44.1μs 226ns 1.01μs 0 0 0 43.87 KB
master StringConcatBenchmark netcoreapp3.1 50.2μs 402ns 3.79μs 0 0 0 42.86 KB
master StringConcatBenchmark net472 58μs 235ns 908ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 462μs 1.83μs 6.59μs 0 0 0 274.3 KB
master StringConcatAspectBenchmark netcoreapp3.1 518μs 1.64μs 6.57μs 0 0 0 275.52 KB
master StringConcatAspectBenchmark net472 406μs 2.16μs 15.4μs 0 0 0 275.84 KB
#7796 StringConcatBenchmark net6.0 45.5μs 270ns 2.53μs 0 0 0 43.52 KB
#7796 StringConcatBenchmark netcoreapp3.1 50.6μs 297ns 2.69μs 0 0 0 42.75 KB
#7796 StringConcatBenchmark net472 57.7μs 137ns 513ns 0 0 0 57.34 KB
#7796 StringConcatAspectBenchmark net6.0 479μs 2.22μs 8.86μs 0 0 0 275.35 KB
#7796 StringConcatAspectBenchmark netcoreapp3.1 482μs 2.1μs 9.4μs 0 0 0 257.17 KB
#7796 StringConcatAspectBenchmark net472 404μs 1.74μs 6.52μ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.79μs 11.4ns 44.2ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.66μs 16ns 62ns 0 0 0 1.7 KB
master EnrichedLog net472 3.7μs 2.04ns 7.92ns 0.258 0 0 1.64 KB
#7796 EnrichedLog net6.0 2.7μs 11.9ns 49.2ns 0 0 0 1.7 KB
#7796 EnrichedLog netcoreapp3.1 3.55μs 17.7ns 77.2ns 0 0 0 1.7 KB
#7796 EnrichedLog net472 3.97μs 3.4ns 13.2ns 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 124μs 170ns 588ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 390ns 1.41μs 0 0 0 4.31 KB
master EnrichedLog net472 171μs 677ns 2.34μs 0 0 0 4.52 KB
#7796 EnrichedLog net6.0 122μs 101ns 379ns 0 0 0 4.31 KB
#7796 EnrichedLog netcoreapp3.1 128μs 614ns 2.46μs 0 0 0 4.31 KB
#7796 EnrichedLog net472 166μs 203ns 787ns 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.12μs 16.5ns 61.7ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.63μs 12.9ns 50.1ns 0 0 0 2.26 KB
master EnrichedLog net472 7.5μs 3.94ns 13.7ns 0.299 0 0 2.08 KB
#7796 EnrichedLog net6.0 4.97μs 25ns 106ns 0 0 0 2.26 KB
#7796 EnrichedLog netcoreapp3.1 6.98μs 15.9ns 61.7ns 0 0 0 2.26 KB
#7796 EnrichedLog net472 7.63μs 9.85ns 38.1ns 0.306 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.01μs 9.19ns 36.7ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.58μs 11ns 42.6ns 0 0 0 1.2 KB
master SendReceive net472 3μs 6.33ns 24.5ns 0.178 0 0 1.2 KB
#7796 SendReceive net6.0 1.97μs 8.95ns 34.7ns 0 0 0 1.2 KB
#7796 SendReceive netcoreapp3.1 2.71μs 8.72ns 33.8ns 0 0 0 1.2 KB
#7796 SendReceive net472 3.17μs 2.98ns 11.5ns 0.188 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7796

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑net6.0 1.128 4,895.85 4,340.02

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.88μs 18.2ns 70.4ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.93μs 9.42ns 35.3ns 0 0 0 1.63 KB
master EnrichedLog net472 6.42μs 5.33ns 19.9ns 0.319 0 0 2.03 KB
#7796 EnrichedLog net6.0 4.34μs 4.45ns 16.7ns 0 0 0 1.58 KB
#7796 EnrichedLog netcoreapp3.1 5.8μs 10.5ns 40.5ns 0 0 0 1.63 KB
#7796 EnrichedLog net472 6.45μs 7.8ns 30.2ns 0.322 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 799ns 0.185ns 0.715ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 965ns 5.01ns 23.5ns 0 0 0 576 B
master StartFinishSpan net472 905ns 0.201ns 0.695ns 0.0908 0 0 578 B
master StartFinishScope net6.0 937ns 0.445ns 1.67ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.19μs 5.43ns 21ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.179ns 0.693ns 0.0996 0 0 658 B
#7796 StartFinishSpan net6.0 802ns 3.94ns 16.3ns 0 0 0 576 B
#7796 StartFinishSpan netcoreapp3.1 978ns 5ns 22.9ns 0 0 0 576 B
#7796 StartFinishSpan net472 900ns 0.0335ns 0.125ns 0.09 0 0 578 B
#7796 StartFinishScope net6.0 946ns 0.222ns 0.861ns 0 0 0 696 B
#7796 StartFinishScope netcoreapp3.1 1.14μs 6.32ns 29.6ns 0 0 0 696 B
#7796 StartFinishScope net472 1.1μs 0.539ns 2.02ns 0.0997 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 0.99ns 3.83ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 0.831ns 3.22ns 0 0 0 696 B
master RunOnMethodBegin net472 1.4μs 1.42ns 5.49ns 0.104 0 0 658 B
#7796 RunOnMethodBegin net6.0 1.11μs 0.35ns 1.26ns 0 0 0 696 B
#7796 RunOnMethodBegin netcoreapp3.1 1.42μs 7.32ns 33.5ns 0 0 0 696 B
#7796 RunOnMethodBegin net472 1.45μs 1.34ns 5.17ns 0.102 0 0 658 B

@datadog-datadog-prod-us1

This comment has been minimized.

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

dd-trace-dotnet-ci-bot bot commented Nov 10, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7796) 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.34 ± (76.61 - 77.87) ms75.02 ± (74.88 - 75.47) ms-1.7%
.NET Framework 4.8 - Bailout
duration81.71 ± (81.19 - 82.00) ms79.22 ± (79.20 - 79.98) ms-3.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1058.83 ± (1061.66 - 1072.63) ms1054.58 ± (1054.88 - 1062.18) ms-0.4%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.99 ± (22.92 - 23.07) ms22.81 ± (22.73 - 22.89) ms-0.8%
process.time_to_main_ms88.00 ± (87.63 - 88.36) ms86.78 ± (86.40 - 87.15) ms-1.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.91 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.87 ± (22.80 - 22.93) ms22.95 ± (22.87 - 23.02) ms+0.4%✅⬆️
process.time_to_main_ms88.62 ± (88.28 - 88.96) ms89.44 ± (89.08 - 89.80) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.97) MB10.95 ± (10.95 - 10.95) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms221.21 ± (219.80 - 222.62) ms221.61 ± (220.15 - 223.08) ms+0.2%✅⬆️
process.time_to_main_ms502.80 ± (501.68 - 503.93) ms500.36 ± (499.23 - 501.50) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.79 ± (47.77 - 47.81) MB47.90 ± (47.88 - 47.92) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.6%
.NET 6 - Baseline
process.internal_duration_ms21.71 ± (21.65 - 21.78) ms21.65 ± (21.60 - 21.71) ms-0.3%
process.time_to_main_ms76.11 ± (75.78 - 76.43) ms76.50 ± (76.20 - 76.79) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.62 ± (10.62 - 10.62) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.62 ± (21.56 - 21.68) ms21.42 ± (21.37 - 21.46) ms-0.9%
process.time_to_main_ms77.63 ± (77.40 - 77.87) ms76.41 ± (76.16 - 76.66) ms-1.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.67) MB10.66 ± (10.65 - 10.66) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms212.71 ± (210.50 - 214.92) ms210.46 ± (209.35 - 211.57) ms-1.1%
process.time_to_main_ms468.61 ± (467.66 - 469.56) ms465.69 ± (464.76 - 466.63) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.07 ± (48.04 - 48.09) MB48.02 ± (47.99 - 48.05) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.96 ± (19.90 - 20.02) ms19.90 ± (19.84 - 19.97) ms-0.3%
process.time_to_main_ms76.03 ± (75.71 - 76.34) ms75.42 ± (75.11 - 75.73) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.65 ± (7.64 - 7.65) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.77 ± (19.72 - 19.82) ms19.70 ± (19.64 - 19.76) ms-0.3%
process.time_to_main_ms76.60 ± (76.31 - 76.89) ms75.75 ± (75.47 - 76.03) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.73) MB7.69 ± (7.68 - 7.69) MB-0.4%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms194.36 ± (193.53 - 195.20) ms193.40 ± (192.46 - 194.33) ms-0.5%
process.time_to_main_ms458.40 ± (457.49 - 459.31) ms453.68 ± (452.70 - 454.67) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.51 ± (36.48 - 36.55) MB36.48 ± (36.45 - 36.52) MB-0.1%
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
duration193.00 ± (193.02 - 193.73) ms193.43 ± (193.16 - 194.04) ms+0.2%✅⬆️
.NET Framework 4.8 - Bailout
duration196.66 ± (196.38 - 196.88) ms196.10 ± (195.90 - 196.41) ms-0.3%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1103.80 ± (1107.57 - 1117.12) ms1116.45 ± (1119.85 - 1130.13) ms+1.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.91 ± (187.47 - 188.35) ms187.97 ± (187.66 - 188.28) ms+0.0%✅⬆️
process.time_to_main_ms81.05 ± (80.82 - 81.28) ms80.74 ± (80.56 - 80.92) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.09 - 16.15) MB16.12 ± (16.09 - 16.15) MB-0.0%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.15 ± (186.89 - 187.42) ms188.19 ± (187.79 - 188.59) ms+0.6%✅⬆️
process.time_to_main_ms82.03 ± (81.87 - 82.19) ms82.25 ± (82.09 - 82.40) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.22 ± (16.17 - 16.26) MB16.17 ± (16.14 - 16.19) MB-0.3%
runtime.dotnet.threads.count20 ± (20 - 21)21 ± (21 - 21)+1.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms404.94 ± (402.15 - 407.73) ms397.76 ± (395.30 - 400.23) ms-1.8%
process.time_to_main_ms472.20 ± (471.58 - 472.82) ms472.99 ± (472.27 - 473.72) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.65 ± (58.54 - 58.77) MB58.66 ± (58.52 - 58.80) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.30 ± (191.93 - 192.67) ms197.27 ± (196.78 - 197.75) ms+2.6%✅⬆️
process.time_to_main_ms70.13 ± (69.97 - 70.28) ms71.49 ± (71.27 - 71.72) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.08 ± (15.93 - 16.22) MB16.35 ± (16.32 - 16.39) MB+1.7%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 19)19 ± (19 - 19)+4.8%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.25 ± (190.97 - 191.53) ms191.75 ± (191.39 - 192.10) ms+0.3%✅⬆️
process.time_to_main_ms71.02 ± (70.91 - 71.13) ms71.13 ± (70.99 - 71.28) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.28 ± (16.15 - 16.41) MB16.09 ± (15.94 - 16.25) MB-1.2%
runtime.dotnet.threads.count19 ± (19 - 20)19 ± (19 - 19)-1.1%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms413.80 ± (410.81 - 416.79) ms404.31 ± (402.09 - 406.53) ms-2.3%
process.time_to_main_ms442.05 ± (441.42 - 442.68) ms440.35 ± (439.81 - 440.89) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.75 ± (58.62 - 58.89) MB58.71 ± (58.55 - 58.86) MB-0.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (29 - 30)-0.2%
.NET 8 - Baseline
process.internal_duration_ms190.39 ± (190.11 - 190.68) ms191.59 ± (191.17 - 192.00) ms+0.6%✅⬆️
process.time_to_main_ms69.58 ± (69.39 - 69.77) ms69.63 ± (69.45 - 69.81) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.81) MB11.71 ± (11.68 - 11.73) MB-0.6%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.1%
.NET 8 - Bailout
process.internal_duration_ms190.22 ± (189.90 - 190.55) ms190.43 ± (190.03 - 190.84) ms+0.1%✅⬆️
process.time_to_main_ms70.73 ± (70.59 - 70.86) ms70.57 ± (70.41 - 70.73) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.78 - 11.84) MB11.72 ± (11.70 - 11.74) MB-0.8%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.1%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms366.87 ± (365.36 - 368.39) ms367.94 ± (366.54 - 369.34) ms+0.3%✅⬆️
process.time_to_main_ms428.95 ± (428.39 - 429.51) ms430.55 ± (429.97 - 431.13) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.76 ± (47.73 - 47.78) MB47.99 ± (47.96 - 48.02) MB+0.5%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
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 (7796) - mean (75ms)  : 71, 79
    master - mean (77ms)  : 67, 87

    section Bailout
    This PR (7796) - mean (80ms)  : 74, 86
    master - mean (82ms)  : 75, 88

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (1,059ms)  : 1005, 1112
    master - mean (1,067ms)  : 986, 1148

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 (7796) - mean (117ms)  : 109, 125
    master - mean (119ms)  : 112, 125

    section Bailout
    This PR (7796) - mean (120ms)  : 112, 128
    master - mean (119ms)  : 113, 125

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (756ms)  : 710, 802
    master - mean (765ms)  : 723, 807

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7796) - mean (105ms)  : 100, 111
    master - mean (105ms)  : 99, 111

    section Bailout
    This PR (7796) - mean (105ms)  : 99, 110
    master - mean (106ms)  : 102, 111

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (703ms)  : 680, 726
    master - mean (712ms)  : 668, 756

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7796) - mean (104ms)  : 97, 110
    master - mean (105ms)  : 99, 110

    section Bailout
    This PR (7796) - mean (103ms)  : 98, 109
    master - mean (105ms)  : 99, 111

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (682ms)  : 648, 715
    master - mean (695ms)  : 668, 721

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 (7796) - mean (194ms)  : 189, 198
    master - mean (193ms)  : 190, 197

    section Bailout
    This PR (7796) - mean (196ms)  : 194, 199
    master - mean (197ms)  : 194, 199

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (1,125ms)  : 1048, 1202
    master - mean (1,112ms)  : 1042, 1183

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 (7796) - mean (277ms)  : 272, 282
    master - mean (277ms)  : 272, 283

    section Bailout
    This PR (7796) - mean (279ms)  : 274, 283
    master - mean (277ms)  : 274, 281

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (902ms)  : 865, 939
    master - mean (912ms)  : 861, 963

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7796) - mean (277ms)  : 270, 283
    master - mean (271ms)  : 265, 277

    section Bailout
    This PR (7796) - mean (271ms)  : 266, 276
    master - mean (270ms)  : 267, 273

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (880ms)  : 832, 927
    master - mean (891ms)  : 836, 945

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7796) - mean (271ms)  : 264, 279
    master - mean (270ms)  : 265, 274

    section Bailout
    This PR (7796) - mean (271ms)  : 265, 277
    master - mean (270ms)  : 265, 276

    section CallTarget+Inlining+NGEN
    This PR (7796) - mean (830ms)  : 806, 854
    master - mean (827ms)  : 807, 847

Loading

@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch from 2fbbd7f to c677778 Compare November 11, 2025 10:04
@andrewlock andrewlock requested review from a team as code owners November 11, 2025 10:04
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 11c23d3 to 7038956 Compare November 11, 2025 10:04
@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch 2 times, most recently from 1ad1119 to d33ef91 Compare November 12, 2025 12:04
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 8f633c0 to 49ed373 Compare November 12, 2025 12:22

OpenTelemetryLogsEnabled = OpenTelemetryLogsEnabled && OtelLogsExporterEnabled;

DataPipelineEnabled = config
Copy link
Member Author

Choose a reason for hiding this comment

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

This has all just moved to the end of the constructor, cut and paste

// and so we allow and enable the datapipeline. Later, they could configure the app in code to send over UDS.
// This is a problem, as we currently don't support toggling the data pipeline at runtime, so we explicitly block
// this scenario in the public API.
if (Manager.InitialExporterSettings.TracesTransport == TracesTransportType.UnixDomainSocket && FrameworkDescription.Instance.IsWindows())
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only change, we read the exporter settings that the Manager created, instead of creating the new ExporterSettings() and passing them to the Manager. It's the same thing overall, but it means the Manager can record the initial telemetry for the exporter settings (so it can be replayed again later)

@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch 2 times, most recently from 9d94c38 to a34b7b5 Compare November 12, 2025 13:41
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 49ed373 to 70af77a Compare November 12, 2025 13:41
Copy link
Collaborator

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

Nice!

#nullable enable

using System;
using System.IO;
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: Probably not needed

@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch from a34b7b5 to fe19d1a Compare November 14, 2025 07:41
@andrewlock andrewlock requested a review from a team as a code owner November 14, 2025 07:41
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 70af77a to e506d99 Compare November 14, 2025 07:41
@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch from fe19d1a to b8b2b59 Compare November 25, 2025 16:46
@andrewlock andrewlock requested review from a team as code owners November 25, 2025 16:46
@andrewlock andrewlock requested review from zacharycmontoya and removed request for a team November 25, 2025 16:46
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from e506d99 to 8d0fb01 Compare November 25, 2025 16:46
andrewlock added a commit that referenced this pull request Nov 26, 2025
…ttings (#7695)

## Summary of changes

- Introduces `SettingsManager` responsible for managing
`MutableSettings` and `ExporterSettings`

## Reason for change

We need to be notified about runtime changes to settings (i.e. config in
code or remote config) but don't want to tear down the world and rebuild
every time. `SettingsManager` is responsible for handling this.
Consumers subscribe to changes and can be notified about updates.

This is a first step which just introduces the type, but doesn't force
users to consume changes or remove the current places settings are
exposed. Instead, it just encapsulates the changes.

## Implementation details

- Introduce `SettingsManager`
- Move code duplicated in `DynamicConfigurationManager` and
`ConfigureIntegration` into `SettingsManager`
- Create a new instance of `SettingsManager` (and maintain it throughout
the app lifetime)
- Subscribe to changes one time in `TracerManager` to do the "full
rebuild"
- This is a stop gap before we use it "properly" and stop exposing the
settings on `TracerSettings`

## Test coverage

- Mostly a refactor so covered by integration tests
- Unit tests for `SettingsManager` functionality

## Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721
- #7722
- #7695 👈
- #7723
- #7724
- #7796

---------

Co-authored-by: Lucas Pimentel <[email protected]>
@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch from b8b2b59 to 9ceef6e Compare November 26, 2025 08:17
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 8d0fb01 to 6ad1dfd Compare November 26, 2025 08:17
andrewlock added a commit that referenced this pull request Nov 26, 2025
…7723)

## Summary of changes

Instead of exposing settings like `ServiceVerion` and `Environment` on
`TracerSettings`, only expose them on `MutableSettings`

## Reason for change

This is all part of the refactoring towards having `TracerSettings`
being an immutable settings object, that's created once on app startup,
and fixed for the lifetime. `ServiceVerion` and `Environment` currently
delegate to the `MutableSettings` object stored on `TracerSettings`, but
are going to move that elsewhere shortly so that consumers can subscribe
to changes

## Implementation details

For this PR, it's just a case of changing `TracerSettings.XXX` =>
`TracerSettings.Mutable.XXX`. A future PR will then subsequently "fix"
these usages properly. This is just a small step to be able to remove
the mutable properties from `TracerSettings`

## Test coverage

Just a refactoring, covered by existing tests.

## Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721
- #7722
- #7695
- #7723 👈
- #7724
- #7796
@andrewlock andrewlock force-pushed the andrew/settings/6-fix-telemetry-reporting branch from 9ceef6e to c043b52 Compare November 26, 2025 11:09
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 6ad1dfd to cf20c43 Compare November 26, 2025 11:09
@andrewlock andrewlock merged commit 447027a into andrew/settings/5-remove-mutablesettings Nov 26, 2025
11 of 18 checks passed
@andrewlock andrewlock deleted the andrew/settings/6-fix-telemetry-reporting branch November 26, 2025 11:10
andrewlock added a commit that referenced this pull request Nov 26, 2025
… config changes (#7796)

## Summary of changes

A fix for #7724 to handle telemetry reporting in dynamic config "reset"
scenarios

## Reason for change

The system tests for #7724 were failing in some dynamic configuration
scenarios. Specifically, the tests were sending remote config _without_
any configuration values "i.e. 'reset to use defaults'" and were waiting
a telemetry update. However, we never sent it, because there was "no
telemetry to record".

Note that we _did_ correctly apply the new configuration, we just didn't
report the telemetry correctly, primarily due to limitations in the
telemetry protocol. This PR adds a fix for that, and will be merged into
#7724.

## Implementation details

The solution is to "remember" the telemetry from the default mutable
configuration values, _without_ any dynamic sources, and "replay" this
telemetry when we update telemetry. This feels kind of hacky, but it's
something I suspected we might need to do, and had been avoiding up to
this point because we do a "full reconfigure" anyway.

## Test coverage

Added a specific unit test that mimics the behaviour of the system-test
(i.e. an "empty" dynamic config response) and confirms the telemetry is
recorded as expected

## Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721
- #7722
- #7695
- #7723
- #7724
- #7796 👈

Unlike other PRs in the stack, I'll merge this directly into #7724 to
fix the tests there, just thought I'd keep this separate for easier
reviewing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants