Skip to content
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

Trim whitespace in DBM_PROPAGATION_MODE #6332

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Trim whitespace in DBM_PROPAGATION_MODE #6332

merged 2 commits into from
Nov 27, 2024

Conversation

bouwkast
Copy link
Contributor

@bouwkast bouwkast commented Nov 21, 2024

Summary of changes

Trims whitespace in DBM_PROPAGATION_MODE

Reason for change

Saw usages of DBM_PROPAGATION_MODE : service <- note the space at the end, which caused DBM to be disabled.

Implementation details

Added .Trim()

Test coverage

Added tests

Other details

https://datadoghq.atlassian.net/browse/AIDM-493

@bouwkast bouwkast requested a review from a team as a code owner November 21, 2024 14:36
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

tracer/src/Datadog.Trace/Configuration/TracerSettings.cs Outdated Show resolved Hide resolved
Ensures that we'll trim if we use this function
somewhere else
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 21, 2024

Datadog Report

Branch report: steven/trim-dbm
Commit report: 739dbff
Test service: dd-trace-dotnet

✅ 0 Failed, 447044 Passed, 2730 Skipped, 19h 17m 21.92s Total Time
⌛ 1 Performance Regression

⌛ Performance Regressions vs Default Branch (1)

  • Baseline - Samples.HttpMessageHandler.windows.net80.json.scenarios 267.78ms (+3.57ms, +1%) - Details

@andrewlock
Copy link
Member

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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6332) - mean (72ms)  : 64, 80
     .   : milestone, 72,
    master - mean (72ms)  : 64, 80
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (1,108ms)  : 1091, 1125
     .   : milestone, 1108,
    master - mean (1,106ms)  : 1085, 1128
     .   : milestone, 1106,

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

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (771ms)  : 755, 787
     .   : milestone, 771,
    master - mean (767ms)  : 753, 781
     .   : milestone, 767,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6332) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 94
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (723ms)  : 707, 739
     .   : milestone, 723,
    master - mean (722ms)  : 707, 737
     .   : milestone, 722,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6332) - mean (192ms)  : 187, 196
     .   : milestone, 192,
    master - mean (191ms)  : 186, 196
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (1,217ms)  : 1189, 1245
     .   : milestone, 1217,
    master - mean (1,213ms)  : 1192, 1234
     .   : milestone, 1213,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6332) - mean (277ms)  : 273, 282
     .   : milestone, 277,
    master - mean (277ms)  : 273, 281
     .   : milestone, 277,

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (947ms)  : 931, 964
     .   : milestone, 947,
    master - mean (947ms)  : 933, 961
     .   : milestone, 947,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6332) - mean (267ms)  : 263, 271
     .   : milestone, 267,
    master - mean (266ms)  : 261, 270
     .   : milestone, 266,

    section CallTarget+Inlining+NGEN
    This PR (6332) - mean (932ms)  : 911, 953
     .   : milestone, 932,
    master - mean (933ms)  : 914, 951
     .   : milestone, 933,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6332 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.352
  • All benchmarks have the same 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 7.96μs 42.4ns 220ns 0.0153 0.00764 0 5.62 KB
master StartStopWithChild netcoreapp3.1 10.1μs 50.3ns 225ns 0.0199 0.00997 0 5.8 KB
master StartStopWithChild net472 16.1μs 36.8ns 143ns 1.03 0.29 0.0966 6.21 KB
#6332 StartStopWithChild net6.0 8.04μs 45.1ns 316ns 0.0277 0.0119 0 5.61 KB
#6332 StartStopWithChild netcoreapp3.1 10.1μs 56.1ns 332ns 0.0247 0.00987 0 5.8 KB
#6332 StartStopWithChild net472 16.2μs 51.5ns 200ns 1.05 0.312 0.0961 6.21 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 508μs 297ns 1.15μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 463ns 1.73μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 857μs 384ns 1.44μs 0.425 0 0 3.3 KB
#6332 WriteAndFlushEnrichedTraces net6.0 495μs 519ns 2.01μs 0 0 0 2.7 KB
#6332 WriteAndFlushEnrichedTraces netcoreapp3.1 660μs 485ns 1.82μs 0 0 0 2.7 KB
#6332 WriteAndFlushEnrichedTraces net472 865μs 406ns 1.52μs 0.431 0 0 3.3 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 150μs 840ns 5.69μs 0.148 0 0 14.47 KB
master SendRequest netcoreapp3.1 171μs 981ns 9.62μs 0.162 0 0 17.27 KB
master SendRequest net472 0.000961ns 0.000537ns 0.00201ns 0 0 0 0 b
#6332 SendRequest net6.0 154μs 897ns 8.65μs 0.147 0 0 14.47 KB
#6332 SendRequest netcoreapp3.1 172μs 1.09μs 10.6μs 0.163 0 0 17.27 KB
#6332 SendRequest net472 0.00163ns 0.000817ns 0.00306ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 570μs 2.81μs 17.3μs 0.573 0 0 41.64 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 710μs 4.1μs 32.3μs 0.353 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 880μs 4.29μs 17.2μs 8.25 2.6 0.434 53.31 KB
#6332 WriteAndFlushEnrichedTraces net6.0 572μs 3.08μs 16.6μs 0.563 0 0 41.59 KB
#6332 WriteAndFlushEnrichedTraces netcoreapp3.1 671μs 3.53μs 18.3μs 0.349 0 0 41.68 KB
#6332 WriteAndFlushEnrichedTraces net472 860μs 4.24μs 18μs 8.36 2.64 0.44 53.3 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.34μs 1.13ns 4.37ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.77μs 1.3ns 5.02ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.05μs 1.24ns 4.31ns 0.157 0.00102 0 987 B
#6332 ExecuteNonQuery net6.0 1.41μs 2.67ns 10.3ns 0.0142 0 0 1.02 KB
#6332 ExecuteNonQuery netcoreapp3.1 1.91μs 1.13ns 4.21ns 0.0134 0 0 1.02 KB
#6332 ExecuteNonQuery net472 2.06μs 1.51ns 5.65ns 0.156 0.00103 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.24μs 0.505ns 1.89ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.49μs 1.26ns 4.36ns 0.0126 0 0 976 B
master CallElasticsearch net472 2.54μs 2.1ns 8.14ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.31μs 4.23ns 16.4ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.68μs 1.04ns 3.76ns 0.0134 0 0 1.02 KB
master CallElasticsearchAsync net472 2.7μs 2.86ns 11.1ns 0.166 0 0 1.05 KB
#6332 CallElasticsearch net6.0 1.19μs 0.734ns 2.84ns 0.0137 0 0 976 B
#6332 CallElasticsearch netcoreapp3.1 1.56μs 1.16ns 4.35ns 0.0133 0 0 976 B
#6332 CallElasticsearch net472 2.64μs 1.81ns 7.02ns 0.157 0 0 995 B
#6332 CallElasticsearchAsync net6.0 1.24μs 0.717ns 2.68ns 0.0136 0 0 952 B
#6332 CallElasticsearchAsync netcoreapp3.1 1.61μs 0.768ns 2.66ns 0.0134 0 0 1.02 KB
#6332 CallElasticsearchAsync net472 2.61μs 1.39ns 5.38ns 0.166 0 0 1.05 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.21μs 0.387ns 1.45ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.64μs 0.471ns 1.76ns 0.0123 0 0 952 B
master ExecuteAsync net472 1.88μs 0.42ns 1.51ns 0.144 0 0 915 B
#6332 ExecuteAsync net6.0 1.22μs 0.424ns 1.59ns 0.0134 0 0 952 B
#6332 ExecuteAsync netcoreapp3.1 1.69μs 0.779ns 2.91ns 0.0127 0 0 952 B
#6332 ExecuteAsync net472 1.87μs 0.478ns 1.85ns 0.145 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 4.29μs 1.74ns 6.52ns 0.0322 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.45μs 2.31ns 8.95ns 0.038 0 0 2.85 KB
master SendAsync net472 7.35μs 1.49ns 5.76ns 0.495 0 0 3.12 KB
#6332 SendAsync net6.0 4.41μs 1.4ns 5.43ns 0.0309 0 0 2.31 KB
#6332 SendAsync netcoreapp3.1 5.31μs 4.98ns 19.3ns 0.0369 0 0 2.85 KB
#6332 SendAsync net472 7.41μs 1.51ns 5.86ns 0.493 0 0 3.12 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 1.46μs 0.649ns 2.43ns 0.0235 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.19μs 0.671ns 2.42ns 0.0224 0 0 1.64 KB
master EnrichedLog net472 2.53μs 1.87ns 7.23ns 0.249 0 0 1.57 KB
#6332 EnrichedLog net6.0 1.55μs 1.38ns 5.36ns 0.0232 0 0 1.64 KB
#6332 EnrichedLog netcoreapp3.1 2.26μs 1.5ns 5.18ns 0.0226 0 0 1.64 KB
#6332 EnrichedLog net472 2.77μs 1.11ns 4.16ns 0.249 0 0 1.57 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 120μs 177ns 686ns 0.0603 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 123μs 197ns 765ns 0.0616 0 0 4.28 KB
master EnrichedLog net472 152μs 131ns 509ns 0.676 0.225 0 4.46 KB
#6332 EnrichedLog net6.0 119μs 113ns 437ns 0 0 0 4.28 KB
#6332 EnrichedLog netcoreapp3.1 123μs 148ns 573ns 0 0 0 4.28 KB
#6332 EnrichedLog net472 152μs 198ns 767ns 0.678 0.226 0 4.46 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 3.13μs 1.31ns 5.06ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.37μs 1ns 3.88ns 0.0306 0 0 2.2 KB
master EnrichedLog net472 4.81μs 1.52ns 5.88ns 0.319 0 0 2.02 KB
#6332 EnrichedLog net6.0 3.13μs 0.786ns 2.94ns 0.0299 0 0 2.2 KB
#6332 EnrichedLog netcoreapp3.1 4.13μs 1.44ns 5.56ns 0.0291 0 0 2.2 KB
#6332 EnrichedLog net472 4.72μs 1.2ns 4.48ns 0.319 0 0 2.02 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.32μs 0.768ns 2.97ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.81μs 0.663ns 2.48ns 0.0151 0 0 1.14 KB
master SendReceive net472 2.04μs 1.42ns 5.3ns 0.183 0 0 1.16 KB
#6332 SendReceive net6.0 1.34μs 1.11ns 4.3ns 0.0161 0 0 1.14 KB
#6332 SendReceive netcoreapp3.1 1.66μs 0.463ns 1.67ns 0.0158 0 0 1.14 KB
#6332 SendReceive net472 2.13μs 0.745ns 2.89ns 0.183 0 0 1.16 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 2.84μs 0.937ns 3.63ns 0.0227 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 4.56ns 17.7ns 0.0216 0 0 1.65 KB
master EnrichedLog net472 4.56μs 8.69ns 33.7ns 0.322 0 0 2.04 KB
#6332 EnrichedLog net6.0 2.9μs 1.24ns 4.79ns 0.0217 0 0 1.6 KB
#6332 EnrichedLog netcoreapp3.1 4.06μs 3.14ns 11.7ns 0.0203 0 0 1.65 KB
#6332 EnrichedLog net472 4.43μs 1.27ns 4.41ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6332

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.352 724.96 536.37

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 448ns 0.435ns 1.68ns 0.00811 0 0 576 B
master StartFinishSpan netcoreapp3.1 725ns 0.787ns 2.95ns 0.0078 0 0 576 B
master StartFinishSpan net472 644ns 0.909ns 3.52ns 0.0915 0 0 578 B
master StartFinishScope net6.0 481ns 0.915ns 3.54ns 0.00972 0 0 696 B
master StartFinishScope netcoreapp3.1 750ns 0.884ns 3.31ns 0.00924 0 0 696 B
master StartFinishScope net472 908ns 1.77ns 6.84ns 0.104 0 0 658 B
#6332 StartFinishSpan net6.0 411ns 0.909ns 3.52ns 0.00801 0 0 576 B
#6332 StartFinishSpan netcoreapp3.1 536ns 0.931ns 3.48ns 0.00794 0 0 576 B
#6332 StartFinishSpan net472 633ns 1.9ns 7.36ns 0.0918 0 0 578 B
#6332 StartFinishScope net6.0 494ns 0.844ns 3.27ns 0.00986 0 0 696 B
#6332 StartFinishScope netcoreapp3.1 684ns 1.62ns 6.28ns 0.0095 0 0 696 B
#6332 StartFinishScope net472 876ns 1.84ns 7.12ns 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 660ns 1.14ns 4.43ns 0.0096 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 884ns 2.16ns 8.37ns 0.00946 0 0 696 B
master RunOnMethodBegin net472 1.18μs 2.81ns 10.5ns 0.104 0 0 658 B
#6332 RunOnMethodBegin net6.0 653ns 0.874ns 3.39ns 0.00985 0 0 696 B
#6332 RunOnMethodBegin netcoreapp3.1 911ns 1.97ns 7.64ns 0.00915 0 0 696 B
#6332 RunOnMethodBegin net472 1.11μs 1.24ns 4.81ns 0.104 0 0 658 B

@bouwkast bouwkast merged commit 7e26618 into master Nov 27, 2024
73 of 77 checks passed
@bouwkast bouwkast deleted the steven/trim-dbm branch November 27, 2024 14:14
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 27, 2024
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.

2 participants