DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
456 stars 142 forks source link

Add ability to disable additional ADO.NET Command Types (#6042 => v2) #6054

Closed bouwkast closed 4 weeks ago

bouwkast commented 2 months ago

Summary of changes

Allows users to configure additional ADO.NET DbCommands to be disabled so they won't have a Span created from them.

Reason for change

Since we can instrument any DbCommand in ADO.NET this can lead to unwanted/duplicate Spans that customers have little control over. This allows for a comma-separated list of command type names that the .NET Tracer will not create a Span for if they encounter it.

Implementation details

Adds new Environment Variable DD_TRACE_DISABLED_ADONET_COMMAND_TYPES that accepts a comma-separated string of ADO.NET Command Type names that the Tracer will not create a Span for.

For example (some pseudo-code here):

Assuming we have a custom DbCommand FooDbCommand that we don't want Spans for ->

public class FooDbCommand : DbCommand
{
    ... class contents here
}

We'd need to set DD_TRACE_DISABLED_ADONET_COMMAND_TYPES to ->

DD_TRACE_DISABLED_ADONET_COMMAND_TYPES="FooDbCommand"

Test coverage

Other details

Merge the dd-go PR when this PR is merged: https://github.com/DataDog/dd-go/pull/150493

Backport of https://github.com/DataDog/dd-trace-dotnet/pull/6042

bouwkast commented 2 months ago

I've git cherry-picked my commits to this branch as I think we want a V2 of this instead of a V3 (ultimately both - maybe)

andrewlock commented 2 months ago

Execution-Time Benchmarks Report :stopwatch:

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

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

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

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

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (73ms)  : 66, 81
     .   : milestone, 73,
    master - mean (70ms)  : 67, 72
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (1,020ms)  : 1007, 1032
     .   : milestone, 1020,
    master - mean (1,110ms)  : 1085, 1135
     .   : milestone, 1110,
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (109ms)  : 106, 112
     .   : milestone, 109,
    master - mean (109ms)  : 105, 112
     .   : milestone, 109,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (701ms)  : 684, 718
     .   : milestone, 701,
    master - mean (771ms)  : 757, 786
     .   : milestone, 771,
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (93ms)  : 89, 96
     .   : milestone, 93,
    master - mean (92ms)  : 89, 95
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (666ms)  : 646, 687
     .   : milestone, 666,
    master - mean (727ms)  : 710, 744
     .   : milestone, 727,
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (190ms)  : 186, 193
     .   : milestone, 190,
    master - mean (189ms)  : 186, 192
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (1,110ms)  : 1092, 1128
     .   : milestone, 1110,
    master - mean (1,201ms)  : 1179, 1222
     .   : milestone, 1201,
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (276ms)  : 272, 281
     .   : milestone, 276,
    master - mean (274ms)  : 269, 278
     .   : milestone, 274,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (874ms)  : 853, 896
     .   : milestone, 874,
    master - mean (943ms)  : 926, 960
     .   : milestone, 943,
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6054) - mean (264ms)  : 260, 269
     .   : milestone, 264,
    master - mean (263ms)  : 259, 267
     .   : milestone, 263,

    section CallTarget+Inlining+NGEN
    This PR (6054) - mean (863ms)  : 845, 880
     .   : milestone, 863,
    master - mean (924ms)  : 908, 940
     .   : milestone, 924,
datadog-ddstaging[bot] commented 2 months ago

Datadog Report

Branch report: steven/29781-v2 Commit report: 5c41021 Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 351187 Passed, 1802 Skipped, 14h 31m 39.07s Total Time

andrewlock commented 2 months ago

Benchmarks Report for tracer :snail:

Benchmarks for #6054 compared to master:

The following thresholds were used for comparing the benchmark speeds:

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartStopWithChild`|net6.0|7.77μs|44.4ns|327ns|0.0155| 0.00774|0|5.43 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartStopWithChild`|netcoreapp3.1|10.1μs|50.2ns|230ns|0.0209| 0.0105|0|5.62 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartStopWithChild`|net472|17μs|46.1ns|179ns|1.01| 0.298|0.0828|6.06 KB| |#6054|`StartStopWithChild`|net6.0|7.79μs|40.1ns|184ns|0.0125| 0.00415|0|5.43 KB| |#6054|`StartStopWithChild`|netcoreapp3.1|9.91μs|54.6ns|345ns|0.0151| 0.00504|0|5.61 KB| |#6054|`StartStopWithChild`|net472|16.7μs|71.9ns|269ns|1.04| 0.335|0.0969|6.07 KB|
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|net6.0|474μs|114ns|395ns|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|635μs|560ns|2.1μs|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|net472|867μs|535ns|2.07μs|0.434| 0|0|3.3 KB| |#6054|`WriteAndFlushEnrichedTraces`|net6.0|485μs|348ns|1.35μs|0| 0|0|2.7 KB| |#6054|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|641μs|684ns|2.65μs|0| 0|0|2.7 KB| |#6054|`WriteAndFlushEnrichedTraces`|net472|848μs|594ns|2.3μs|0.422| 0|0|3.3 KB|
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendRequest`|net6.0|225μs|1.26μs|8.29μs|0.209| 0|0|18.45 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendRequest`|netcoreapp3.1|226μs|1.29μs|9.84μs|0.216| 0|0|20.61 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendRequest`|net472|0.00205ns|0.00102ns|0.00381ns|0| 0|0|0 b| |#6054|`SendRequest`|net6.0|209μs|1.12μs|6.15μs|0.206| 0|0|18.45 KB| |#6054|`SendRequest`|netcoreapp3.1|234μs|1.35μs|10.7μs|0.271| 0|0|20.61 KB| |#6054|`SendRequest`|net472|0.0112ns|0.00315ns|0.0122ns|0| 0|0|0 b|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|net6.0|572μs|2.95μs|13.5μs|0.282| 0|0|41.63 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|744μs|4.35μs|41.9μs|0.332| 0|0|41.79 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`WriteAndFlushEnrichedTraces`|net472|855μs|2.38μs|8.58μs|8.42| 2.66|0.443|53.35 KB| |#6054|`WriteAndFlushEnrichedTraces`|net6.0|599μs|3.43μs|25.7μs|0.303| 0|0|41.67 KB| |#6054|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|680μs|2.36μs|8.83μs|0.338| 0|0|41.66 KB| |#6054|`WriteAndFlushEnrichedTraces`|net472|848μs|2.84μs|10.6μs|8.33| 2.5|0.417|53.32 KB|
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteNonQuery`|net6.0|1.29μs|0.853ns|3.3ns|0.0142| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteNonQuery`|netcoreapp3.1|1.82μs|1.7ns|6.58ns|0.0136| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteNonQuery`|net472|2.1μs|1.48ns|5.34ns|0.156| 0|0|987 B| |#6054|`ExecuteNonQuery`|net6.0|1.37μs|1.96ns|7.61ns|0.0145| 0|0|1.02 KB| |#6054|`ExecuteNonQuery`|netcoreapp3.1|1.75μs|1.65ns|6.4ns|0.0131| 0|0|1.02 KB| |#6054|`ExecuteNonQuery`|net472|2.02μs|1.86ns|7.21ns|0.156| 0|0|987 B|
Benchmarks.Trace.ElasticsearchBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearch`|net6.0|1.21μs|0.6ns|2.24ns|0.0139| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearch`|netcoreapp3.1|1.6μs|4.95ns|19.2ns|0.0132| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearch`|net472|2.41μs|1.27ns|4.41ns|0.158| 0|0|995 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearchAsync`|net6.0|1.25μs|0.526ns|1.97ns|0.0131| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearchAsync`|netcoreapp3.1|1.63μs|0.99ns|3.83ns|0.0139| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`CallElasticsearchAsync`|net472|2.59μs|1.19ns|4.47ns|0.166| 0|0|1.05 KB| |#6054|`CallElasticsearch`|net6.0|1.21μs|0.904ns|3.5ns|0.0133| 0|0|976 B| |#6054|`CallElasticsearch`|netcoreapp3.1|1.53μs|0.752ns|2.81ns|0.0129| 0|0|976 B| |#6054|`CallElasticsearch`|net472|2.42μs|0.836ns|3.01ns|0.158| 0|0|995 B| |#6054|`CallElasticsearchAsync`|net6.0|1.25μs|0.838ns|3.25ns|0.0132| 0|0|952 B| |#6054|`CallElasticsearchAsync`|netcoreapp3.1|1.57μs|0.645ns|2.41ns|0.0136| 0|0|1.02 KB| |#6054|`CallElasticsearchAsync`|net472|2.57μs|1.95ns|7.56ns|0.167| 0|0|1.05 KB|
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteAsync`|net6.0|1.34μs|0.788ns|2.95ns|0.0134| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteAsync`|netcoreapp3.1|1.66μs|0.345ns|1.24ns|0.0124| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`ExecuteAsync`|net472|1.76μs|0.564ns|2.11ns|0.145| 0|0|915 B| |#6054|`ExecuteAsync`|net6.0|1.21μs|0.58ns|2.17ns|0.0134| 0|0|952 B| |#6054|`ExecuteAsync`|netcoreapp3.1|1.6μs|2.44ns|9.14ns|0.0127| 0|0|952 B| |#6054|`ExecuteAsync`|net472|1.76μs|0.62ns|2.4ns|0.145| 0|0|915 B|
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendAsync`|net6.0|4.2μs|2.3ns|8.6ns|0.0295| 0|0|2.22 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendAsync`|netcoreapp3.1|5.01μs|3.35ns|13ns|0.0375| 0|0|2.76 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendAsync`|net472|7.66μs|0.961ns|3.47ns|0.498| 0|0|3.15 KB| |#6054|`SendAsync`|net6.0|4.24μs|1.44ns|5.56ns|0.0297| 0|0|2.22 KB| |#6054|`SendAsync`|netcoreapp3.1|5.1μs|1.77ns|6.63ns|0.0361| 0|0|2.76 KB| |#6054|`SendAsync`|net472|7.84μs|2.34ns|9.08ns|0.498| 0|0|3.15 KB|
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net6.0|1.52μs|0.766ns|2.87ns|0.0228| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|netcoreapp3.1|2.14μs|1.03ns|3.87ns|0.0225| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net472|2.61μs|0.729ns|2.82ns|0.249| 0|0|1.57 KB| |#6054|`EnrichedLog`|net6.0|1.55μs|0.811ns|3.14ns|0.0232| 0|0|1.64 KB| |#6054|`EnrichedLog`|netcoreapp3.1|2.18μs|0.858ns|2.97ns|0.0228| 0|0|1.64 KB| |#6054|`EnrichedLog`|net472|2.57μs|0.781ns|2.92ns|0.249| 0|0|1.57 KB|
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net6.0|116μs|125ns|469ns|0.0584| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|netcoreapp3.1|121μs|194ns|701ns|0.0603| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net472|153μs|117ns|454ns|0.685| 0.228|0|4.46 KB| |#6054|`EnrichedLog`|net6.0|116μs|205ns|794ns|0.0581| 0|0|4.28 KB| |#6054|`EnrichedLog`|netcoreapp3.1|121μs|130ns|503ns|0| 0|0|4.28 KB| |#6054|`EnrichedLog`|net472|152μs|142ns|549ns|0.679| 0.226|0|4.46 KB|
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net6.0|2.96μs|0.872ns|3.26ns|0.031| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|netcoreapp3.1|4.1μs|1.26ns|4.88ns|0.0288| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net472|4.96μs|1.14ns|4.41ns|0.321| 0|0|2.02 KB| |#6054|`EnrichedLog`|net6.0|2.91μs|1.49ns|5.78ns|0.0306| 0|0|2.2 KB| |#6054|`EnrichedLog`|netcoreapp3.1|4.2μs|2.22ns|8.3ns|0.0293| 0|0|2.2 KB| |#6054|`EnrichedLog`|net472|4.82μs|1.74ns|6.72ns|0.319| 0|0|2.02 KB|
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendReceive`|net6.0|1.43μs|0.82ns|3.18ns|0.0164| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendReceive`|netcoreapp3.1|1.76μs|0.655ns|2.54ns|0.0154| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`SendReceive`|net472|2.11μs|0.84ns|3.25ns|0.184| 0.00105|0|1.16 KB| |#6054|`SendReceive`|net6.0|1.4μs|0.55ns|2.13ns|0.0162| 0|0|1.14 KB| |#6054|`SendReceive`|netcoreapp3.1|1.79μs|0.676ns|2.53ns|0.0153| 0|0|1.14 KB| |#6054|`SendReceive`|net472|2.15μs|1.14ns|4.25ns|0.183| 0|0|1.16 KB|
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net6.0|2.8μs|2.58ns|9.65ns|0.0222| 0|0|1.6 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|netcoreapp3.1|3.96μs|1.04ns|3.9ns|0.0218| 0|0|1.65 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`EnrichedLog`|net472|4.43μs|2.15ns|8.32ns|0.322| 0|0|2.04 KB| |#6054|`EnrichedLog`|net6.0|2.74μs|0.905ns|3.5ns|0.0219| 0|0|1.6 KB| |#6054|`EnrichedLog`|netcoreapp3.1|3.9μs|1.15ns|4.46ns|0.0215| 0|0|1.65 KB| |#6054|`EnrichedLog`|net472|4.37μs|1.78ns|6.91ns|0.323| 0|0|2.04 KB|
Benchmarks.Trace.SpanBenchmark - Faster :tada: Same allocations :heavy_check_mark: #### Faster :tada: in #6054 | Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 1.153 | 655.37 | 568.53 | | Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 1.142 | 757.56 | 663.50 | ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishSpan`|net6.0|404ns|0.213ns|0.824ns|0.0081| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishSpan`|netcoreapp3.1|655ns|0.38ns|1.47ns|0.00786| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishSpan`|net472|701ns|0.453ns|1.7ns|0.0917| 0|0|578 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishScope`|net6.0|485ns|0.239ns|0.924ns|0.00976| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishScope`|netcoreapp3.1|758ns|0.391ns|1.46ns|0.00957| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`StartFinishScope`|net472|873ns|0.405ns|1.57ns|0.104| 0|0|658 B| |#6054|`StartFinishSpan`|net6.0|412ns|0.25ns|0.968ns|0.00819| 0|0|576 B| |#6054|`StartFinishSpan`|netcoreapp3.1|570ns|0.665ns|2.49ns|0.00793| 0|0|576 B| |#6054|`StartFinishSpan`|net472|721ns|0.868ns|3.36ns|0.0916| 0|0|578 B| |#6054|`StartFinishScope`|net6.0|489ns|0.327ns|1.26ns|0.00982| 0|0|696 B| |#6054|`StartFinishScope`|netcoreapp3.1|663ns|0.223ns|0.805ns|0.00932| 0|0|696 B| |#6054|`StartFinishScope`|net472|799ns|0.682ns|2.46ns|0.104| 0|0|658 B|
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark: ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`RunOnMethodBegin`|net6.0|671ns|0.323ns|1.25ns|0.00977| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`RunOnMethodBegin`|netcoreapp3.1|974ns|1.03ns|3.84ns|0.0092| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/c8399df44468f83c22a978418e0cfc314f9c3542)|`RunOnMethodBegin`|net472|1.16μs|0.465ns|1.8ns|0.104| 0|0|658 B| |#6054|`RunOnMethodBegin`|net6.0|654ns|0.218ns|0.815ns|0.00948| 0|0|696 B| |#6054|`RunOnMethodBegin`|netcoreapp3.1|952ns|0.396ns|1.48ns|0.00951| 0|0|696 B| |#6054|`RunOnMethodBegin`|net472|1.13μs|0.332ns|1.28ns|0.104| 0|0|658 B|
andrewlock commented 2 months ago

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 (6054) (11.175M)   : 0, 11174724
    master (11.252M)   : 0, 11251784
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6054) (7.459M)   : 0, 7458834
    master (7.466M)   : 0, 7465753
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.766M)   : 0, 7765791

    section Manual
    This PR (6054) (9.510M)   : crit ,0, 9509755
    master (11.114M)   : 0, 11114354

    section Manual + Automatic
    This PR (6054) (7.000M)   : 0, 6999803
    master (6.846M)   : 0, 6845872
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6054) (9.571M)   : 0, 9571285
    master (9.539M)   : 0, 9539093
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6054) (6.533M)   : 0, 6532948
    master (6.648M)   : 0, 6647799

    section Trace stats
    master (6.855M)   : 0, 6855301

    section Manual
    This PR (6054) (8.329M)   : crit ,0, 8328966
    master (9.525M)   : 0, 9525425

    section Manual + Automatic
    This PR (6054) (6.133M)   : 0, 6132994
    master (6.161M)   : 0, 6160600
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6054) (10.204M)   : 0, 10203810
    master (10.064M)   : 0, 10064242
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6054) (6.674M)   : 0, 6673510
    master (6.841M)   : 0, 6841333
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.427M)   : 0, 7426854

    section Manual
    This PR (6054) (8.632M)   : crit ,0, 8631843
    master (10.084M)   : 0, 10084210

    section Manual + Automatic
    This PR (6054) (6.385M)   : 0, 6385274
    master (6.348M)   : 0, 6347556
bouwkast commented 2 months ago

Adding do-not-merge as we are testing this out.