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

Add null reference checks to RabbitMq integration #4922

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

andrewlock
Copy link
Member

Summary of changes

Fix the null checks in the RabbitMq integration

Reason for change

We know we're getting some NullReferenceException in the RabbitMq integration

Implementation details

Sprinkle some #nullable enable and watch the errors shout. Duck-typing null issues were the culprit again. There's a lot of potentially dubious nullability in the duck types in this one, so tried to be conservative, but will do a thorough test on this one too.

Test coverage

Covered by existing tests

Other details

@andrewlock andrewlock added type:bug area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:integrations labels Nov 23, 2023
@andrewlock andrewlock requested a review from a team as a code owner November 23, 2023 17:11
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 23, 2023

Datadog Report

Branch report: andrew/fix-rabbitmq-nulls
Commit report: 78c8063

dd-trace-dotnet: 0 Failed, 0 New Flaky, 300339 Passed, 939 Skipped, 30m 41.08s Wall Time

@andrewlock
Copy link
Member Author

andrewlock commented Nov 23, 2023

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 (4922) - mean (72ms)  : 62, 81
     .   : milestone, 72,
    master - mean (70ms)  : 62, 78
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (997ms)  : 975, 1019
     .   : milestone, 997,
    master - mean (1,002ms)  : 977, 1027
     .   : milestone, 1002,

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

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (685ms)  : 664, 706
     .   : milestone, 685,
    master - mean (690ms)  : 676, 705
     .   : milestone, 690,

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

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (656ms)  : 628, 684
     .   : milestone, 656,
    master - mean (658ms)  : 634, 682
     .   : milestone, 658,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4922) - mean (188ms)  : 183, 193
     .   : milestone, 188,
    master - mean (188ms)  : 185, 191
     .   : milestone, 188,

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (1,138ms)  : 1109, 1167
     .   : milestone, 1138,
    master - mean (1,130ms)  : 1110, 1150
     .   : milestone, 1130,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4922) - mean (272ms)  : 267, 276
     .   : milestone, 272,
    master - mean (271ms)  : 267, 275
     .   : milestone, 271,

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (1,088ms)  : 1068, 1108
     .   : milestone, 1088,
    master - mean (1,084ms)  : 1062, 1107
     .   : milestone, 1084,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4922) - mean (262ms)  : 258, 265
     .   : milestone, 262,
    master - mean (261ms)  : 256, 266
     .   : milestone, 261,

    section CallTarget+Inlining+NGEN
    This PR (4922) - mean (1,058ms)  : 1033, 1084
     .   : milestone, 1058,
    master - mean (1,056ms)  : 1033, 1080
     .   : milestone, 1056,

Loading

@andrewlock
Copy link
Member Author

