-
Notifications
You must be signed in to change notification settings - Fork 145
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
[Tracing] Improve unit tests to assert baggage values when using multiple propagators #6471
[Tracing] Improve unit tests to assert baggage values when using multiple propagators #6471
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 236209 Passed, 2108 Skipped, 18h 20m 41.47s Total Time |
…erate on SpanContext
…his updated interface is eaiser to use from instrumentations when there are no Spans for incoming headers, only span contexts.
- Rename the method from AddSpanLink to AddLink (this also mirrors the suggestion from OpenTelemetry Tracing API spec) - Return the Span object instead of returning nothing
f6a9a08
to
57db143
Compare
…ltiple propagators
030772e
to
0ac1b57
Compare
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 (6471) - mean (69ms) : 64, 74
. : milestone, 69,
master - mean (68ms) : 66, 71
. : milestone, 68,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (978ms) : 952, 1005
. : milestone, 978,
master - mean (975ms) : 958, 992
. : milestone, 975,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6471) - mean (108ms) : 105, 110
. : milestone, 108,
master - mean (107ms) : 104, 110
. : milestone, 107,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (678ms) : 667, 688
. : milestone, 678,
master - mean (678ms) : 663, 693
. : milestone, 678,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6471) - mean (91ms) : 89, 92
. : milestone, 91,
master - mean (92ms) : 90, 93
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (631ms) : 614, 649
. : milestone, 631,
master - mean (636ms) : 621, 650
. : milestone, 636,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6471) - mean (194ms) : 190, 197
. : milestone, 194,
master - mean (194ms) : 191, 197
. : milestone, 194,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (1,099ms) : 1072, 1126
. : milestone, 1099,
master - mean (1,101ms) : 1069, 1133
. : milestone, 1101,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6471) - mean (279ms) : 275, 283
. : milestone, 279,
master - mean (279ms) : 274, 285
. : milestone, 279,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (871ms) : 840, 902
. : milestone, 871,
master - mean (875ms) : 843, 907
. : milestone, 875,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6471) - mean (267ms) : 263, 271
. : milestone, 267,
master - mean (268ms) : 264, 272
. : milestone, 268,
section CallTarget+Inlining+NGEN
This PR (6471) - mean (852ms) : 816, 888
. : milestone, 852,
master - mean (852ms) : 826, 879
. : milestone, 852,
|
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 (6471) (10.781M) : 0, 10780955
master (11.080M) : 0, 11079759
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6471) (7.022M) : 0, 7022252
master (7.154M) : 0, 7154253
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.512M) : 0, 7512246
section Manual
master (11.035M) : 0, 11035311
section Manual + Automatic
This PR (6471) (6.528M) : 0, 6528497
master (6.611M) : 0, 6611049
section DD_TRACE_ENABLED=0
master (10.155M) : 0, 10155447
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6471) (9.424M) : 0, 9424499
master (9.567M) : 0, 9566967
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6471) (6.301M) : 0, 6301480
master (6.361M) : 0, 6360592
section Trace stats
master (6.540M) : 0, 6540289
section Manual
master (9.643M) : 0, 9642857
section Manual + Automatic
This PR (6471) (5.844M) : 0, 5843728
master (5.877M) : 0, 5877320
section DD_TRACE_ENABLED=0
master (8.928M) : 0, 8928120
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6471) (10.001M) : 0, 10001073
master (9.916M) : 0, 9915888
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6471) (6.487M) : 0, 6487269
master (6.337M) : 0, 6336520
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.963M) : 0, 6963468
section Manual
master (9.842M) : 0, 9842464
section Manual + Automatic
This PR (6471) (6.050M) : 0, 6050242
master (6.172M) : 0, 6171910
section DD_TRACE_ENABLED=0
master (9.319M) : 0, 9318507
|
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.
Moar tests is better 👍
Benchmarks Report for tracer 🐌Benchmarks for #6471 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.136 | 482.04 | 547.36 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 396ns | 0.401ns | 1.5ns | 0.00804 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 564ns | 1.08ns | 4.19ns | 0.0079 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 630ns | 0.293ns | 1.13ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 482ns | 0.233ns | 0.901ns | 0.00967 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 756ns | 0.288ns | 1.12ns | 0.0093 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 855ns | 0.595ns | 2.3ns | 0.104 | 0 | 0 | 658 B |
#6471 | StartFinishSpan |
net6.0 | 392ns | 0.194ns | 0.75ns | 0.00811 | 0 | 0 | 576 B |
#6471 | StartFinishSpan |
netcoreapp3.1 | 556ns | 0.324ns | 1.21ns | 0.00761 | 0 | 0 | 576 B |
#6471 | StartFinishSpan |
net472 | 644ns | 0.425ns | 1.59ns | 0.0917 | 0 | 0 | 578 B |
#6471 | StartFinishScope |
net6.0 | 547ns | 0.238ns | 0.921ns | 0.00991 | 0 | 0 | 696 B |
#6471 | StartFinishScope |
netcoreapp3.1 | 800ns | 0.581ns | 2.25ns | 0.0092 | 0 | 0 | 696 B |
#6471 | StartFinishScope |
net472 | 918ns | 0.523ns | 2.02ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6471
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.124
738.21
656.54
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.124 | 738.21 | 656.54 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 737ns | 0.742ns | 2.87ns | 0.00993 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 902ns | 0.858ns | 3.32ns | 0.00948 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.08μs | 0.56ns | 2.17ns | 0.104 | 0 | 0 | 658 B |
#6471 | RunOnMethodBegin |
net6.0 | 657ns | 0.362ns | 1.4ns | 0.00984 | 0 | 0 | 696 B |
#6471 | RunOnMethodBegin |
netcoreapp3.1 | 923ns | 0.666ns | 2.58ns | 0.00923 | 0 | 0 | 696 B |
#6471 | RunOnMethodBegin |
net472 | 1.2μs | 0.798ns | 3.09ns | 0.104 | 0 | 0 | 658 B |
Summary of changes
Adds
baggage
propagator to our existing multi-propagator unit testsReason for change
For testing multiple propagators and the
DD_TRACE_PROPAGATION_EXTRACT_FIRST
, there's specific baggage interactions that need to be tested.Implementation details
Test coverage
Updated unit tests.
Other details