-
Notifications
You must be signed in to change notification settings - Fork 150
Simplify PerTraceSettings.GetServiceName()
#7532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify PerTraceSettings.GetServiceName()
#7532
Conversation
bff634b to
501ab05
Compare
5a6c43c to
18a7270
Compare
|
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:
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 (7532) - mean (72ms) : 71, 73
. : milestone, 72,
master - mean (72ms) : 71, 73
. : milestone, 72,
section Baseline
This PR (7532) - mean (68ms) : 67, 69
. : milestone, 68,
master - mean (68ms) : 66, 70
. : milestone, 68,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (1,060ms) : 981, 1140
. : milestone, 1060,
master - mean (1,046ms) : 1011, 1080
. : milestone, 1046,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (106ms) : 105, 107
. : milestone, 106,
master - mean (106ms) : 105, 107
. : milestone, 106,
section Baseline
This PR (7532) - mean (105ms) : 103, 108
. : milestone, 105,
master - mean (105ms) : 103, 108
. : milestone, 105,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (741ms) : 717, 764
. : milestone, 741,
master - mean (740ms) : 718, 762
. : milestone, 740,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (101ms) : 99, 102
. : milestone, 101,
master - mean (101ms) : 99, 102
. : milestone, 101,
section Baseline
This PR (7532) - mean (100ms) : 98, 102
. : milestone, 100,
master - mean (100ms) : 98, 102
. : milestone, 100,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (775ms) : 736, 813
. : milestone, 775,
master - mean (778ms) : 733, 822
. : milestone, 778,
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (93ms) : 91, 95
. : milestone, 93,
master - mean (93ms) : 92, 94
. : milestone, 93,
section Baseline
This PR (7532) - mean (92ms) : 90, 95
. : milestone, 92,
master - mean (92ms) : 90, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (658ms) : 645, 671
. : milestone, 658,
master - mean (662ms) : 651, 673
. : milestone, 662,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (197ms) : 194, 199
. : milestone, 197,
master - mean (198ms) : 193, 203
. : milestone, 198,
section Baseline
This PR (7532) - mean (193ms) : 190, 197
. : milestone, 193,
master - mean (193ms) : 188, 197
. : milestone, 193,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (1,168ms) : 1110, 1225
. : milestone, 1168,
master - mean (1,169ms) : 1115, 1223
. : milestone, 1169,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (278ms) : 274, 282
. : milestone, 278,
master - mean (278ms) : 272, 284
. : milestone, 278,
section Baseline
This PR (7532) - mean (276ms) : 273, 280
. : milestone, 276,
master - mean (279ms) : 272, 285
. : milestone, 279,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (941ms) : 895, 987
. : milestone, 941,
master - mean (944ms) : 899, 990
. : milestone, 944,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (280ms) : 276, 284
. : milestone, 280,
master - mean (281ms) : 276, 285
. : milestone, 281,
section Baseline
This PR (7532) - mean (280ms) : 274, 285
. : milestone, 280,
master - mean (280ms) : 275, 285
. : milestone, 280,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (1,000ms) : 972, 1029
. : milestone, 1000,
master - mean (996ms) : 958, 1034
. : milestone, 996,
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7532) - mean (270ms) : 266, 274
. : milestone, 270,
master - mean (270ms) : 266, 273
. : milestone, 270,
section Baseline
This PR (7532) - mean (270ms) : 266, 274
. : milestone, 270,
master - mean (270ms) : 264, 275
. : milestone, 270,
section CallTarget+Inlining+NGEN
This PR (7532) - mean (856ms) : 830, 882
. : milestone, 856,
master - mean (865ms) : 842, 888
. : milestone, 865,
|
501ab05 to
74067a5
Compare
18a7270 to
12dfa73
Compare
74067a5 to
b7463f2
Compare
12dfa73 to
e4a1dbb
Compare
b7463f2 to
83b1b8c
Compare
e4a1dbb to
f62f8b4
Compare
bdbd5c4 to
c357118
Compare
df2544b to
c90ce7b
Compare
c357118 to
41bca93
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7532 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Fewer allocations 🎉
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 | 5.71 KB | 5.66 KB | -50 B | -0.88% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.8μs | 61.3ns | 434ns | 0 | 0 | 0 | 5.52 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.4μs | 70.5ns | 338ns | 0 | 0 | 0 | 5.71 KB |
| master | StartStopWithChild |
net472 | 21.8μs | 120ns | 761ns | 0.859 | 0.322 | 0 | 6.02 KB |
| #7532 | StartStopWithChild |
net6.0 | 10.6μs | 52.6ns | 341ns | 0 | 0 | 0 | 5.52 KB |
| #7532 | StartStopWithChild |
netcoreapp3.1 | 13.5μs | 67.7ns | 287ns | 0 | 0 | 0 | 5.66 KB |
| #7532 | StartStopWithChild |
net472 | 22.3μs | 111ns | 497ns | 1.02 | 0.339 | 0.113 | 6.04 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 | 912μs | 58.5ns | 227ns | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.01ms | 327ns | 1.26μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 108ns | 389ns | 0 | 0 | 0 | 3.31 KB |
| #7532 | WriteAndFlushEnrichedTraces |
net6.0 | 947μs | 278ns | 1.08μs | 0 | 0 | 0 | 2.71 KB |
| #7532 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 61.3ns | 229ns | 0 | 0 | 0 | 2.7 KB |
| #7532 | WriteAndFlushEnrichedTraces |
net472 | 1.19ms | 61.8ns | 231ns | 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 | 359μs | 1.02μs | 3.97μs | 0 | 0 | 0 | 180.01 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 510μs | 2.25μs | 8.41μs | 0 | 0 | 0 | 185.8 KB |
| master | AllCycleSimpleBody |
net472 | 471μs | 229ns | 856ns | 32.4 | 0 | 0 | 206.3 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 365μs | 1.25μs | 4.83μs | 0 | 0 | 0 | 183.53 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 528μs | 1.91μs | 7.39μs | 0 | 0 | 0 | 189.23 KB |
| master | AllCycleMoreComplexBody |
net472 | 478μs | 114ns | 425ns | 32.4 | 0 | 0 | 209.83 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 336ns | 0.0821ns | 0.296ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 397ns | 2.14ns | 11.5ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 296ns | 0.035ns | 0.131ns | 0.0432 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.33μs | 28.3ns | 110ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.9μs | 28.1ns | 105ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.71μs | 5.72ns | 22.2ns | 0.57 | 0 | 0 | 3.8 KB |
| #7532 | AllCycleSimpleBody |
net6.0 | 358μs | 1.04μs | 3.87μs | 0 | 0 | 0 | 180.01 KB |
| #7532 | AllCycleSimpleBody |
netcoreapp3.1 | 529μs | 1.8μs | 6.74μs | 0 | 0 | 0 | 185.8 KB |
| #7532 | AllCycleSimpleBody |
net472 | 471μs | 152ns | 568ns | 32.4 | 0 | 0 | 206.3 KB |
| #7532 | AllCycleMoreComplexBody |
net6.0 | 367μs | 319ns | 1.23μs | 0 | 0 | 0 | 183.53 KB |
| #7532 | AllCycleMoreComplexBody |
netcoreapp3.1 | 505μs | 839ns | 3.25μs | 0 | 0 | 0 | 189.23 KB |
| #7532 | AllCycleMoreComplexBody |
net472 | 480μs | 97.3ns | 377ns | 31.2 | 0 | 0 | 209.83 KB |
| #7532 | ObjectExtractorSimpleBody |
net6.0 | 333ns | 1.82ns | 9.98ns | 0 | 0 | 0 | 280 B |
| #7532 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 409ns | 2.19ns | 11.8ns | 0 | 0 | 0 | 272 B |
| #7532 | ObjectExtractorSimpleBody |
net472 | 300ns | 0.0627ns | 0.226ns | 0.0439 | 0 | 0 | 281 B |
| #7532 | ObjectExtractorMoreComplexBody |
net6.0 | 6.31μs | 6.38ns | 24.7ns | 0 | 0 | 0 | 3.78 KB |
| #7532 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.87μs | 38.3ns | 162ns | 0 | 0 | 0 | 3.69 KB |
| #7532 | ObjectExtractorMoreComplexBody |
net472 | 6.67μs | 3.78ns | 14.6ns | 0.598 | 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 | 77μs | 353ns | 1.37μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 98.6μs | 100ns | 375ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 111μs | 14.1ns | 52.7ns | 5.02 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 145μs | 36.9ns | 138ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 622ns | 2.41μs | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 262μs | 42.3ns | 164ns | 0 | 0 | 0 | 2.16 KB |
| #7532 | EncodeArgs |
net6.0 | 77.5μs | 42.4ns | 164ns | 0 | 0 | 0 | 32.4 KB |
| #7532 | EncodeArgs |
netcoreapp3.1 | 96.5μs | 313ns | 1.21μs | 0 | 0 | 0 | 32.4 KB |
| #7532 | EncodeArgs |
net472 | 108μs | 14.6ns | 56.4ns | 4.89 | 0 | 0 | 32.51 KB |
| #7532 | EncodeLegacyArgs |
net6.0 | 147μs | 38.9ns | 146ns | 0 | 0 | 0 | 2.15 KB |
| #7532 | EncodeLegacyArgs |
netcoreapp3.1 | 201μs | 117ns | 454ns | 0 | 0 | 0 | 2.14 KB |
| #7532 | EncodeLegacyArgs |
net472 | 262μs | 156ns | 604ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7532
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1
2.407
298,781.25
719,068.82
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1
2.094
408,205.14
854,711.75
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 | 2.407 | 298,781.25 | 719,068.82 | |
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 | 2.094 | 408,205.14 | 854,711.75 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 391μs | 57.6ns | 223ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 409μs | 396ns | 1.53μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 429μs | 64.3ns | 249ns | 0 | 0 | 0 | 4.66 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 287μs | 15.2ns | 56.7ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 299μs | 269ns | 933ns | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 310μs | 36.4ns | 141ns | 0 | 0 | 0 | 2.29 KB |
| #7532 | RunWafRealisticBenchmark |
net6.0 | 403μs | 55.4ns | 207ns | 0 | 0 | 0 | 4.56 KB |
| #7532 | RunWafRealisticBenchmark |
netcoreapp3.1 | 853μs | 2.21μs | 8.56μs | 0 | 0 | 0 | 4.48 KB |
| #7532 | RunWafRealisticBenchmark |
net472 | 431μs | 46.9ns | 176ns | 0 | 0 | 0 | 4.66 KB |
| #7532 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 287μs | 27.5ns | 106ns | 0 | 0 | 0 | 2.24 KB |
| #7532 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 687μs | 10.4μs | 104μs | 0 | 0 | 0 | 2.22 KB |
| #7532 | RunWafRealisticBenchmarkWithAttack |
net472 | 310μs | 22.2ns | 83.2ns | 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 | 60.8μs | 89.3ns | 334ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 71μs | 121ns | 437ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.000236ns | 0.000201ns | 0.000777ns | 0 | 0 | 0 | 0 b |
| #7532 | SendRequest |
net6.0 | 61.3μs | 271ns | 1.02μs | 0 | 0 | 0 | 14.52 KB |
| #7532 | SendRequest |
netcoreapp3.1 | 71.3μs | 343ns | 1.37μs | 0 | 0 | 0 | 17.42 KB |
| #7532 | SendRequest |
net472 | 0.00369ns | 0.00167ns | 0.00648ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7532
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
1.309
1,055,563.02
806,318.95
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
1.114
1,486,173.61
1,334,593.75
More allocations ⚠️ in #7532
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
4 B
6 B
2 B
50.00%
Fewer allocations 🎉 in #7532
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
3 B
2 B
-1 B
-33.33%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 1.309 | 1,055,563.02 | 806,318.95 | |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 1.114 | 1,486,173.61 | 1,334,593.75 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 4 B | 6 B | 2 B | 50.00% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 3 B | 2 B | -1 B | -33.33% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.91ms | 6.1μs | 23.6μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.1ms | 7.33μs | 28.4μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.68ms | 126ns | 456ns | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.49ms | 87ns | 337ns | 0 | 0 | 0 | 4 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.72ms | 632ns | 2.45μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 1.94ms | 316ns | 1.22μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.06ms | 73.4ns | 284ns | 0 | 0 | 0 | 3 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 833μs | 169ns | 654ns | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSliceWithPool |
net472 | 1.15ms | 91.3ns | 354ns | 0 | 0 | 0 | 0 b |
| #7532 | OriginalCharSlice |
net6.0 | 1.92ms | 247ns | 925ns | 0 | 0 | 0 | 640.01 KB |
| #7532 | OriginalCharSlice |
netcoreapp3.1 | 2.08ms | 2.52μs | 9.41μs | 0 | 0 | 0 | 640 KB |
| #7532 | OriginalCharSlice |
net472 | 2.72ms | 383ns | 1.43μs | 100 | 0 | 0 | 641.95 KB |
| #7532 | OptimizedCharSlice |
net6.0 | 1.33ms | 322ns | 1.2μs | 0 | 0 | 0 | 6 B |
| #7532 | OptimizedCharSlice |
netcoreapp3.1 | 1.64ms | 331ns | 1.24μs | 0 | 0 | 0 | 1 B |
| #7532 | OptimizedCharSlice |
net472 | 1.97ms | 274ns | 1.06μs | 0 | 0 | 0 | 0 b |
| #7532 | OptimizedCharSliceWithPool |
net6.0 | 807μs | 255ns | 955ns | 0 | 0 | 0 | 2 B |
| #7532 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 853μs | 112ns | 418ns | 0 | 0 | 0 | 1 B |
| #7532 | OptimizedCharSliceWithPool |
net472 | 1.24ms | 893ns | 3.34μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7532
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.238
770,441.07
622,122.10
More allocations ⚠️ in #7532
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
55.86 KB
56.15 KB
296 B
0.53%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.238 | 770,441.07 | 622,122.10 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 55.86 KB | 56.15 KB | 296 B | 0.53% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 736μs | 4.12μs | 26.7μs | 0 | 0 | 0 | 41.67 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 764μs | 3.82μs | 16.2μs | 0 | 0 | 0 | 42.05 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 927μs | 3.17μs | 12.3μs | 4.46 | 0 | 0 | 55.86 KB |
| #7532 | WriteAndFlushEnrichedTraces |
net6.0 | 763μs | 4.33μs | 29μs | 0 | 0 | 0 | 41.71 KB |
| #7532 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 624μs | 1.25μs | 5.02μs | 0 | 0 | 0 | 41.9 KB |
| #7532 | WriteAndFlushEnrichedTraces |
net472 | 898μs | 2.49μs | 9.65μ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.97μs | 3.68ns | 14.3ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.7μs | 7.46ns | 28.9ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.97μs | 3.48ns | 13.5ns | 0.149 | 0.0149 | 0 | 987 B |
| #7532 | ExecuteNonQuery |
net6.0 | 1.85μs | 0.513ns | 1.92ns | 0 | 0 | 0 | 1.02 KB |
| #7532 | ExecuteNonQuery |
netcoreapp3.1 | 2.65μs | 5.79ns | 22.4ns | 0 | 0 | 0 | 1.02 KB |
| #7532 | ExecuteNonQuery |
net472 | 2.84μs | 3.15ns | 11.3ns | 0.147 | 0.0147 | 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.8μs | 9.06ns | 38.5ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.3μs | 10.3ns | 38.5ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.55μs | 1.32ns | 5.13ns | 0.16 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.87μs | 2.21ns | 8.57ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.38μs | 11.1ns | 43ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.68μs | 1.53ns | 5.72ns | 0.165 | 0 | 0 | 1.1 KB |
| #7532 | CallElasticsearch |
net6.0 | 1.8μs | 7.99ns | 30.9ns | 0 | 0 | 0 | 1.03 KB |
| #7532 | CallElasticsearch |
netcoreapp3.1 | 2.26μs | 10.9ns | 43.6ns | 0 | 0 | 0 | 1.03 KB |
| #7532 | CallElasticsearch |
net472 | 3.55μs | 2.43ns | 9.41ns | 0.16 | 0 | 0 | 1.04 KB |
| #7532 | CallElasticsearchAsync |
net6.0 | 1.9μs | 8.76ns | 35ns | 0 | 0 | 0 | 1.01 KB |
| #7532 | CallElasticsearchAsync |
netcoreapp3.1 | 2.43μs | 8.69ns | 32.5ns | 0 | 0 | 0 | 1.08 KB |
| #7532 | CallElasticsearchAsync |
net472 | 3.78μs | 6.06ns | 23.5ns | 0.169 | 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.81μs | 6.31ns | 24.4ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.32μs | 6.24ns | 24.2ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.51μs | 2.85ns | 11ns | 0.138 | 0 | 0 | 915 B |
| #7532 | ExecuteAsync |
net6.0 | 1.76μs | 9.05ns | 40.5ns | 0 | 0 | 0 | 952 B |
| #7532 | ExecuteAsync |
netcoreapp3.1 | 2.3μs | 11.2ns | 46ns | 0 | 0 | 0 | 952 B |
| #7532 | ExecuteAsync |
net472 | 2.69μs | 3ns | 11.2ns | 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.81μs | 13.8ns | 51.5ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.57μs | 8.12ns | 31.5ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.7μs | 9.84ns | 38.1ns | 0.445 | 0 | 0 | 3.18 KB |
| #7532 | SendAsync |
net6.0 | 6.91μs | 5.7ns | 22.1ns | 0 | 0 | 0 | 2.36 KB |
| #7532 | SendAsync |
netcoreapp3.1 | 8.44μs | 10.3ns | 38.4ns | 0 | 0 | 0 | 2.9 KB |
| #7532 | SendAsync |
net472 | 12.5μs | 12.3ns | 47.8ns | 0.502 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7532
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
257.61 KB
277.15 KB
19.54 KB
7.59%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
42.64 KB
45.13 KB
2.49 KB
5.83%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
277.16 KB
280.16 KB
3 KB
1.08%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
278.53 KB
281.41 KB
2.88 KB
1.03%
Fewer allocations 🎉 in #7532
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
43.44 KB
43.1 KB
-336 B
-0.77%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 257.61 KB | 277.15 KB | 19.54 KB | 7.59% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 42.64 KB | 45.13 KB | 2.49 KB | 5.83% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 277.16 KB | 280.16 KB | 3 KB | 1.08% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 278.53 KB | 281.41 KB | 2.88 KB | 1.03% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 43.44 KB | 43.1 KB | -336 B | -0.77% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45.1μs | 632ns | 6.23μs | 0 | 0 | 0 | 43.44 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 45.8μs | 225ns | 1.08μs | 0 | 0 | 0 | 42.64 KB |
| master | StringConcatBenchmark |
net472 | 57.5μs | 180ns | 648ns | 0 | 0 | 0 | 65.54 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 499μs | 2.08μs | 7.19μs | 0 | 0 | 0 | 277.16 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 485μs | 1.49μs | 5.39μs | 0 | 0 | 0 | 257.61 KB |
| master | StringConcatAspectBenchmark |
net472 | 401μs | 1.99μs | 9.13μs | 0 | 0 | 0 | 278.53 KB |
| #7532 | StringConcatBenchmark |
net6.0 | 46.7μs | 418ns | 4.03μs | 0 | 0 | 0 | 43.1 KB |
| #7532 | StringConcatBenchmark |
netcoreapp3.1 | 48.4μs | 214ns | 1.56μs | 0 | 0 | 0 | 45.13 KB |
| #7532 | StringConcatBenchmark |
net472 | 57.5μs | 248ns | 896ns | 0 | 0 | 0 | 65.54 KB |
| #7532 | StringConcatAspectBenchmark |
net6.0 | 488μs | 1.88μs | 6.51μs | 0 | 0 | 0 | 280.16 KB |
| #7532 | StringConcatAspectBenchmark |
netcoreapp3.1 | 501μs | 1.63μs | 5.89μs | 0 | 0 | 0 | 277.15 KB |
| #7532 | StringConcatAspectBenchmark |
net472 | 406μs | 2.12μs | 10.6μs | 0 | 0 | 0 | 281.41 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.55μs | 9.32ns | 34.9ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.57μs | 16.3ns | 65.3ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.77μs | 3.36ns | 13ns | 0.246 | 0 | 0 | 1.64 KB |
| #7532 | EnrichedLog |
net6.0 | 2.61μs | 12.4ns | 46.4ns | 0 | 0 | 0 | 1.7 KB |
| #7532 | EnrichedLog |
netcoreapp3.1 | 3.57μs | 4.52ns | 17.5ns | 0 | 0 | 0 | 1.7 KB |
| #7532 | EnrichedLog |
net472 | 3.75μs | 5.94ns | 22.2ns | 0.246 | 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 | 123μs | 85.1ns | 319ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 130μs | 381ns | 1.37μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 168μs | 134ns | 521ns | 0 | 0 | 0 | 4.52 KB |
| #7532 | EnrichedLog |
net6.0 | 123μs | 46.5ns | 180ns | 0 | 0 | 0 | 4.31 KB |
| #7532 | EnrichedLog |
netcoreapp3.1 | 127μs | 182ns | 679ns | 0 | 0 | 0 | 4.31 KB |
| #7532 | EnrichedLog |
net472 | 168μs | 87.6ns | 339ns | 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.92μs | 8.13ns | 31.5ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.86μs | 26.4ns | 102ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.69μs | 3.98ns | 15.4ns | 0.307 | 0 | 0 | 2.08 KB |
| #7532 | EnrichedLog |
net6.0 | 5.01μs | 21.4ns | 83.1ns | 0 | 0 | 0 | 2.26 KB |
| #7532 | EnrichedLog |
netcoreapp3.1 | 6.76μs | 5.07ns | 17.6ns | 0 | 0 | 0 | 2.26 KB |
| #7532 | EnrichedLog |
net472 | 7.4μs | 4.66ns | 18.1ns | 0.295 | 0 | 0 | 2.08 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net6.0 | 2μs | 10.1ns | 44.9ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.6μs | 10.6ns | 39.8ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.2μs | 4.12ns | 15.4ns | 0.177 | 0 | 0 | 1.2 KB |
| #7532 | SendReceive |
net6.0 | 1.95μs | 9.51ns | 42.6ns | 0 | 0 | 0 | 1.2 KB |
| #7532 | SendReceive |
netcoreapp3.1 | 2.65μs | 12.8ns | 56ns | 0 | 0 | 0 | 1.2 KB |
| #7532 | SendReceive |
net472 | 3.23μs | 1.76ns | 6.59ns | 0.177 | 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.37μs | 14.1ns | 52.7ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.73μs | 23.6ns | 91.6ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.59μs | 8.42ns | 32.6ns | 0.297 | 0 | 0 | 2.03 KB |
| #7532 | EnrichedLog |
net6.0 | 4.24μs | 15.9ns | 61.7ns | 0 | 0 | 0 | 1.58 KB |
| #7532 | EnrichedLog |
netcoreapp3.1 | 5.81μs | 6.83ns | 26.5ns | 0 | 0 | 0 | 1.63 KB |
| #7532 | EnrichedLog |
net472 | 6.57μs | 5.53ns | 21.4ns | 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 | 776ns | 3.72ns | 14.9ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 940ns | 5.11ns | 28.9ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 901ns | 0.367ns | 1.42ns | 0.0902 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 973ns | 4.21ns | 16.3ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.17μs | 6.1ns | 29.2ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.11μs | 0.18ns | 0.699ns | 0.1 | 0 | 0 | 658 B |
| #7532 | StartFinishSpan |
net6.0 | 760ns | 2.98ns | 11.6ns | 0 | 0 | 0 | 576 B |
| #7532 | StartFinishSpan |
netcoreapp3.1 | 968ns | 0.372ns | 1.34ns | 0 | 0 | 0 | 576 B |
| #7532 | StartFinishSpan |
net472 | 905ns | 0.392ns | 1.52ns | 0.0914 | 0 | 0 | 578 B |
| #7532 | StartFinishScope |
net6.0 | 904ns | 0.88ns | 3.41ns | 0 | 0 | 0 | 696 B |
| #7532 | StartFinishScope |
netcoreapp3.1 | 1.19μs | 0.963ns | 3.6ns | 0 | 0 | 0 | 696 B |
| #7532 | StartFinishScope |
net472 | 1.11μs | 0.382ns | 1.43ns | 0.0995 | 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.05μs | 4.77ns | 19.7ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.42μs | 5.23ns | 20.2ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.41μs | 0.876ns | 3.04ns | 0.0981 | 0 | 0 | 658 B |
| #7532 | RunOnMethodBegin |
net6.0 | 1.03μs | 5.47ns | 28.9ns | 0 | 0 | 0 | 696 B |
| #7532 | RunOnMethodBegin |
netcoreapp3.1 | 1.43μs | 6.99ns | 29.7ns | 0 | 0 | 0 | 696 B |
| #7532 | RunOnMethodBegin |
net472 | 1.45μs | 2.53ns | 9.8ns | 0.101 | 0 | 0 | 658 B |
c90ce7b to
b55734f
Compare
41bca93 to
9cb26d0
Compare
b55734f to
ea05552
Compare
9cb26d0 to
99df246
Compare
## Summary of changes Rebuild and re-assign `MutableSettings` when dynamic config (remote or config in code) changes. ## Reason for change This is part of a general stack to extract the "mutable" configuration from static config that is fixed for the lifetime of the app. In the [previous PR](#7522) we moved mutable settings to their own type, but otherwise left things unchanged and just rebuilt everything whenever anything changes. In this PR we move towards combining the dynamic/code configuration, handling changes by _only_ rebuilding the `MutableSettings` (not `TracerSettings`) and handling all the fallout that causes for telemetry. This is very much still a "stop gap"; we still rebuild everything (_except_ the `TracerSettings` object) when these settings changes. ## Implementation details - Create "global" config sources for dynamic settings and code settings - There's actually a bug today where we clobber dynamic settings if we change things in code because we're not storing the sources globally. - When dynamic config or config in code changes - Create a new `MutableSettings` object based only on dynamic sources (with a fallback for the "static" values) - For config in code, we also check for changes to `ExporterSettings` - If there's no discernable changes, bail out - no need to tear down the world - If there _are_ changes, Mutate `TracerSettings`, and do the normal "reconfigure everything" - Remove the (now unused `ImmutableDynamicSettingsTests`) Note that there are technically some behaviour changes in this PR: - `useDefaultSources: false` only ignores env vars etc for values that can be set through code. Other settings will always use the default sources. - `StatsComutationEnabled` can not be _set_ via code. ## Test coverage This is still all technically a "refactoring", so should be covered by existing tests 🤞 ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-819 Part of a config stack - #7522 - #7652 - #7525 👈 - #7530 - #7532 - #7543 - #7544
ea05552 to
6a90f09
Compare
99df246 to
388a390
Compare
## Summary of changes - Expose `DefaultServiceName` on `MutableSettings` instead of on `TracerManager` - Expose `MutableSettings` on `PerTraceSettings` ## Reason for change The `DefaultServiceName` depends on `ServiceName`, which can change at runtime, so `MutableSettings` seems like the best place for it (eventually we will only have a single `TracerManager` and `TracerSettings` per lifetime > Note that this also solves an existing edge-case bug when customers do config in code and already-finished traces are serialized with the "incorrect" default service name. ## Implementation details Mostly commit-by-commit but: - Move the "fallback application name" calculation to a helper class - Expose the fallback application name on `TracerSettings` - Created as a `Lazy<>` because this calculation can be kind of expensive, and isn't necessary if the customer specifies a service name. - Exposed on `TracerSettings` because it doesn't change - Expose `DefaultServiceName` on `MutableSettings` instead of `TracerManager`. - Update usages to point to the new location Additionally, there are some places where I believe we were "incorrectly" using the `DD_SERVICE` value, and ignoring the real fallback name. - [x] Service Discovery's `StoreTracerMetadata` - @anna-git can you confirm if I'm correct that this _should_ be using the "calculated" service name as a fallback? - [x] `TraceExporterConfiguration` - @ganeshnj, same question, can you confirm that we should be passing the "calculated" service name, not just the "explictly set" service name? One additional aspect I think we should consider: - Currently we're calling `NormalizeService(serviceName)` in a few places. Is there any reason we shouldn't be _always_ normalizing the service name? - e.g. why don't we normalize `DefaultServiceName` automatically? ## Test coverage Covered by existing tests generally ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-819 Part of a config stack - #7522 - #7525 - #7530 👈 - #7532 - #7543 - #7544
6a90f09 to
7655779
Compare
…ropriate (#7543) ## Summary of changes Fix usages of `Tracer.Instance.Settings` to use `Tracer.Instance.CurrentTracerSettings.Settings` where appropriate ## Reason for change This PR "fixes" the places that were previously grabbing the environment/service etc from `TracerSettings` to use the `MutableSettings` exposed via `CurrentTracerSettings` instead, as the location where these settings will ultimately exist. This is effectively still just a refactoring, but prepares for the point where these settings aren't exposed on `TracerSettings` at all. The updates in this PR are for cases where you _don't_ have long-lived services, and rather need to do ad-hoc `Tracer.Instance` grabbing of the setting values in a global context. Note too that many of these places _could_ be updated in the future to subscribe to changes if that provides performance benefits. Also note that I elected not to change most calls to `IsIntegrationEnabled()` etc in this PR as there are hundreds of locations. The follow up PR handles that Also found a few cases that were incorrectly assuming that these values cannot change. Marked them with 'TODO: Subscribe to changes in settings' ## Implementation details - Mostly find and replace to use `CurrentTracerSettings.Settings` - Occasional extraction of a variable where it makes sense to avoid repeated access - Functionally identical currently (where `MutableSettings` is replaced on `TracerSettings`) but will be a required change once we stop replacing `TracerManager`. ## Test coverage Covered by existing tests ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-819 Part of a config stack - #7522 - #7525 - #7530 - #7532 - #7543 👈 - #7544
…tIntegrationAnalyticsSampleRate()` (#7544) ## Summary of changes Fix usages of `IsIntegrationEnabled()`, `IsErrorStatusCode()`, and `GetIntegrationAnalyticsSampleRate()` to use `MutableSettings` instead of `TracerSettings` ## Reason for change These functions are dependent on `MutableSettings`, and are exposed there, so making sure we call the methods there, and remove the delegation from `TracerSettings` entirely. ## Implementation details - Find and replace usages - Remove the old delegating methods ## Test coverage Just a refactor, so covered by existing tests ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-819 Part of a config stack - #7522 - #7525 - #7530 - #7532 - #7543 - #7544 👈 - #7695
…ndows (#7721) ## Summary of changes Enforces that you can't _change_ the `AgentUri` to be a UDS Uri if you're on Windows ## Reason for change The trace exporter doesn't work with UDS on Windows, so we have a check in `TracerSettings` that disables the pipeline if we find this scenario. However, user's can still _change_ the agent URI at runtime in code (😭). We currently assume that the data pipeline won't be toggled at runtime (we _do_ allow for reconfiguring it in general, but not for completely removing or reintroducing). Changing this to allow the scenario would be a pain, so instead this PR blocks you from setting a UDS URI in code if you're on Windows. The good news is that as far as I can tell, noone does this today, so while _technically_ it could be considered a breaking change, I think it's ok. ## Implementation details - Throw an `ArgumentException` in the Datadog.Trace.Manual library, if you're on Windows (or .NET FX) and you try to set a UDS agent URI (using the same "detection" we do in `ExporterSettings`. - Add a check in the Instrumentation of `Tracer.Configure()` to make sure it hasn't slipped through. This could happen if a customer was using an old version of the Datadog.Trace NuGet package with a newer version of auto instrumentation. Note that this adds two additional framework references for .NET Core 3.1+, to check if we're on Windows. ## Test coverage Added an extra step to the manual instrumentation integration test to confirm we throw ## 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
## Summary of changes Add a helper for comparing `ReadOnlyDictionary<>` instances ## Reason for change As part of the config work, we need to detect if tags have changed when customers do a manual/remote config update. This helper makes it easy ## Implementation details Added a `SequenceEqual` extension method. Note that I used `SequenceEqual` because it _already_ exists in _System.Linq_, but I could see an argument that it's too easy to use the wrong one, and instead we could use a different name? `IsSameAs(other)`? Also, I only wrote this for `ReadOnlyDictionary<>` because that's all we need, it's what we use for all our setting dictionaries, and it will be (a tiny bit) faster than making it `IDictionary<>`, but happy to change if people feel strongly. ## Test coverage Added unit 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 --------- Co-authored-by: Steven Bouwkamp <[email protected]>
Summary of changes
Don't pass a
Tracerinstance toPerTraceSettings.GetServiceName()(as it's not required)Reason for change
Cleanup/simplify the code.
#7530 exposes
MutableSettingsandDefaultServiceNameonPerTraceSettings. ReadingDefaultServiceNamewas the only reasonGetServiceName()took aTracer, so this is now uneccessary.Implementation details
MutableSettings.DefaultServiceNamedirectly insidePerTraceSettings.GetServiceName()TracerinstanceTest coverage
Covered by existing, just a refactoring
Other details
Could have done it as part of #7530 but trying to keep things small!
https://datadoghq.atlassian.net/browse/LANGPLAT-819
Part of a config stack
MutableSettingsfromTracerSettings#7522MutableSettingson dynamic config changes #7525DefaultServiceNametoMutableSettings#7530PerTraceSettings.GetServiceName()#7532 👈TracerSettingsto useMutableSettingswhere appropriate #7543IsIntegrationEnabled(),IsErrorStatusCode(), andGetIntegrationAnalyticsSampleRate()#7544