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

Use dd-dotnet in dd-trace #4732

Merged
merged 5 commits into from
Oct 24, 2023
Merged

Use dd-dotnet in dd-trace #4732

merged 5 commits into from
Oct 24, 2023

Conversation

kevingosse
Copy link
Collaborator

@kevingosse kevingosse commented Oct 17, 2023

Summary of changes

Remove the diagnostic part of dd-trace and have it rely on dd-dotnet instead.

Reason for change

The diagnostic code is currently duplicated between dd-trace and dd-dotnet, and can't be easily shared (because dd-trace targets all .net core versions back to 2.1, whereas dd-dotnet relies on more recent features for some diagnostics).

Since dd-dotnet is bundled anyway, having dd-trace call it seems like a good middle ground.

Implementation details

  • The AnalyzeInstrumentationErrors command relies on ProcessInfo, so I had to introduce a shared project for this class and its immediate dependencies.

  • When calling dd-dotnet, dd-trace sets the DD_OVERRIDE_COMMAND environment variable to change the name of the executable in the help messages

Test coverage

The coverage should be the same as before. A unit test projects has been added for dd-dotnet.
One caveat is that the ProcessInfo tests were moved to the dd-dotnet test project, which means that they will run only for .NET 7. That's because they depend on ExtractConfigurationSource which was moved to dd-dotnet. In theory it could go to the shared project, but it's fairly complex because of the configuration sources that also exist in the tracer (so we have namespace conflicts).

Other details

Depends on #4725

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Oct 17, 2023

Datadog Report

Branch report: kevin/merge_tools
Commit report: da5cbfb

dd-trace-dotnet: 0 Failed, 0 New Flaky, 304926 Passed, 1135 Skipped, 37m 10.93s Wall Time

@andrewlock
Copy link
Member

andrewlock commented Oct 17, 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 (4732) - mean (71ms)  : 64, 78
     .   : milestone, 71,
    master - mean (69ms)  : 63, 76
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (1,023ms)  : 1001, 1045
     .   : milestone, 1023,
    master - mean (1,013ms)  : 994, 1032
     .   : milestone, 1013,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4732) - mean (106ms)  : 104, 108
     .   : milestone, 106,
    master - mean (107ms)  : 96, 118
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (716ms)  : 700, 732
     .   : milestone, 716,
    master - mean (716ms)  : 695, 737
     .   : milestone, 716,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4732) - mean (91ms)  : 88, 93
     .   : milestone, 91,
    master - mean (90ms)  : 84, 96
     .   : milestone, 90,

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (681ms)  : 669, 693
     .   : milestone, 681,
    master - mean (682ms)  : 653, 711
     .   : milestone, 682,

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

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (1,128ms)  : 1109, 1147
     .   : milestone, 1128,
    master - mean (1,127ms)  : 1109, 1146
     .   : milestone, 1127,

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

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (1,091ms)  : 1060, 1123
     .   : milestone, 1091,
    master - mean (1,090ms)  : 1069, 1110
     .   : milestone, 1090,

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

    section CallTarget+Inlining+NGEN
    This PR (4732) - mean (1,053ms)  : 1028, 1079
     .   : milestone, 1053,
    master - mean (1,055ms)  : 1022, 1087
     .   : milestone, 1055,

Loading

@andrewlock
Copy link
Member

andrewlock commented Oct 17, 2023

Benchmarks Report 🐌

Benchmarks for #4732 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.156
  • 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 8μs 42.9ns 235ns 0.0205 0.00818 0 7.29 KB
master StartStopWithChild netcoreapp3.1 9.89μs 53.2ns 310ns 0.0342 0.0147 0 7.38 KB
master StartStopWithChild net472 15.5μs 46.5ns 180ns 1.26 0.277 0.0846 7.66 KB
#4732 StartStopWithChild net6.0 8.09μs 45.8ns 330ns 0.0323 0.0161 0 7.29 KB
#4732 StartStopWithChild netcoreapp3.1 10.3μs 52.4ns 251ns 0.0341 0.0146 0 7.38 KB
#4732 StartStopWithChild net472 15.5μs 46.8ns 181ns 1.28 0.311 0.101 7.66 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 468μs 248ns 960ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 638μs 506ns 1.96μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 801μs 270ns 1.01μs 0.401 0 0 3.3 KB
#4732 WriteAndFlushEnrichedTraces net6.0 479μs 196ns 759ns 0 0 0 2.7 KB
#4732 WriteAndFlushEnrichedTraces netcoreapp3.1 635μs 150ns 582ns 0 0 0 2.7 KB
#4732 WriteAndFlushEnrichedTraces net472 801μs 293ns 1.09μs 0.401 0 0 3.3 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 44.1μs 64.9ns 251ns 0.0218 0 0 2.03 KB
master AllCycleSimpleBody netcoreapp3.1 45.3μs 53.7ns 208ns 0.0226 0 0 2.01 KB
master AllCycleSimpleBody net472 46.5μs 114ns 443ns 0.322 0 0 2.08 KB
master AllCycleMoreComplexBody net6.0 229μs 65.5ns 227ns 0.115 0 0 8.63 KB
master AllCycleMoreComplexBody netcoreapp3.1 234μs 102ns 383ns 0 0 0 8.52 KB
master AllCycleMoreComplexBody net472 239μs 137ns 531ns 1.31 0 0 8.7 KB
master ObjectExtractorSimpleBody net6.0 126ns 0.107ns 0.399ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 178ns 0.187ns 0.699ns 0.00368 0 0 272 B
master ObjectExtractorSimpleBody net472 144ns 0.151ns 0.585ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.02μs 0.662ns 2.56ns 0.0544 0 0 3.88 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.05μs 2.04ns 7.91ns 0.0526 0 0 3.78 KB
master ObjectExtractorMoreComplexBody net472 4.14μs 3.19ns 12.4ns 0.618 0.00622 0 3.89 KB
#4732 AllCycleSimpleBody net6.0 43.2μs 87.8ns 340ns 0.0218 0 0 2.03 KB
#4732 AllCycleSimpleBody netcoreapp3.1 45.2μs 125ns 485ns 0.0227 0 0 2.01 KB
#4732 AllCycleSimpleBody net472 47.6μs 21.3ns 82.5ns 0.324 0 0 2.08 KB
#4732 AllCycleMoreComplexBody net6.0 228μs 70.4ns 263ns 0.114 0 0 8.63 KB
#4732 AllCycleMoreComplexBody netcoreapp3.1 233μs 148ns 573ns 0 0 0 8.52 KB
#4732 AllCycleMoreComplexBody net472 237μs 84.9ns 329ns 1.3 0 0 8.7 KB
#4732 ObjectExtractorSimpleBody net6.0 122ns 0.0546ns 0.204ns 0.00394 0 0 280 B
#4732 ObjectExtractorSimpleBody netcoreapp3.1 178ns 0.397ns 1.54ns 0.00377 0 0 272 B
#4732 ObjectExtractorSimpleBody net472 150ns 0.223ns 0.862ns 0.0446 0 0 281 B
#4732 ObjectExtractorMoreComplexBody net6.0 3.07μs 1.13ns 4.39ns 0.0538 0 0 3.88 KB
#4732 ObjectExtractorMoreComplexBody netcoreapp3.1 4.12μs 3.23ns 12.5ns 0.0511 0 0 3.78 KB
#4732 ObjectExtractorMoreComplexBody net472 4.12μs 2.75ns 10.7ns 0.618 0.0062 0 3.89 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWaf(args=NestedMap (10)) net6.0 12.7μs 4.28ns 16ns 0.128 0 0 9.42 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 19.7μs 8.5ns 31.8ns 0.118 0 0 9.42 KB
master RunWaf(args=NestedMap (10)) net472 28.3μs 8.66ns 32.4ns 1.5 0 0 9.48 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 77.2μs 16.8ns 62.8ns 0.192 0 0 15.77 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 87.1μs 111ns 432ns 0.173 0 0 15.72 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 98.3μs 42.8ns 166ns 2.5 0.0482 0 16.04 KB
master RunWaf(args=NestedMap (100)) net6.0 24.1μs 10.8ns 40.2ns 0.267 0 0 19.66 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 38μs 13.2ns 51.3ns 0.265 0 0 20.42 KB
master RunWaf(args=NestedMap (100)) net472 55.1μs 13.7ns 51.4ns 3.25 0.0276 0 20.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 90.9μs 51.9ns 201ns 0.364 0 0 26.01 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 109μs 220ns 853ns 0.324 0 0 26.72 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 133μs 48.9ns 183ns 4.31 0.0654 0 27.19 KB
master RunWaf(args=NestedMap (20)) net6.0 23.6μs 9.01ns 34.9ns 0.273 0 0 19.4 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 37.7μs 21.9ns 84.7ns 0.264 0 0 19.84 KB
master RunWaf(args=NestedMap (20)) net472 56.2μs 30.1ns 113ns 3.16 0.056 0 20.04 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 90.5μs 35.5ns 133ns 0.363 0 0 25.74 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 108μs 250ns 936ns 0.323 0 0 26.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 134μs 113ns 424ns 4.18 0.0664 0 26.6 KB
#4732 RunWaf(args=NestedMap (10)) net6.0 12.9μs 3.16ns 11.4ns 0.127 0 0 9.42 KB
#4732 RunWaf(args=NestedMap (10)) netcoreapp3.1 19.4μs 9.29ns 36ns 0.125 0 0 9.42 KB
#4732 RunWaf(args=NestedMap (10)) net472 28.3μs 4.91ns 17.7ns 1.49 0 0 9.48 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 77.5μs 64.5ns 241ns 0.191 0 0 15.77 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 87.1μs 197ns 761ns 0.174 0 0 15.72 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) net472 96.8μs 108ns 420ns 2.55 0 0 16.04 KB
#4732 RunWaf(args=NestedMap (100)) net6.0 24μs 8.83ns 33.1ns 0.276 0 0 19.66 KB
#4732 RunWaf(args=NestedMap (100)) netcoreapp3.1 38.6μs 15.5ns 60.2ns 0.27 0 0 20.42 KB
#4732 RunWaf(args=NestedMap (100)) net472 54.5μs 11ns 42.5ns 3.26 0.0272 0 20.63 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 91.6μs 151ns 585ns 0.32 0 0 26.01 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 109μs 86.2ns 431ns 0.329 0 0 26.72 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [23]) net472 132μs 83.5ns 323ns 4.3 0.0661 0 27.19 KB
#4732 RunWaf(args=NestedMap (20)) net6.0 24μs 7.3ns 28.3ns 0.275 0 0 19.4 KB
#4732 RunWaf(args=NestedMap (20)) netcoreapp3.1 38.4μs 12.3ns 47.7ns 0.268 0 0 19.84 KB
#4732 RunWaf(args=NestedMap (20)) net472 54.5μs 10.7ns 41.4ns 3.18 0.0544 0 20.04 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 90.1μs 44.1ns 153ns 0.321 0 0 25.74 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 107μs 52.8ns 183ns 0.322 0 0 26.14 KB
#4732 RunWafWithAttack(args=Neste(...)tack) [22]) net472 130μs 202ns 781ns 4.18 0.0643 0 26.6 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 168μs 183ns 711ns 0.168 0 0 18.04 KB
master SendRequest netcoreapp3.1 188μs 282ns 1.09μs 0.186 0 0 20.2 KB
master SendRequest net472 0.00126ns 0.000539ns 0.00209ns 0 0 0 0 b
#4732 SendRequest net6.0 166μs 103ns 385ns 0.166 0 0 18.04 KB
#4732 SendRequest netcoreapp3.1 190μs 337ns 1.31μs 0.188 0 0 20.2 KB
#4732 SendRequest net472 0.000405ns 0.000204ns 0.000789ns 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 553μs 1.15μs 4.45μs 0.553 0 0 41.68 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 813ns 3.04μs 0.331 0 0 41.56 KB
master WriteAndFlushEnrichedTraces net472 856μs 3.56μs 13.8μs 8.13 2.57 0.428 53.36 KB
#4732 WriteAndFlushEnrichedTraces net6.0 549μs 687ns 2.57μs 0.556 0 0 41.51 KB
#4732 WriteAndFlushEnrichedTraces netcoreapp3.1 660μs 1.39μs 5.38μs 0.326 0 0 41.74 KB
#4732 WriteAndFlushEnrichedTraces net472 863μs 2.68μs 10μs 8.45 2.53 0.422 53.23 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.03μs 0.979ns 3.79ns 0.0108 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.28μs 0.562ns 2.18ns 0.0101 0 0 768 B
master ExecuteNonQuery net472 1.63μs 0.373ns 1.4ns 0.116 0 0 730 B
#4732 ExecuteNonQuery net6.0 1.09μs 0.629ns 2.44ns 0.0109 0 0 768 B
#4732 ExecuteNonQuery netcoreapp3.1 1.32μs 2.75ns 10.6ns 0.0105 0 0 768 B
#4732 ExecuteNonQuery net472 1.64μs 0.299ns 1.04ns 0.116 0 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.17μs 0.644ns 2.41ns 0.0128 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.41μs 0.567ns 2.2ns 0.0121 0 0 936 B
master CallElasticsearch net472 2.35μs 0.777ns 2.8ns 0.151 0 0 955 B
master CallElasticsearchAsync net6.0 1.23μs 0.785ns 2.94ns 0.0128 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.48μs 2.62ns 10.1ns 0.0133 0 0 984 B
master CallElasticsearchAsync net472 2.55μs 1.09ns 4.08ns 0.16 0 0 1.01 KB
#4732 CallElasticsearch net6.0 1.28μs 0.611ns 2.29ns 0.0129 0 0 936 B
#4732 CallElasticsearch netcoreapp3.1 1.47μs 0.433ns 1.62ns 0.0125 0 0 936 B
#4732 CallElasticsearch net472 2.27μs 0.779ns 2.92ns 0.152 0 0 955 B
#4732 CallElasticsearchAsync net6.0 1.21μs 0.528ns 1.98ns 0.0127 0 0 912 B
#4732 CallElasticsearchAsync netcoreapp3.1 1.44μs 2.39ns 9.27ns 0.0128 0 0 984 B
#4732 CallElasticsearchAsync net472 2.52μs 1.62ns 6.28ns 0.16 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.21μs 1.11ns 4.3ns 0.0127 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.49μs 0.664ns 2.49ns 0.012 0 0 912 B
master ExecuteAsync net472 1.62μs 0.526ns 2.04ns 0.138 0 0 875 B
#4732 ExecuteAsync net6.0 1.3μs 1.09ns 4.23ns 0.0126 0 0 912 B
#4732 ExecuteAsync netcoreapp3.1 1.44μs 0.626ns 2.43ns 0.0123 0 0 912 B
#4732 ExecuteAsync net472 1.69μs 1.13ns 4.38ns 0.138 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.73μs 1.25ns 4.84ns 0.0261 0 0 1.9 KB
master SendAsync netcoreapp3.1 4.42μs 1.31ns 4.91ns 0.0332 0 0 2.43 KB
master SendAsync net472 7.17μs 2.21ns 8.57ns 0.474 0 0 2.99 KB
#4732 SendAsync net6.0 3.91μs 1.13ns 4.4ns 0.0254 0 0 1.9 KB
#4732 SendAsync netcoreapp3.1 4.48μs 2.98ns 10.7ns 0.0337 0 0 2.43 KB
#4732 SendAsync net472 7.09μs 2.3ns 8.92ns 0.475 0 0 2.99 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.35μs 0.449ns 1.68ns 0.0217 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 1.95μs 1.88ns 7.03ns 0.0214 0 0 1.57 KB
master EnrichedLog net472 2.29μs 1.39ns 5.21ns 0.236 0 0 1.49 KB
#4732 EnrichedLog net6.0 1.38μs 0.428ns 1.6ns 0.0222 0 0 1.57 KB
#4732 EnrichedLog netcoreapp3.1 1.79μs 0.777ns 2.91ns 0.0206 0 0 1.57 KB
#4732 EnrichedLog net472 2.35μs 0.898ns 3.36ns 0.237 0 0 1.49 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 113μs 66.5ns 257ns 0.0566 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 119μs 199ns 769ns 0 0 0 4.21 KB
master EnrichedLog net472 147μs 86.7ns 336ns 0.658 0.219 0 4.38 KB
#4732 EnrichedLog net6.0 114μs 139ns 540ns 0.0572 0 0 4.21 KB
#4732 EnrichedLog netcoreapp3.1 117μs 90.8ns 352ns 0.0587 0 0 4.21 KB
#4732 EnrichedLog net472 146μs 65.1ns 243ns 0.656 0.219 0 4.38 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.8μs 0.833ns 3.12ns 0.0293 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 3.87μs 0.989ns 3.7ns 0.029 0 0 2.13 KB
master EnrichedLog net472 4.43μs 1.13ns 4.37ns 0.307 0 0 1.93 KB
#4732 EnrichedLog net6.0 2.84μs 0.937ns 3.51ns 0.0298 0 0 2.13 KB
#4732 EnrichedLog netcoreapp3.1 3.63μs 1.19ns 4.61ns 0.0292 0 0 2.13 KB
#4732 EnrichedLog net472 4.66μs 1.78ns 6.91ns 0.306 0 0 1.93 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.28μs 0.428ns 1.6ns 0.0153 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.65μs 1.38ns 5.33ns 0.0148 0 0 1.1 KB
master SendReceive net472 1.89μs 2.69ns 10.4ns 0.177 0 0 1.12 KB
#4732 SendReceive net6.0 1.32μs 1.11ns 4.16ns 0.0152 0 0 1.1 KB
#4732 SendReceive netcoreapp3.1 1.65μs 3.49ns 13.5ns 0.0147 0 0 1.1 KB
#4732 SendReceive net472 1.95μs 2.53ns 9.8ns 0.177 0.000968 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.66μs 0.615ns 2.38ns 0.0213 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.65μs 0.768ns 2.87ns 0.02 0 0 1.58 KB
master EnrichedLog net472 3.99μs 2.56ns 9.93ns 0.309 0 0 1.96 KB
#4732 EnrichedLog net6.0 2.64μs 0.597ns 2.23ns 0.0213 0 0 1.53 KB
#4732 EnrichedLog netcoreapp3.1 3.51μs 1.41ns 5.45ns 0.0208 0 0 1.58 KB
#4732 EnrichedLog net472 3.92μs 1.88ns 7.27ns 0.31 0 0 1.96 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4732

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.156 471.05 407.62

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 471ns 0.189ns 0.732ns 0.00755 0 0 536 B
master StartFinishSpan netcoreapp3.1 580ns 0.271ns 1.05ns 0.00728 0 0 536 B
master StartFinishSpan net472 684ns 0.117ns 0.451ns 0.0854 0 0 538 B
master StartFinishScope net6.0 535ns 0.154ns 0.577ns 0.00903 0 0 656 B
master StartFinishScope netcoreapp3.1 754ns 0.158ns 0.59ns 0.00866 0 0 656 B
master StartFinishScope net472 881ns 0.359ns 1.34ns 0.098 0 0 618 B
#4732 StartFinishSpan net6.0 407ns 0.479ns 1.86ns 0.00747 0 0 536 B
#4732 StartFinishSpan netcoreapp3.1 524ns 1.97ns 7.65ns 0.00727 0 0 536 B
#4732 StartFinishSpan net472 688ns 0.103ns 0.399ns 0.0852 0 0 538 B
#4732 StartFinishScope net6.0 567ns 0.143ns 0.555ns 0.00913 0 0 656 B
#4732 StartFinishScope netcoreapp3.1 736ns 0.22ns 0.853ns 0.00892 0 0 656 B
#4732 StartFinishScope net472 857ns 1.19ns 4.6ns 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 586ns 0.177ns 0.686ns 0.00908 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 812ns 2.49ns 9.66ns 0.00872 0 0 656 B
master RunOnMethodBegin net472 917ns 0.284ns 1.1ns 0.098 0 0 618 B
#4732 RunOnMethodBegin net6.0 579ns 0.194ns 0.753ns 0.00927 0 0 656 B
#4732 RunOnMethodBegin netcoreapp3.1 798ns 0.189ns 0.731ns 0.00889 0 0 656 B
#4732 RunOnMethodBegin net472 1.02μs 0.347ns 1.34ns 0.098 0 0 618 B

@kevingosse kevingosse changed the title Kevin/merge tools Use dd-dotnet in dd-trace Oct 18, 2023
@kevingosse kevingosse marked this pull request as ready for review October 18, 2023 12:36
@kevingosse kevingosse requested review from a team as code owners October 18, 2023 12:36
@kevingosse kevingosse added the status:work-in-progress Actively worked on. If this is a PR, no review needed yet. WIP. label Oct 18, 2023
@kevingosse kevingosse changed the title Use dd-dotnet in dd-trace [WIP] Use dd-dotnet in dd-trace Oct 18, 2023
@kevingosse kevingosse removed the status:work-in-progress Actively worked on. If this is a PR, no review needed yet. WIP. label Oct 19, 2023
@kevingosse kevingosse changed the title [WIP] Use dd-dotnet in dd-trace Use dd-dotnet in dd-trace Oct 19, 2023
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.

LGTM with a couple of comments

Comment on lines +549 to +550
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.Tools.Shared", "tracer\src\Datadog.Trace.Tools.Shared\Datadog.Trace.Tools.Shared.csproj", "{7A1B9BFE-052D-435E-B27F-72AF3DDCC0A0}"
EndProject
Copy link
Member

@andrewlock andrewlock Oct 19, 2023

Choose a reason for hiding this comment

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

Don't know if it's any easier to use a shared project rather than a normal project here? You wouldn't need to specify target frameworks, no need for "internals visible to", changing visibility etc🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dunno. If I did that right away then maybe, but now I don't really see a significant benefit to changing it.

{
internal static class NativeMethods
public static class NativeMethods
Copy link
Member

Choose a reason for hiding this comment

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

You wouldn't need to change these if you used a shared library instead of a normal project 😉

{
baseDirectory ??= Path.GetDirectoryName(process.MainModule);

var configurationSource = new CompositeConfigurationSource();
Copy link
Member

Choose a reason for hiding this comment

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

Don't you want to be using CompositeConfigurationSourceInternal here? 🤔 Because this is a public API, and will try to record telemetry for it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's the dd-dotnet CompositeConfigurationSource, not the tracer one. It has no telemetry. I can rename it if it's too confusing, but I don't have great ideas for the new name.

Copy link
Member

Choose a reason for hiding this comment

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

I believe we're deleting these because we already have equivalent tests for dd-dotnet, but is there any value in making sure that these tests do still run correctly when going via dd-dotnet or is that more hassle to implement than it's worth?

From my Pov, I'd have more confidence of "we haven't broken something" if we didn't also delete all the tests for that functionality at the same time 😛 🙈

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

dd-trace cannot invoke dd-dotnet in the integration tests (only in the artifact tests).

I could duplicate the dd-dotnet artifact tests to run with dd-trace, but I'm not sure it's worth the hassle 🤔

Copy link
Contributor

@link04 link04 left a comment

Choose a reason for hiding this comment

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

Aside from the couple of questions I added, after running the tool locally the output matches the master output so that's good for me. Thank you!

@kevingosse kevingosse merged commit d5e0ea1 into master Oct 24, 2023
@kevingosse kevingosse deleted the kevin/merge_tools branch October 24, 2023 15:44
@github-actions github-actions bot added this to the vNext milestone Oct 24, 2023
@andrewlock andrewlock added type:enhancement Improvement to an existing feature area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:tools labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tools area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants