Fix incorrect instrumentation for new TracerSettings(bool)#5949
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 301984 Passed, 1618 Skipped, 12h 31m 1.95s 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). |
Benchmarks Report for tracer 🐌Benchmarks for #5949 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 - Faster 🎉 Same allocations ✔️
|
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.115 | 1,232.91 | 1,105.71 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.23μs | 0.999ns | 3.87ns | 0.0135 | 0 | 0 | 976 B |
| master | CallElasticsearch |
netcoreapp3.1 | 1.63μs | 0.555ns | 2.15ns | 0.013 | 0 | 0 | 976 B |
| master | CallElasticsearch |
net472 | 2.43μs | 1.72ns | 6.66ns | 0.157 | 0 | 0 | 995 B |
| master | CallElasticsearchAsync |
net6.0 | 1.38μs | 1.31ns | 4.91ns | 0.0131 | 0 | 0 | 952 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 1.57μs | 1.27ns | 4.76ns | 0.014 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 2.58μs | 1.71ns | 6.42ns | 0.167 | 0 | 0 | 1.05 KB |
| #5949 | CallElasticsearch |
net6.0 | 1.11μs | 0.457ns | 1.65ns | 0.0136 | 0 | 0 | 976 B |
| #5949 | CallElasticsearch |
netcoreapp3.1 | 1.58μs | 0.784ns | 2.83ns | 0.0127 | 0 | 0 | 976 B |
| #5949 | CallElasticsearch |
net472 | 2.47μs | 2.1ns | 8.13ns | 0.158 | 0 | 0 | 995 B |
| #5949 | CallElasticsearchAsync |
net6.0 | 1.39μs | 1.24ns | 4.81ns | 0.0132 | 0 | 0 | 952 B |
| #5949 | CallElasticsearchAsync |
netcoreapp3.1 | 1.6μs | 0.79ns | 2.96ns | 0.0137 | 0 | 0 | 1.02 KB |
| #5949 | CallElasticsearchAsync |
net472 | 2.57μs | 2.17ns | 8.42ns | 0.167 | 0.00128 | 0 | 1.05 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.26μs | 0.661ns | 2.47ns | 0.0133 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 1.55μs | 0.555ns | 2ns | 0.0131 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 1.78μs | 1.47ns | 5.71ns | 0.145 | 0 | 0 | 915 B |
| #5949 | ExecuteAsync |
net6.0 | 1.29μs | 0.932ns | 3.61ns | 0.0136 | 0 | 0 | 952 B |
| #5949 | ExecuteAsync |
netcoreapp3.1 | 1.61μs | 0.797ns | 2.98ns | 0.0128 | 0 | 0 | 952 B |
| #5949 | ExecuteAsync |
net472 | 1.8μs | 0.661ns | 2.47ns | 0.145 | 0 | 0 | 915 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 | 4.21μs | 2.09ns | 8.11ns | 0.0315 | 0 | 0 | 2.22 KB |
| master | SendAsync |
netcoreapp3.1 | 5.09μs | 2.27ns | 8.81ns | 0.0358 | 0 | 0 | 2.76 KB |
| master | SendAsync |
net472 | 7.75μs | 3.24ns | 12.6ns | 0.499 | 0 | 0 | 3.15 KB |
| #5949 | SendAsync |
net6.0 | 4.25μs | 1.2ns | 4.33ns | 0.0299 | 0 | 0 | 2.22 KB |
| #5949 | SendAsync |
netcoreapp3.1 | 5.2μs | 2.61ns | 10.1ns | 0.0361 | 0 | 0 | 2.76 KB |
| #5949 | SendAsync |
net472 | 7.71μs | 0.951ns | 3.68ns | 0.499 | 0 | 0 | 3.15 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.48μs | 0.708ns | 2.65ns | 0.023 | 0 | 0 | 1.64 KB |
| master | EnrichedLog |
netcoreapp3.1 | 2.38μs | 1.1ns | 4.12ns | 0.0217 | 0 | 0 | 1.64 KB |
| master | EnrichedLog |
net472 | 2.68μs | 1.93ns | 7.24ns | 0.249 | 0 | 0 | 1.57 KB |
| #5949 | EnrichedLog |
net6.0 | 1.59μs | 1.29ns | 4.66ns | 0.0233 | 0 | 0 | 1.64 KB |
| #5949 | EnrichedLog |
netcoreapp3.1 | 2.36μs | 1.22ns | 4.73ns | 0.0225 | 0 | 0 | 1.64 KB |
| #5949 | EnrichedLog |
net472 | 2.62μs | 1.17ns | 4.37ns | 0.249 | 0 | 0 | 1.57 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 | 116μs | 166ns | 621ns | 0.0578 | 0 | 0 | 4.28 KB |
| master | EnrichedLog |
netcoreapp3.1 | 119μs | 234ns | 905ns | 0 | 0 | 0 | 4.28 KB |
| master | EnrichedLog |
net472 | 148μs | 225ns | 872ns | 0.668 | 0.223 | 0 | 4.46 KB |
| #5949 | EnrichedLog |
net6.0 | 118μs | 139ns | 538ns | 0 | 0 | 0 | 4.28 KB |
| #5949 | EnrichedLog |
netcoreapp3.1 | 119μs | 180ns | 699ns | 0 | 0 | 0 | 4.28 KB |
| #5949 | EnrichedLog |
net472 | 149μs | 237ns | 919ns | 0.668 | 0.223 | 0 | 4.46 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.95μs | 1.62ns | 6.26ns | 0.0313 | 0 | 0 | 2.2 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.09μs | 1.07ns | 4.01ns | 0.0286 | 0 | 0 | 2.2 KB |
| master | EnrichedLog |
net472 | 4.78μs | 2.91ns | 11.3ns | 0.319 | 0 | 0 | 2.02 KB |
| #5949 | EnrichedLog |
net6.0 | 3.14μs | 0.988ns | 3.83ns | 0.0301 | 0 | 0 | 2.2 KB |
| #5949 | EnrichedLog |
netcoreapp3.1 | 4.16μs | 2.33ns | 9.04ns | 0.0291 | 0 | 0 | 2.2 KB |
| #5949 | EnrichedLog |
net472 | 4.82μs | 0.807ns | 3.13ns | 0.319 | 0 | 0 | 2.02 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.37μs | 0.604ns | 2.34ns | 0.0164 | 0 | 0 | 1.14 KB |
| master | SendReceive |
netcoreapp3.1 | 1.76μs | 1.38ns | 5.35ns | 0.0149 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.18μs | 1.64ns | 5.9ns | 0.184 | 0.00109 | 0 | 1.16 KB |
| #5949 | SendReceive |
net6.0 | 1.26μs | 0.371ns | 1.39ns | 0.0158 | 0 | 0 | 1.14 KB |
| #5949 | SendReceive |
netcoreapp3.1 | 1.84μs | 0.748ns | 2.9ns | 0.0156 | 0 | 0 | 1.14 KB |
| #5949 | SendReceive |
net472 | 2.17μs | 1.55ns | 6.02ns | 0.184 | 0 | 0 | 1.16 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.81μs | 0.997ns | 3.86ns | 0.0225 | 0 | 0 | 1.6 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.92μs | 1.92ns | 7.43ns | 0.0217 | 0 | 0 | 1.65 KB |
| master | EnrichedLog |
net472 | 4.36μs | 2.83ns | 11ns | 0.324 | 0 | 0 | 2.04 KB |
| #5949 | EnrichedLog |
net6.0 | 2.8μs | 0.802ns | 3.11ns | 0.0224 | 0 | 0 | 1.6 KB |
| #5949 | EnrichedLog |
netcoreapp3.1 | 3.95μs | 1.61ns | 6.23ns | 0.0217 | 0 | 0 | 1.65 KB |
| #5949 | EnrichedLog |
net472 | 4.25μs | 1.72ns | 6.18ns | 0.323 | 0 | 0 | 2.04 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 | 396ns | 0.124ns | 0.463ns | 0.00819 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 606ns | 0.414ns | 1.6ns | 0.00788 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 630ns | 0.601ns | 2.33ns | 0.0918 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 605ns | 0.291ns | 1.13ns | 0.0097 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 717ns | 0.508ns | 1.97ns | 0.00972 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 841ns | 0.845ns | 3.27ns | 0.104 | 0 | 0 | 658 B |
| #5949 | StartFinishSpan |
net6.0 | 391ns | 1.58ns | 5.92ns | 0.00816 | 0 | 0 | 576 B |
| #5949 | StartFinishSpan |
netcoreapp3.1 | 619ns | 1.24ns | 4.8ns | 0.00799 | 0 | 0 | 576 B |
| #5949 | StartFinishSpan |
net472 | 616ns | 0.205ns | 0.739ns | 0.0916 | 0 | 0 | 578 B |
| #5949 | StartFinishScope |
net6.0 | 545ns | 0.901ns | 3.49ns | 0.00964 | 0 | 0 | 696 B |
| #5949 | StartFinishScope |
netcoreapp3.1 | 786ns | 0.383ns | 1.43ns | 0.00954 | 0 | 0 | 696 B |
| #5949 | StartFinishScope |
net472 | 834ns | 0.446ns | 1.67ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #5949
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.296
578.90
750.53
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.296 | 578.90 | 750.53 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 579ns | 0.354ns | 1.37ns | 0.00966 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 922ns | 1.08ns | 4.02ns | 0.00931 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.05μs | 0.801ns | 3.1ns | 0.104 | 0 | 0 | 658 B |
| #5949 | RunOnMethodBegin |
net6.0 | 750ns | 0.408ns | 1.58ns | 0.00979 | 0 | 0 | 696 B |
| #5949 | RunOnMethodBegin |
netcoreapp3.1 | 876ns | 0.703ns | 2.63ns | 0.00927 | 0 | 0 | 696 B |
| #5949 | RunOnMethodBegin |
net472 | 1.15μs | 1.62ns | 6.27ns | 0.104 | 0 | 0 | 658 B |
Summary of changes
Fix bug in v3 instrumentation of
new TracerSettings(bool useDefaultSources)Reason for change
We were missing a parameter in the instrumentation
Implementation details
Add the missing parameter
Test coverage
We don't have a good coverage for this and I'm not sure the best way to catch it in the future tbh 🤔 Typically we catch these when developing integrations.
I guess in this case the best way is to call every API and check for the side effects, but that also feels like a lot of work, so inclined to just YOLO it unless others think it's worth the effort