andrewlock commented Nov 24, 2023

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4922) (12.165M)   : 0, 12165416
    master (12.163M)   : 0, 12163481
    benchmarks/2.9.0 (11.363M)   : 0, 11362982

    section Automatic
    This PR (4922) (8.185M)   : 0, 8184741
    master (8.409M)   : 0, 8408597
    benchmarks/2.9.0 (8.259M)   : 0, 8258618

    section Trace stats
    This PR (4922) (8.584M)   : 0, 8584257
    master (8.729M)   : 0, 8729003

    section Manual
    This PR (4922) (10.619M)   : 0, 10618808
    master (10.542M)   : 0, 10542248

    section Manual + Automatic
    This PR (4922) (7.846M)   : 0, 7845910
    master (7.889M)   : 0, 7888611

    section Version Conflict
    This PR (4922) (7.153M)   : 0, 7152958
    master (6.884M)   : 0, 6883896

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4922) (9.533M)   : 0, 9533009
    master (9.616M)   : 0, 9616497
    benchmarks/2.9.0 (9.602M)   : 0, 9602224

    section Automatic
    This PR (4922) (6.703M)   : 0, 6703078
    master (6.596M)   : 0, 6595639

    section Trace stats
    This PR (4922) (6.860M)   : 0, 6860394
    master (6.989M)   : 0, 6989476

    section Manual
    This PR (4922) (8.296M)   : 0, 8295876
    master (8.274M)   : 0, 8273669

    section Manual + Automatic
    This PR (4922) (6.151M)   : 0, 6151398
    master (6.107M)   : 0, 6106598

    section Version Conflict
    This PR (4922) (5.634M)   : 0, 5633966
    master (5.766M)   : 0, 5766465

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4922) (9.988M)   : 0, 9988222
    master (10.057M)   : 0, 10057176
    benchmarks/2.9.0 (10.259M)   : 0, 10259311

    section Automatic
    This PR (4922) (7.146M)   : 0, 7146214
    master (7.125M)   : 0, 7124880
    benchmarks/2.9.0 (7.710M)   : 0, 7709529

    section Trace stats
    This PR (4922) (7.390M)   : 0, 7390499
    master (7.492M)   : 0, 7491605

    section Manual
    This PR (4922) (8.785M)   : 0, 8784783
    master (8.808M)   : 0, 8808366

    section Manual + Automatic
    This PR (4922) (6.778M)   : 0, 6778243
    master (7.062M)   : 0, 7061869

    section Version Conflict
    This PR (4922) (6.215M)   : 0, 6214610
    master (6.180M)   : 0, 6179663

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.348M)   : 0, 7347529
    benchmarks/2.9.0 (7.830M)   : 0, 7830154

    section No attack
    master (1.981M)   : 0, 1980603
    benchmarks/2.9.0 (3.253M)   : 0, 3253296

    section Attack
    master (1.573M)   : 0, 1572752
    benchmarks/2.9.0 (2.541M)   : 0, 2540898

    section Blocking
    master (3.225M)   : 0, 3225450

    section IAST default
    master (6.454M)   : 0, 6453817

    section IAST full
    master (5.787M)   : 0, 5787025

    section Base vuln
    master (0.964M)   : 0, 963553

    section IAST vuln
    master (0.878M)   : 0, 877696

Loading

@andrewlock
Copy link
Member Author

andrewlock commented Nov 24, 2023

Benchmarks Report 🐌

Benchmarks for #4922 compared to master:

  • 6 benchmarks are slower, with geometric mean 1.205
  • 1 benchmarks have fewer allocations
  • 1 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 8.59μs 48.3ns 324ns 0.0217 0.00867 0 7.48 KB
master StartStopWithChild netcoreapp3.1 10.8μs 61.2ns 446ns 0.0267 0.016 0.00534 7.57 KB
master StartStopWithChild net472 17.1μs 40.2ns 156ns 1.35 0.358 0.119 7.96 KB
#4922 StartStopWithChild net6.0 8.88μs 50.8ns 366ns 0.0226 0.00904 0 7.48 KB
#4922 StartStopWithChild netcoreapp3.1 10.9μs 56.8ns 278ns 0.0267 0.0107 0 7.58 KB
#4922 StartStopWithChild net472 17μs 49ns 190ns 1.32 0.342 0.103 7.94 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 473μs 206ns 797ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 641μs 327ns 1.27μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 779μs 276ns 1.07μs 0.388 0 0 3.3 KB
#4922 WriteAndFlushEnrichedTraces net6.0 467μs 392ns 1.52μs 0 0 0 2.7 KB
#4922 WriteAndFlushEnrichedTraces netcoreapp3.1 628μs 165ns 596ns 0 0 0 2.7 KB
#4922 WriteAndFlushEnrichedTraces net472 780μs 246ns 951ns 0.391 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4922

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.210 177.17 214.38

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 43.9μs 138ns 498ns 0.0219 0 0 1.77 KB
master AllCycleSimpleBody netcoreapp3.1 47μs 63.9ns 248ns 0.0233 0 0 1.74 KB
master AllCycleSimpleBody net472 49.2μs 131ns 492ns 0.274 0 0 1.81 KB
master AllCycleMoreComplexBody net6.0 223μs 1.27μs 9.32μs 0.106 0 0 9.25 KB
master AllCycleMoreComplexBody netcoreapp3.1 225μs 175ns 654ns 0.111 0 0 9.14 KB
master AllCycleMoreComplexBody net472 239μs 102ns 396ns 1.43 0 0 9.32 KB
master ObjectExtractorSimpleBody net6.0 137ns 0.0738ns 0.286ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 177ns 0.0432ns 0.167ns 0.00375 0 0 272 B
master ObjectExtractorSimpleBody net472 151ns 0.0632ns 0.245ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.74μs 0.915ns 3.54ns 0.0535 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.68μs 1.49ns 5.57ns 0.049 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.53μs 2.4ns 8.98ns 0.602 0.0053 0 3.8 KB
#4922 AllCycleSimpleBody net6.0 44.4μs 19.1ns 74ns 0.022 0 0 1.77 KB
#4922 AllCycleSimpleBody netcoreapp3.1 46.4μs 88.2ns 341ns 0.0231 0 0 1.74 KB
#4922 AllCycleSimpleBody net472 50μs 125ns 483ns 0.27 0 0 1.81 KB
#4922 AllCycleMoreComplexBody net6.0 216μs 159ns 615ns 0.107 0 0 9.25 KB
#4922 AllCycleMoreComplexBody netcoreapp3.1 223μs 56.8ns 205ns 0.111 0 0 9.14 KB
#4922 AllCycleMoreComplexBody net472 239μs 118ns 458ns 1.43 0 0 9.32 KB
#4922 ObjectExtractorSimpleBody net6.0 132ns 0.0412ns 0.149ns 0.00394 0 0 280 B
#4922 ObjectExtractorSimpleBody netcoreapp3.1 214ns 0.295ns 1.14ns 0.00372 0 0 272 B
#4922 ObjectExtractorSimpleBody net472 151ns 0.077ns 0.278ns 0.0446 0 0 281 B
#4922 ObjectExtractorMoreComplexBody net6.0 2.75μs 0.783ns 2.82ns 0.0522 0 0 3.78 KB
#4922 ObjectExtractorMoreComplexBody netcoreapp3.1 3.56μs 0.972ns 3.77ns 0.0498 0 0 3.69 KB
#4922 ObjectExtractorMoreComplexBody net472 3.46μs 1.17ns 4.39ns 0.602 0.00522 0 3.8 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4922

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWaf(args: NestedMap (10))‑net6.0 1.116 50,331.23 56,163.11

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWaf(args=NestedMap (10)) net6.0 50.3μs 15.9ns 57.4ns 0.219 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 69.4μs 49.7ns 186ns 0.182 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) net472 93.8μs 46ns 159ns 2.53 0.0938 0 16.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 119μs 55.4ns 215ns 0.297 0 0 22.41 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 138μs 84.4ns 316ns 0.281 0 0 22.36 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 171μs 820ns 3.28μs 3.57 0.166 0 22.7 KB
master RunWaf(args=NestedMap (100)) net6.0 97.4μs 446ns 1.73μs 0.454 0 0 32.76 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 128μs 269ns 970ns 0.446 0 0 33.33 KB
master RunWaf(args=NestedMap (100)) net472 185μs 862ns 3.34μs 5.28 0.364 0 33.67 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 176μs 123ns 475ns 0.524 0 0 39.1 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 209μs 373ns 1.45μs 0.502 0 0 39.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 263μs 94.2ns 365ns 6.34 0.396 0 40.23 KB
master RunWaf(args=NestedMap (20)) net6.0 101μs 127ns 439ns 0.425 0 0 32.18 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 133μs 710ns 3.82μs 0.381 0 0 32.3 KB
master RunWaf(args=NestedMap (20)) net472 182μs 84.8ns 328ns 5.19 0.364 0 32.63 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 165μs 64.5ns 281ns 0.533 0 0 38.53 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 205μs 1.02μs 4.56μs 0.523 0 0 38.6 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 267μs 1.2μs 4.64μs 6.21 0.518 0 39.2 KB
#4922 RunWaf(args=NestedMap (10)) net6.0 56.1μs 92.8ns 360ns 0.199 0 0 16.06 KB
#4922 RunWaf(args=NestedMap (10)) netcoreapp3.1 68.8μs 388ns 2.51μs 0.214 0 0 16.06 KB
#4922 RunWaf(args=NestedMap (10)) net472 96.3μs 493ns 2.26μs 2.54 0.0939 0 16.14 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 122μs 46ns 178ns 0.305 0 0 22.41 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 137μs 706ns 3.23μs 0.277 0 0 22.36 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) net472 167μs 553ns 2.14μs 3.53 0.168 0 22.7 KB
#4922 RunWaf(args=NestedMap (100)) net6.0 104μs 31.8ns 119ns 0.428 0 0 32.76 KB
#4922 RunWaf(args=NestedMap (100)) netcoreapp3.1 136μs 761ns 4.99μs 0.401 0 0 33.33 KB
#4922 RunWaf(args=NestedMap (100)) net472 186μs 570ns 2.21μs 5.3 0.365 0 33.67 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 168μs 817ns 3.27μs 0.527 0 0 39.1 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 210μs 969ns 3.88μs 0.526 0 0 39.63 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [23]) net472 269μs 1.09μs 4.24μs 6.39 0.522 0 40.23 KB
#4922 RunWaf(args=NestedMap (20)) net6.0 98.2μs 368ns 1.43μs 0.446 0 0 32.18 KB
#4922 RunWaf(args=NestedMap (20)) netcoreapp3.1 133μs 709ns 3.68μs 0.438 0 0 32.3 KB
#4922 RunWaf(args=NestedMap (20)) net472 186μs 95.8ns 332ns 5.11 0.379 0 32.63 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 164μs 93.9ns 339ns 0.524 0 0 38.53 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 204μs 811ns 3.14μs 0.519 0 0 38.6 KB
#4922 RunWafWithAttack(args=Neste(...)tack) [22]) net472 268μs 784ns 3.04μs 6.13 0.522 0 39.2 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 173μs 124ns 446ns 0.258 0 0 18.24 KB
master SendRequest netcoreapp3.1 193μs 275ns 1.06μs 0.194 0 0 20.4 KB
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#4922 SendRequest net6.0 172μs 222ns 861ns 0.171 0 0 18.24 KB
#4922 SendRequest netcoreapp3.1 191μs 470ns 1.82μs 0.191 0 0 20.4 KB
#4922 SendRequest net472 0.000181ns 0.000111ns 0.000415ns 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 557μs 1.46μs 5.67μs 0.561 0 0 41.75 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 668μs 1.08μs 4.2μs 0.34 0 0 41.81 KB
master WriteAndFlushEnrichedTraces net472 817μs 3.6μs 13.9μs 8.06 2.42 0.403 53.23 KB
#4922 WriteAndFlushEnrichedTraces net6.0 549μs 2.46μs 9.51μs 0.556 0 0 41.63 KB
#4922 WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 1.16μs 4.48μs 0.321 0 0 41.73 KB
#4922 WriteAndFlushEnrichedTraces net472 865μs 3.15μs 12.2μs 8.3 2.62 0.437 53.25 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.07μs 0.455ns 1.7ns 0.0108 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 1.31ns 5.07ns 0.0101 0 0 768 B
master ExecuteNonQuery net472 1.7μs 0.684ns 2.47ns 0.116 0.000846 0 730 B
#4922 ExecuteNonQuery net6.0 1.09μs 0.792ns 3.07ns 0.0104 0 0 768 B
#4922 ExecuteNonQuery netcoreapp3.1 1.53μs 1.78ns 6.88ns 0.00995 0 0 768 B
#4922 ExecuteNonQuery net472 1.8μs 0.878ns 3.4ns 0.116 0.000899 0 730 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.13μs 2.79ns 10ns 0.013 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.55μs 0.945ns 3.66ns 0.0124 0 0 936 B
master CallElasticsearch net472 2.43μs 0.838ns 3.13ns 0.151 0 0 955 B
master CallElasticsearchAsync net6.0 1.34μs 0.807ns 3.02ns 0.0128 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.61μs 0.982ns 3.67ns 0.0136 0 0 984 B
master CallElasticsearchAsync net472 2.75μs 0.5ns 1.87ns 0.159 0 0 1.01 KB
#4922 CallElasticsearch net6.0 1.24μs 1.19ns 4.62ns 0.0131 0 0 936 B
#4922 CallElasticsearch netcoreapp3.1 1.5μs 0.574ns 2.22ns 0.0121 0 0 936 B
#4922 CallElasticsearch net472 2.51μs 1.24ns 4.79ns 0.151 0 0 955 B
#4922 CallElasticsearchAsync net6.0 1.23μs 0.391ns 1.46ns 0.0129 0 0 912 B
#4922 CallElasticsearchAsync netcoreapp3.1 1.71μs 0.864ns 3.23ns 0.0129 0 0 984 B
#4922 CallElasticsearchAsync net472 2.64μs 1.05ns 4.05ns 0.161 0 0 1.01 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.32μs 0.758ns 2.94ns 0.0126 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.57μs 0.769ns 2.88ns 0.0119 0 0 912 B
master ExecuteAsync net472 1.81μs 0.444ns 1.72ns 0.139 0 0 875 B
#4922 ExecuteAsync net6.0 1.29μs 1.4ns 5.42ns 0.0126 0 0 912 B
#4922 ExecuteAsync netcoreapp3.1 1.63μs 0.577ns 2.24ns 0.0122 0 0 912 B
#4922 ExecuteAsync net472 1.78μs 0.988ns 3.83ns 0.139 0 0 875 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 3.99μs 2.59ns 9.7ns 0.0278 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.95μs 1.66ns 6.41ns 0.0347 0 0 2.63 KB
master SendAsync net472 7.67μs 2.07ns 8.01ns 0.523 0 0 3.31 KB
#4922 SendAsync net6.0 4.12μs 1.31ns 4.73ns 0.0288 0 0 2.1 KB
#4922 SendAsync netcoreapp3.1 4.85μs 2.26ns 8.73ns 0.0361 0 0 2.63 KB
#4922 SendAsync net472 7.82μs 2.43ns 9.11ns 0.524 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #4922

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑netcoreapp3.1 1.503 71,300.00 107,150.00 multimodal
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑netcoreapp3.1 1.183 54,100.00 64,000.00 bimodal

More allocations ⚠️ in #4922

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 58.52 KB 59.7 KB 1.18 KB 2.01%

Fewer allocations 🎉 in #4922

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 73.73 KB 57.34 KB -16.38 KB -22.22%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 62μs 880ns 8.57μs 0 0 0 43.44 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 55.8μs 422ns 4.09μs 0 0 0 42.64 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 38μs 173ns 648ns 0 0 0 58.52 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 91.2μs 3.1μs 31μs 0 0 0 43.29 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 71.7μs 375ns 1.87μs 0 0 0 42.64 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 59.6μs 683ns 6.37μs 0 0 0 73.73 KB
#4922 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 60μs 694ns 6.94μs 0 0 0 43.44 KB
#4922 StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 65.1μs 813ns 7.92μs 0 0 0 42.64 KB
#4922 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 37.6μs 103ns 384ns 0 0 0 59.7 KB
#4922 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 93.7μs 2.81μs 28.1μs 0 0 0 43.29 KB
#4922 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 109μs 3.72μs 36.8μs 0 0 0 42.64 KB
#4922 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 61.8μs 320ns 1.5μs 0 0 0 57.34 KB
Benchmarks.Trace.ILoggerBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4922

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.140 1,439.92 1,641.31

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.44μs 0.519ns 1.94ns 0.0224 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 2.17μs 0.494ns 1.78ns 0.0206 0 0 1.57 KB
master EnrichedLog net472 2.59μs 2.1ns 7.85ns 0.238 0 0 1.5 KB
#4922 EnrichedLog net6.0 1.64μs 0.751ns 2.91ns 0.0221 0 0 1.57 KB
#4922 EnrichedLog netcoreapp3.1 2.26μs 1.4ns 5.05ns 0.0207 0 0 1.57 KB
#4922 EnrichedLog net472 2.66μs 1.02ns 3.81ns 0.238 0 0 1.5 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 112μs 220ns 854ns 0.0555 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 118μs 283ns 1.1μs 0 0 0 4.21 KB
master EnrichedLog net472 148μs 193ns 746ns 0.662 0.221 0 4.39 KB
#4922 EnrichedLog net6.0 114μs 247ns 856ns 0.0569 0 0 4.21 KB
#4922 EnrichedLog netcoreapp3.1 118μs 217ns 813ns 0.0588 0 0 4.21 KB
#4922 EnrichedLog net472 148μs 108ns 420ns 0.669 0.223 0 4.39 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 2.91μs 1.12ns 4.17ns 0.0306 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 4.18μs 1.29ns 4.99ns 0.0274 0 0 2.13 KB
master EnrichedLog net472 4.86μs 1.55ns 5.8ns 0.309 0 0 1.95 KB
#4922 EnrichedLog net6.0 2.91μs 1.29ns 4.99ns 0.0293 0 0 2.13 KB
#4922 EnrichedLog netcoreapp3.1 4.11μs 2.09ns 7.52ns 0.0287 0 0 2.13 KB
#4922 EnrichedLog net472 4.82μs 3.3ns 12.8ns 0.309 0 0 1.95 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.33μs 1.75ns 6.79ns 0.0153 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.7μs 4.22ns 16.3ns 0.0151 0 0 1.1 KB
master SendReceive net472 2.25μs 1.57ns 5.68ns 0.176 0 0 1.12 KB
#4922 SendReceive net6.0 1.36μs 0.895ns 3.35ns 0.0157 0 0 1.1 KB
#4922 SendReceive netcoreapp3.1 1.8μs 0.738ns 2.86ns 0.0152 0 0 1.1 KB
#4922 SendReceive net472 2.18μs 0.906ns 3.26ns 0.177 0 0 1.12 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.75μs 1.86ns 6.94ns 0.0206 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.96μs 1.11ns 4.29ns 0.0198 0 0 1.58 KB
master EnrichedLog net472 4.15μs 1.26ns 4.9ns 0.31 0 0 1.97 KB
#4922 EnrichedLog net6.0 2.83μs 1.19ns 4.12ns 0.0217 0 0 1.53 KB
#4922 EnrichedLog netcoreapp3.1 3.74μs 2.3ns 8.9ns 0.0205 0 0 1.58 KB
#4922 EnrichedLog net472 4.18μs 1.35ns 5.22ns 0.312 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4922

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.117 616.66 688.65

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 548ns 0.574ns 2.22ns 0.00749 0 0 536 B
master StartFinishSpan netcoreapp3.1 617ns 0.197ns 0.761ns 0.00733 0 0 536 B
master StartFinishSpan net472 812ns 1.85ns 7.15ns 0.085 0 0 538 B
master StartFinishScope net6.0 576ns 0.217ns 0.842ns 0.00908 0 0 656 B
master StartFinishScope netcoreapp3.1 846ns 0.512ns 1.98ns 0.00878 0 0 656 B
master StartFinishScope net472 1.03μs 0.239ns 0.895ns 0.0981 0 0 618 B
#4922 StartFinishSpan net6.0 560ns 0.982ns 3.8ns 0.00754 0 0 536 B
#4922 StartFinishSpan netcoreapp3.1 693ns 1.61ns 6.24ns 0.00715 0 0 536 B
#4922 StartFinishSpan net472 771ns 0.129ns 0.5ns 0.0852 0 0 538 B
#4922 StartFinishScope net6.0 601ns 0.431ns 1.67ns 0.00929 0 0 656 B
#4922 StartFinishScope netcoreapp3.1 819ns 2.21ns 8.55ns 0.00874 0 0 656 B
#4922 StartFinishScope net472 1.01μs 0.797ns 3.08ns 0.098 0 0 618 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 605ns 0.385ns 1.49ns 0.0091 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 1.01μs 0.367ns 1.32ns 0.00907 0 0 656 B
master RunOnMethodBegin net472 1.13μs 0.841ns 3.26ns 0.0979 0 0 618 B
#4922 RunOnMethodBegin net6.0 641ns 0.467ns 1.81ns 0.00931 0 0 656 B
#4922 RunOnMethodBegin netcoreapp3.1 935ns 0.428ns 1.66ns 0.00885 0 0 656 B
#4922 RunOnMethodBegin net472 1.12μs 0.506ns 1.96ns 0.0979 0 0 618 B

@andrewlock andrewlock merged commit e53d536 into master Nov 24, 2023
56 checks passed
@andrewlock andrewlock deleted the andrew/fix-rabbitmq-nulls branch November 24, 2023 14:04
@github-actions github-actions bot added this to the vNext milestone Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:integrations area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:telemetry type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants