Add ability to disable additional ADO.NET Command Types (#6042 => v2)#6054
Conversation
|
I've |
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:
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 ReportBranch report: ✅ 0 Failed, 351187 Passed, 1802 Skipped, 14h 31m 39.07s Total Time |
Benchmarks Report for tracer 🐌Benchmarks for #6054 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
|
| 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 | StartFinishSpan |
net6.0 | 404ns | 0.213ns | 0.824ns | 0.0081 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 655ns | 0.38ns | 1.47ns | 0.00786 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 701ns | 0.453ns | 1.7ns | 0.0917 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 485ns | 0.239ns | 0.924ns | 0.00976 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 758ns | 0.391ns | 1.46ns | 0.00957 | 0 | 0 | 696 B |
| master | 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 ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 671ns | 0.323ns | 1.25ns | 0.00977 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 974ns | 1.03ns | 3.84ns | 0.0092 | 0 | 0 | 696 B |
| master | 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 |
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
|
|
Adding |
Co-authored-by: Lucas Pimentel <[email protected]>
This reverts commit d34f2d0.
language:dotnet was only added to all spans starting in V3.
c4c7eae to
fdbb771
Compare
## Summary of changes
Allows users to configure _additionally_ `ADO.NET` `DbCommand`s to be
disabled so they won't have a Span created from them.
## Reason for change
Since we instrument basically _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 ->
```csharp
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
- Extended current `DbScopeFactoryTests` to add new value.
- Extended `FakeCommandTests` to include disabling of `FakeCommand`
- Snapshotted those tests as well.
## Other details
Merge the dd-go PR when this PR is merged:
DataDog/dd-go#150493
Backported to 2.x in
#6054
<!-- Fixes #{issue} -->
<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
---------
Co-authored-by: Lucas Pimentel <[email protected]>
Summary of changes
Allows users to configure additional
ADO.NETDbCommands to be disabled so they won't have a Span created from them.Reason for change
Since we can instrument any
DbCommandinADO.NETthis 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_TYPESthat accepts a comma-separatedstringofADO.NETCommand Type names that the Tracer will not create a Span for.For example (some pseudo-code here):
Assuming we have a custom
DbCommandFooDbCommandthat we don't want Spans for ->We'd need to set
DD_TRACE_DISABLED_ADONET_COMMAND_TYPESto ->Test coverage
DbScopeFactoryTeststo add new value.FakeCommandTeststo include disabling ofFakeCommandOther details
Merge the dd-go PR when this PR is merged: https://github.com/DataDog/dd-go/pull/150493
Backport of #6042