-
Notifications
You must be signed in to change notification settings - Fork 137
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 ability to disable additional ADO.NET
Command Types
#6042
base: master
Are you sure you want to change the base?
Conversation
/// <para>"InterceptableDbCommand" and "ProfiledDbCommand" are always disabled by default.</para> | ||
/// </summary> | ||
/// <seealso cref="TracerSettings.DisabledAdoNetCommandTypes"/> | ||
public const string DisabledAdoNetCommandTypes = "DD_TRACE_DISABLED_ADONET_COMMAND_TYPES"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must add this to the config remapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add it manually here in the repo and make a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the file manually with: "DD_TRACE_DISABLED_ADONET_COMMAND_TYPES": "trace_disabled_adonet_command_types",
/// <para>"InterceptableDbCommand" and "ProfiledDbCommand" are always disabled by default.</para> | ||
/// </summary> | ||
/// <seealso cref="TracerSettings.DisabledAdoNetCommandTypes"/> | ||
public const string DisabledAdoNetCommandTypes = "DD_TRACE_DISABLED_ADONET_COMMAND_TYPES"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Level of care low, but what do you think of using IGNORED
instead of DISABLED
? As in DD_TRACE_IGNORED_ADONET_COMMAND_TYPES
. Just throwing it out there, feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was between IGNORED
or DISABLED
and opted for DISABLED
actually because the Activity
stuff (totally irrelevant here though).
As I also have this PR: #5795 which adds DD_TRACE_DISABLED_ACTIVITY_SOURCES
and for Activity
we already have a concept of Ignored
with the IgnoreActivityHandler
:
dd-trace-dotnet/tracer/src/Datadog.Trace/Activity/Handlers/IgnoreActivityHandler.cs
Line 16 in 3847923
internal class IgnoreActivityHandler : IActivityHandler |
Maybe I'm overthinking it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, it's nice to be consistent then with DISABLED
in both. Thanks!
Datadog ReportBranch report: ✅ 0 Failed, 363464 Passed, 2069 Skipped, 15h 12m 20.21s Total Time |
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 (6042) - mean (69ms) : 66, 72
. : milestone, 69,
master - mean (70ms) : 67, 73
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (1,105ms) : 1081, 1129
. : milestone, 1105,
master - mean (1,106ms) : 1075, 1137
. : milestone, 1106,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6042) - mean (108ms) : 106, 111
. : milestone, 108,
master - mean (109ms) : 105, 113
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (802ms) : 778, 826
. : milestone, 802,
master - mean (801ms) : 783, 820
. : milestone, 801,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6042) - mean (92ms) : 89, 95
. : milestone, 92,
master - mean (92ms) : 89, 95
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (750ms) : 724, 776
. : milestone, 750,
master - mean (746ms) : 724, 768
. : milestone, 746,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6042) - mean (191ms) : 187, 195
. : milestone, 191,
master - mean (191ms) : 187, 194
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (1,194ms) : 1167, 1221
. : milestone, 1194,
master - mean (1,192ms) : 1167, 1217
. : milestone, 1192,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6042) - mean (276ms) : 273, 279
. : milestone, 276,
master - mean (278ms) : 274, 282
. : milestone, 278,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (962ms) : 939, 986
. : milestone, 962,
master - mean (963ms) : 942, 984
. : milestone, 963,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6042) - mean (265ms) : 262, 269
. : milestone, 265,
master - mean (266ms) : 262, 270
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (6042) - mean (942ms) : 917, 967
. : milestone, 942,
master - mean (944ms) : 916, 972
. : milestone, 944,
|
@@ -198,6 +198,31 @@ _ when commandTypeName.EndsWith(commandSuffix) => | |||
} | |||
} | |||
|
|||
internal static bool IsDisabledCommandType(string commandTypeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead pass the Tracer
object through the method parameters so this method doesn't rely on the static Tracer.Instance
? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
Needed to propagate the parameter up a bit as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has proven to be a bit of a headache as I have ultimately needed to pass Tracer.Instance
to the static Cache
class
Without doing more refactoring I may just revert this and depend on the static Tracer.Instance
for now and come back later to refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @zacharycmontoya I've reverted this, I'll look at it later (follow up PR) if that sounds okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Throughput/Crank Report ⚡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 (6042) (11.157M) : 0, 11156820
master (11.241M) : 0, 11241347
benchmarks/2.9.0 (11.081M) : 0, 11080577
section Automatic
This PR (6042) (7.472M) : 0, 7471799
master (7.436M) : 0, 7436259
benchmarks/2.9.0 (7.732M) : 0, 7732233
section Trace stats
master (7.624M) : 0, 7623650
section Manual
master (11.144M) : 0, 11143937
section Manual + Automatic
This PR (6042) (7.039M) : 0, 7039138
master (6.769M) : 0, 6769336
section DD_TRACE_ENABLED=0
master (10.231M) : 0, 10230944
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6042) (9.508M) : 0, 9508377
master (9.526M) : 0, 9525943
benchmarks/2.9.0 (9.798M) : 0, 9798067
section Automatic
This PR (6042) (6.555M) : 0, 6554686
master (6.610M) : 0, 6610089
section Trace stats
master (6.947M) : 0, 6947051
section Manual
master (9.627M) : 0, 9627325
section Manual + Automatic
This PR (6042) (6.191M) : 0, 6191451
master (6.082M) : 0, 6081694
section DD_TRACE_ENABLED=0
master (8.789M) : 0, 8789404
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6042) (10.028M) : 0, 10028357
master (10.078M) : 0, 10077851
benchmarks/2.9.0 (10.067M) : 0, 10067315
section Automatic
This PR (6042) (6.556M) : 0, 6556498
master (6.777M) : 0, 6777224
benchmarks/2.9.0 (7.552M) : 0, 7552193
section Trace stats
master (7.294M) : 0, 7293536
section Manual
master (9.738M) : 0, 9737534
section Manual + Automatic
This PR (6042) (6.070M) : 0, 6069654
master (6.208M) : 0, 6208249
section DD_TRACE_ENABLED=0
master (9.212M) : 0, 9211944
|
Benchmarks Report for tracer 🐌Benchmarks for #6042 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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.133 | 482.01 | 546.17 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 399ns | 0.129ns | 0.499ns | 0.00816 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 568ns | 3.15ns | 20.2ns | 0.0078 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 670ns | 2.34ns | 8.77ns | 0.0915 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 482ns | 0.23ns | 0.861ns | 0.0097 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 722ns | 0.692ns | 2.68ns | 0.00944 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 845ns | 0.592ns | 2.29ns | 0.105 | 0 | 0 | 658 B |
#6042 | StartFinishSpan |
net6.0 | 402ns | 0.186ns | 0.721ns | 0.00807 | 0 | 0 | 576 B |
#6042 | StartFinishSpan |
netcoreapp3.1 | 615ns | 3.3ns | 16.8ns | 0.00768 | 0 | 0 | 576 B |
#6042 | StartFinishSpan |
net472 | 666ns | 0.264ns | 1.02ns | 0.0916 | 0 | 0 | 578 B |
#6042 | StartFinishScope |
net6.0 | 546ns | 0.147ns | 0.568ns | 0.00985 | 0 | 0 | 696 B |
#6042 | StartFinishScope |
netcoreapp3.1 | 759ns | 0.645ns | 2.5ns | 0.00952 | 0 | 0 | 696 B |
#6042 | StartFinishScope |
net472 | 891ns | 2.1ns | 8.15ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6042
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.184
681.97
575.89
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.184 | 681.97 | 575.89 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 682ns | 0.353ns | 1.37ns | 0.00982 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 964ns | 1.65ns | 6.4ns | 0.00957 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.14μs | 4.41ns | 17.1ns | 0.104 | 0 | 0 | 658 B |
#6042 | RunOnMethodBegin |
net6.0 | 576ns | 0.154ns | 0.578ns | 0.00984 | 0 | 0 | 696 B |
#6042 | RunOnMethodBegin |
netcoreapp3.1 | 897ns | 0.4ns | 1.5ns | 0.00946 | 0 | 0 | 696 B |
#6042 | RunOnMethodBegin |
net472 | 1.19μs | 0.661ns | 2.56ns | 0.104 | 0 | 0 | 658 B |
Co-authored-by: Lucas Pimentel <[email protected]>
c9cf74d
to
c88fe61
Compare
c88fe61
to
846624f
Compare
Adding |
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
inADO.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-separatedstring
ofADO.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 ->We'd need to set
DD_TRACE_DISABLED_ADONET_COMMAND_TYPES
to ->Test coverage
DbScopeFactoryTests
to add new value.FakeCommandTests
to include disabling ofFakeCommand
Other details
Merge the dd-go PR when this PR is merged: https://github.com/DataDog/dd-go/pull/150493
Backported to 2.x in #6054