-
Notifications
You must be signed in to change notification settings - Fork 141
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
Try to fix flake in ManualInstrumentation tests #6333
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 449567 Passed, 2726 Skipped, 19h 20m 8.69s 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 (6333) - mean (72ms) : 64, 79
. : milestone, 72,
master - mean (71ms) : 64, 78
. : milestone, 71,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (1,108ms) : 1088, 1128
. : milestone, 1108,
master - mean (1,109ms) : 1083, 1135
. : milestone, 1109,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6333) - mean (109ms) : 106, 111
. : milestone, 109,
master - mean (109ms) : 106, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (765ms) : 750, 780
. : milestone, 765,
master - mean (772ms) : 752, 791
. : milestone, 772,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6333) - mean (92ms) : 90, 94
. : milestone, 92,
master - mean (92ms) : 91, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (725ms) : 712, 738
. : milestone, 725,
master - mean (726ms) : 711, 741
. : milestone, 726,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6333) - mean (191ms) : 187, 195
. : milestone, 191,
master - mean (192ms) : 186, 198
. : milestone, 192,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (1,214ms) : 1193, 1234
. : milestone, 1214,
master - mean (1,214ms) : 1192, 1237
. : milestone, 1214,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6333) - mean (277ms) : 272, 281
. : milestone, 277,
master - mean (278ms) : 272, 284
. : milestone, 278,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (942ms) : 926, 959
. : milestone, 942,
master - mean (949ms) : 933, 965
. : milestone, 949,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6333) - mean (266ms) : 261, 271
. : milestone, 266,
master - mean (266ms) : 262, 270
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (6333) - mean (930ms) : 910, 950
. : milestone, 930,
master - mean (931ms) : 914, 948
. : milestone, 931,
|
ee4d15f
to
ad3394e
Compare
a931007
to
0e651ce
Compare
Benchmarks Report for tracer 🐌Benchmarks for #6333 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‑netcoreapp3.1 | 1.232 | 640.08 | 788.41 | |
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.203 | 387.35 | 465.93 | |
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.120 | 477.12 | 534.27 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 388ns | 0.528ns | 2.04ns | 0.00809 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 615ns | 1.12ns | 4.34ns | 0.00767 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 643ns | 1.25ns | 4.82ns | 0.0917 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 477ns | 0.672ns | 2.6ns | 0.0099 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 639ns | 1.12ns | 4.18ns | 0.00921 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 847ns | 1.27ns | 4.91ns | 0.105 | 0 | 0 | 658 B |
#6333 | StartFinishSpan |
net6.0 | 466ns | 1.02ns | 3.94ns | 0.00794 | 0 | 0 | 576 B |
#6333 | StartFinishSpan |
netcoreapp3.1 | 557ns | 0.818ns | 3.17ns | 0.00759 | 0 | 0 | 576 B |
#6333 | StartFinishSpan |
net472 | 674ns | 1.67ns | 6.24ns | 0.0915 | 0 | 0 | 578 B |
#6333 | StartFinishScope |
net6.0 | 534ns | 0.981ns | 3.8ns | 0.00968 | 0 | 0 | 696 B |
#6333 | StartFinishScope |
netcoreapp3.1 | 786ns | 1.83ns | 7.08ns | 0.00935 | 0 | 0 | 696 B |
#6333 | StartFinishScope |
net472 | 815ns | 1.9ns | 7.37ns | 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 | 594ns | 0.832ns | 3.22ns | 0.00963 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 857ns | 1.45ns | 5.61ns | 0.00952 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.09μs | 1.86ns | 7.22ns | 0.104 | 0 | 0 | 658 B |
#6333 | RunOnMethodBegin |
net6.0 | 650ns | 0.874ns | 3.38ns | 0.00971 | 0 | 0 | 696 B |
#6333 | RunOnMethodBegin |
netcoreapp3.1 | 941ns | 2.77ns | 10.7ns | 0.00936 | 0 | 0 | 696 B |
#6333 | RunOnMethodBegin |
net472 | 1.13μs | 2.11ns | 8.16ns | 0.104 | 0 | 0 | 658 B |
0e651ce
to
d6306fa
Compare
Summary of changes
Add a mutex to try to avoid flake
Reason for change
We see occasional flake in the manual + automatic instrumentation tests. I don't entirely understand why this happens other than it shows that the httplistener span is getting serialized after we have reconfigured the tracer (because traces aren't tied to a settings instance). This is arguably a bug, but it's "known" to an extent. The problem is that it's causing flake when you change the base service name.
Implementation details
Add a mutex to try to make sure the httplistener span is closed before we close the request span
Test coverage
Enabled debug logs so that we can get more details if this does recur.
Other details
Stacked on: