Skip to content

Add tests for manual injection/extraction and guard invalid implementations #6998

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

Merged
merged 8 commits into from
May 23, 2025

Conversation

andrewlock
Copy link
Member

Summary of changes

Guard against incorrect inject/extract propagation implementations

Reason for change

We saw an error where an injector/extractor was returning null during context extraction, which it should not do. #6991 introduced a null check to avoid throwing. This PR adds additional safety to the checks, explicitly related to the manual-instrumentation implementation, and adds extra tests.

Implementation details

  • Wrap each of the functions passed in the manual API with a "safe" extractor/injector to guard against exceptions/nulls
    • We just swallow the errors, but that's what would happen anyway, and this way we don't unactionable logs.
    • It might be nice to have a way to actually bubble-up specific non-custom exceptions someway, but not critical, and would require a bunch of changes, so meh.

Test coverage

  • Add unit tests for the integrations to confirm the wrapping handles errors
  • Add integration tests for the instrumentation

Other details

Related to #6991

@andrewlock andrewlock requested review from a team as code owners May 23, 2025 08:19
@andrewlock andrewlock added area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) identified-by:telemetry labels May 23, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 23, 2025

Datadog Report

All test runs 7f0681f 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 565306 4284 26h 26m 44.05s Link
exploration_tests 0 0 0 22085 3 2m 12.82s Link

@andrewlock andrewlock force-pushed the andrew/fix-null-ref-in-manual branch from 1e738b8 to 7f0681f Compare May 23, 2025 08:44
@andrewlock
Copy link
Member Author

Execution-Time Benchmarks Report ⏱️

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

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

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

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

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

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6998) - mean (69ms)  : 62, 76
     .   : milestone, 69,
    master - mean (68ms)  : 66, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (1,005ms)  : 984, 1025
     .   : milestone, 1005,
    master - mean (1,007ms)  : 987, 1027
     .   : milestone, 1007,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6998) - mean (103ms)  : 101, 105
     .   : milestone, 103,
    master - mean (102ms)  : 100, 104
     .   : milestone, 102,

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (691ms)  : 674, 707
     .   : milestone, 691,
    master - mean (694ms)  : 676, 712
     .   : milestone, 694,

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

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (651ms)  : 632, 669
     .   : milestone, 651,
    master - mean (656ms)  : 633, 679
     .   : milestone, 656,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6998) - mean (189ms)  : 185, 193
     .   : milestone, 189,
    master - mean (190ms)  : 187, 193
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (1,106ms)  : 1081, 1131
     .   : milestone, 1106,
    master - mean (1,119ms)  : 1086, 1153
     .   : milestone, 1119,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6998) - mean (268ms)  : 264, 273
     .   : milestone, 268,
    master - mean (268ms)  : 264, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (877ms)  : 843, 910
     .   : milestone, 877,
    master - mean (877ms)  : 846, 907
     .   : milestone, 877,

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

    section CallTarget+Inlining+NGEN
    This PR (6998) - mean (870ms)  : 838, 902
     .   : milestone, 870,
    master - mean (867ms)  : 845, 889
     .   : milestone, 867,

Loading

@pr-commenter
Copy link

pr-commenter bot commented May 23, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #6998 compared to master:

  • 1 benchmarks are faster, with geometric mean 2.593
  • 6 benchmarks have fewer allocations
  • 4 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 ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.15 KB 6.1 KB -47 B -0.76%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.2μs 58.1ns 419ns 0 0 0 5.56 KB
master StartStopWithChild netcoreapp3.1 13.2μs 68.5ns 328ns 0 0 0 5.74 KB
master StartStopWithChild net472 21.6μs 101ns 392ns 1 0.334 0.111 6.15 KB
#6998 StartStopWithChild net6.0 10.6μs 58.3ns 364ns 0 0 0 5.54 KB
#6998 StartStopWithChild netcoreapp3.1 13.7μs 74.2ns 393ns 0 0 0 5.74 KB
#6998 StartStopWithChild net472 22.4μs 114ns 547ns 0.952 0.317 0 6.1 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.35 KB 3.31 KB -46 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 931μs 64.7ns 242ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 253ns 947ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.21ms 315ns 1.22μs 0 0 0 3.35 KB
#6998 WriteAndFlushEnrichedTraces net6.0 914μs 104ns 376ns 0 0 0 2.71 KB
#6998 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 164ns 592ns 0 0 0 2.7 KB
#6998 WriteAndFlushEnrichedTraces net472 1.24ms 96ns 372ns 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 324μs 1.64μs 7.84μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 471μs 1.34μs 5.2μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 436μs 131ns 491ns 36.6 2.16 0 236.35 KB
master AllCycleMoreComplexBody net6.0 338μs 1.25μs 4.86μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 497μs 1.5μs 5.82μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 444μs 108ns 404ns 36.6 2.16 0 239.87 KB
master ObjectExtractorSimpleBody net6.0 312ns 1.52ns 6.27ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 398ns 1.95ns 8.25ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 301ns 0.0411ns 0.154ns 0.0434 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.42μs 32ns 136ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.69μs 38.2ns 166ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.71μs 2.45ns 9.5ns 0.57 0 0 3.8 KB
#6998 AllCycleSimpleBody net6.0 338μs 335ns 1.3μs 0 0 0 197.06 KB
#6998 AllCycleSimpleBody netcoreapp3.1 499μs 1.14μs 4.4μs 0 0 0 204.77 KB
#6998 AllCycleSimpleBody net472 438μs 158ns 590ns 36.6 2.16 0 236.35 KB
#6998 AllCycleMoreComplexBody net6.0 339μs 1.77μs 8.84μs 0 0 0 200.56 KB
#6998 AllCycleMoreComplexBody netcoreapp3.1 504μs 651ns 2.52μs 0 0 0 208.18 KB
#6998 AllCycleMoreComplexBody net472 448μs 312ns 1.21μs 37.9 2.23 0 239.88 KB
#6998 ObjectExtractorSimpleBody net6.0 318ns 1.57ns 6.64ns 0 0 0 280 B
#6998 ObjectExtractorSimpleBody netcoreapp3.1 401ns 1.96ns 8.06ns 0 0 0 272 B
#6998 ObjectExtractorSimpleBody net472 301ns 0.02ns 0.0748ns 0.044 0 0 281 B
#6998 ObjectExtractorMoreComplexBody net6.0 6.36μs 1.79ns 6.93ns 0 0 0 3.78 KB
#6998 ObjectExtractorMoreComplexBody netcoreapp3.1 7.69μs 34.9ns 140ns 0 0 0 3.69 KB
#6998 ObjectExtractorMoreComplexBody net472 6.69μs 3.99ns 15.5ns 0.602 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
master EncodeArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master EncodeArgs net472 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master EncodeLegacyArgs net472 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeArgs net472 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeLegacyArgs net6.0 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeLegacyArgs netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#6998 EncodeLegacyArgs net472 N/A N/A N/A NaN NaN NaN 0 b
Benchmarks.Trace.Asm.AppSecWafBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmark netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmark net472 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master RunWafRealisticBenchmarkWithAttack net472 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmark net6.0 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmark netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmark net472 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmarkWithAttack net6.0 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#6998 RunWafRealisticBenchmarkWithAttack net472 N/A N/A N/A NaN NaN NaN 0 b
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 34.4ns 133ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 72.1μs 224ns 866ns 0 0 0 17.42 KB
master SendRequest net472 0.0118ns 0.00277ns 0.0107ns 0 0 0 0 b
#6998 SendRequest net6.0 60.9μs 45.4ns 176ns 0 0 0 14.53 KB
#6998 SendRequest netcoreapp3.1 71.8μs 105ns 394ns 0 0 0 17.42 KB
#6998 SendRequest net472 0.0125ns 0.00351ns 0.0136ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.8 KB 42.37 KB 568 B 1.36%

Fewer allocations 🎉 in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.56 KB 55.5 KB -1.06 KB -1.87%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 706μs 3.77μs 19.6μs 0 0 0 41.8 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 707μs 3.93μs 23.9μs 0 0 0 42.02 KB
master WriteAndFlushEnrichedTraces net472 936μs 2.99μs 11.2μs 8.33 0 0 56.56 KB
#6998 WriteAndFlushEnrichedTraces net6.0 669μs 2.31μs 8.95μs 0 0 0 42.37 KB
#6998 WriteAndFlushEnrichedTraces netcoreapp3.1 668μs 3.79μs 26.5μs 0 0 0 42.12 KB
#6998 WriteAndFlushEnrichedTraces net472 879μs 2.29μs 8.58μs 4.46 0 0 55.5 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.93μs 7.28ns 27.2ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.42μs 10.5ns 40.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.99μs 5.01ns 19.4ns 0.148 0.0148 0 995 B
#6998 ExecuteNonQuery net6.0 1.9μs 8.04ns 31.2ns 0 0 0 1.03 KB
#6998 ExecuteNonQuery netcoreapp3.1 2.58μs 11.7ns 45.2ns 0 0 0 1.02 KB
#6998 ExecuteNonQuery net472 2.8μs 2.65ns 9.9ns 0.155 0.0141 0 995 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.81μs 8.8ns 37.3ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.28μs 10.8ns 41.8ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.45μs 0.785ns 2.83ns 0.156 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.83μs 7.5ns 29ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.4μs 3.61ns 14ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.6μs 1.31ns 5.08ns 0.163 0 0 1.11 KB
#6998 CallElasticsearch net6.0 1.7μs 8.34ns 36.3ns 0 0 0 1.04 KB
#6998 CallElasticsearch netcoreapp3.1 2.24μs 0.684ns 2.56ns 0 0 0 1.04 KB
#6998 CallElasticsearch net472 3.57μs 2.84ns 11ns 0.162 0 0 1.05 KB
#6998 CallElasticsearchAsync net6.0 1.89μs 4.17ns 16.1ns 0 0 0 1.02 KB
#6998 CallElasticsearchAsync netcoreapp3.1 2.46μs 5.45ns 21.1ns 0 0 0 1.09 KB
#6998 CallElasticsearchAsync net472 3.72μs 2.57ns 9.97ns 0.168 0 0 1.11 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.74μs 8.76ns 39.2ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.34μs 6.97ns 26.1ns 0 0 0 960 B
master ExecuteAsync net472 2.7μs 3.77ns 14.6ns 0.135 0 0 923 B
#6998 ExecuteAsync net6.0 1.85μs 7.78ns 30.1ns 0 0 0 960 B
#6998 ExecuteAsync netcoreapp3.1 2.39μs 6.52ns 25.3ns 0 0 0 960 B
#6998 ExecuteAsync net472 2.58μs 3.37ns 13.1ns 0.141 0 0 923 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.68μs 3.97ns 15.4ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.79μs 18.5ns 66.9ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 4.82ns 18ns 0.501 0 0 3.19 KB
#6998 SendAsync net6.0 6.78μs 4.19ns 16.2ns 0 0 0 2.37 KB
#6998 SendAsync netcoreapp3.1 8.54μs 29.7ns 115ns 0 0 0 2.9 KB
#6998 SendAsync net472 12μs 7.44ns 28.8ns 0.479 0 0 3.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #6998

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 2.593 1,252,000.00 482,900.00

More allocations ⚠️ in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.1 KB 43.53 KB 424 B 0.98%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.72 KB 289.49 KB 2.77 KB 0.97%

Fewer allocations 🎉 in #6998

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.15 KB 43.54 KB -608 B -1.38%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 272.8 KB 258.81 KB -13.99 KB -5.13%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 323.37 KB 277.92 KB -45.45 KB -14.05%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 42.5μs 203ns 1.06μs 0 0 0 43.1 KB
master StringConcatBenchmark netcoreapp3.1 49.3μs 288ns 2.27μs 0 0 0 44.15 KB
master StringConcatBenchmark net472 57.3μs 148ns 552ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 1.25ms 2.33μs 8.09μs 0 0 0 323.37 KB
master StringConcatAspectBenchmark netcoreapp3.1 470μs 5.4μs 52.4μs 0 0 0 272.8 KB
master StringConcatAspectBenchmark net472 407μs 2.03μs 8.37μs 0 0 0 286.72 KB
#6998 StringConcatBenchmark net6.0 44.1μs 218ns 870ns 0 0 0 43.53 KB
#6998 StringConcatBenchmark netcoreapp3.1 47.1μs 246ns 1.18μs 0 0 0 43.54 KB
#6998 StringConcatBenchmark net472 56.7μs 128ns 444ns 0 0 0 65.54 KB
#6998 StringConcatAspectBenchmark net6.0 485μs 2.14μs 8.54μs 0 0 0 277.92 KB
#6998 StringConcatAspectBenchmark netcoreapp3.1 446μs 6.06μs 60μs 0 0 0 258.81 KB
#6998 StringConcatAspectBenchmark net472 401μs 2.09μs 10.2μs 0 0 0 289.49 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.61μs 13.9ns 70.8ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.39μs 17ns 79.9ns 0 0 0 1.76 KB
master EnrichedLog net472 3.98μs 2.8ns 10.8ns 0.262 0 0 1.69 KB
#6998 EnrichedLog net6.0 2.6μs 12.3ns 50.8ns 0 0 0 1.76 KB
#6998 EnrichedLog netcoreapp3.1 3.45μs 16.9ns 67.6ns 0 0 0 1.76 KB
#6998 EnrichedLog net472 3.91μs 6.59ns 25.5ns 0.254 0 0 1.69 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 120ns 448ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 127μs 229ns 885ns 0 0 0 4.37 KB
master EnrichedLog net472 166μs 74.5ns 258ns 0 0 0 4.57 KB
#6998 EnrichedLog net6.0 123μs 118ns 440ns 0 0 0 4.37 KB
#6998 EnrichedLog netcoreapp3.1 127μs 129ns 466ns 0 0 0 4.37 KB
#6998 EnrichedLog net472 167μs 237ns 919ns 0 0 0 4.57 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.91μs 9.95ns 38.5ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.74μs 22.4ns 86.9ns 0 0 0 2.32 KB
master EnrichedLog net472 7.42μs 5.34ns 20ns 0.335 0 0 2.14 KB
#6998 EnrichedLog net6.0 4.98μs 3.38ns 13.1ns 0 0 0 2.32 KB
#6998 EnrichedLog netcoreapp3.1 6.52μs 25ns 96.6ns 0 0 0 2.32 KB
#6998 EnrichedLog net472 7.36μs 6.79ns 26.3ns 0.331 0 0 2.14 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 7.73ns 29.9ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.52μs 12.1ns 50ns 0 0 0 1.21 KB
master SendReceive net472 3.03μs 2.7ns 10.1ns 0.182 0 0 1.21 KB
#6998 SendReceive net6.0 1.95μs 8.76ns 31.6ns 0 0 0 1.21 KB
#6998 SendReceive netcoreapp3.1 2.56μs 8.69ns 33.6ns 0 0 0 1.21 KB
#6998 SendReceive net472 2.96μs 3.54ns 13.7ns 0.19 0 0 1.21 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.2μs 16.8ns 62.7ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.65μs 15ns 58.2ns 0 0 0 1.69 KB
master EnrichedLog net472 6.63μs 6.7ns 25.9ns 0.33 0 0 2.08 KB
#6998 EnrichedLog net6.0 4.34μs 5.86ns 21.9ns 0 0 0 1.64 KB
#6998 EnrichedLog netcoreapp3.1 5.62μs 22.3ns 86.4ns 0 0 0 1.69 KB
#6998 EnrichedLog net472 6.52μs 6.77ns 24.4ns 0.326 0 0 2.08 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 740ns 3.57ns 13.8ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 946ns 4.71ns 18.3ns 0 0 0 584 B
master StartFinishSpan net472 925ns 0.0692ns 0.25ns 0.0885 0 0 586 B
master StartFinishScope net6.0 899ns 1.41ns 5.46ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.18μs 2.84ns 11ns 0 0 0 704 B
master StartFinishScope net472 1.15μs 0.973ns 3.77ns 0.104 0 0 666 B
#6998 StartFinishSpan net6.0 737ns 4ns 21.5ns 0 0 0 584 B
#6998 StartFinishSpan netcoreapp3.1 936ns 4.64ns 19.7ns 0 0 0 584 B
#6998 StartFinishSpan net472 917ns 0.177ns 0.661ns 0.0916 0 0 586 B
#6998 StartFinishScope net6.0 886ns 4.55ns 21.8ns 0 0 0 704 B
#6998 StartFinishScope netcoreapp3.1 1.11μs 5.88ns 31.1ns 0 0 0 705 B
#6998 StartFinishScope net472 1.07μs 0.0333ns 0.12ns 0.103 0 0 666 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.01μs 4.85ns 20ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.39μs 1.69ns 6.55ns 0 0 0 704 B
master RunOnMethodBegin net472 1.34μs 1.5ns 5.8ns 0.1 0 0 666 B
#6998 RunOnMethodBegin net6.0 1.02μs 5.25ns 25.7ns 0 0 0 705 B
#6998 RunOnMethodBegin netcoreapp3.1 1.45μs 6.82ns 26.4ns 0 0 0 704 B
#6998 RunOnMethodBegin net472 1.34μs 0.621ns 2.41ns 0.101 0 0 666 B

Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Looks good to me thanks!

@andrewlock andrewlock merged commit 4657b42 into master May 23, 2025
129 checks passed
@andrewlock andrewlock deleted the andrew/fix-null-ref-in-manual branch May 23, 2025 16:16
@github-actions github-actions bot added this to the vNext-v3 milestone May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) identified-by:telemetry type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants