-
Notifications
You must be signed in to change notification settings - Fork 147
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
Fix: Rabbitmq7 header injection overwrites user supplied basic properties [from external PR #6730] #6753
base: master
Are you sure you want to change the base?
Conversation
...er/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/CachedBasicPropertiesHelper.cs
Outdated
Show resolved
Hide resolved
....Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/PopulateBasicPropertiesHeadersIntegration.cs
Outdated
Show resolved
Hide resolved
....Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/PopulateBasicPropertiesHeadersIntegration.cs
Outdated
Show resolved
Hide resolved
....Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/PopulateBasicPropertiesHeadersIntegration.cs
Outdated
Show resolved
Hide resolved
.../test/Datadog.Trace.ClrProfiler.Managed.Tests/Datadog.Trace.ClrProfiler.Managed.Tests.csproj
Show resolved
Hide resolved
.../test/Datadog.Trace.ClrProfiler.Managed.Tests/Datadog.Trace.ClrProfiler.Managed.Tests.csproj
Show resolved
Hide resolved
...e.ClrProfiler.Managed.Tests/AutoInstrumentation/RabbitMQ/CachedBasicPropertiesHelperTests.cs
Show resolved
Hide resolved
Datadog ReportAll test runs ❌ 2 Total Test Services: 1 Failed, 1 Passed Test Services
❌ Failed Tests (49)
|
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 (6753) - mean (69ms) : 66, 71
. : milestone, 69,
master - mean (70ms) : 67, 74
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (1,000ms) : 985, 1015
. : milestone, 1000,
master - mean (1,009ms) : 989, 1028
. : milestone, 1009,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6753) - mean (102ms) : 100, 104
. : milestone, 102,
master - mean (104ms) : 101, 106
. : milestone, 104,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (679ms) : 661, 696
. : milestone, 679,
master - mean (689ms) : 671, 707
. : milestone, 689,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6753) - mean (89ms) : 87, 91
. : milestone, 89,
master - mean (90ms) : 89, 92
. : milestone, 90,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (637ms) : 622, 653
. : milestone, 637,
master - mean (645ms) : 632, 659
. : milestone, 645,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6753) - mean (190ms) : 185, 195
. : milestone, 190,
master - mean (189ms) : 186, 192
. : milestone, 189,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (1,102ms) : 1072, 1133
. : milestone, 1102,
master - mean (1,103ms) : 1077, 1128
. : milestone, 1103,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6753) - mean (268ms) : 264, 272
. : milestone, 268,
master - mean (268ms) : 265, 271
. : milestone, 268,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (871ms) : 830, 912
. : milestone, 871,
master - mean (872ms) : 844, 900
. : milestone, 872,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6753) - mean (261ms) : 257, 264
. : milestone, 261,
master - mean (262ms) : 259, 266
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6753) - mean (854ms) : 815, 893
. : milestone, 854,
master - mean (862ms) : 827, 897
. : milestone, 862,
|
41124da
to
74669a8
Compare
Benchmarks Report for tracer 🐌Benchmarks for #6753 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.StartFinishScope‑net6.0 | 1.115 | 546.48 | 490.13 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 435ns | 1.04ns | 4.04ns | 0.00803 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 562ns | 0.624ns | 2.42ns | 0.00782 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 651ns | 0.34ns | 1.32ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 546ns | 0.0758ns | 0.284ns | 0.00983 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 697ns | 0.279ns | 1.04ns | 0.00941 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 798ns | 0.32ns | 1.24ns | 0.105 | 0 | 0 | 658 B |
#6753 | StartFinishSpan |
net6.0 | 397ns | 0.193ns | 0.746ns | 0.00815 | 0 | 0 | 576 B |
#6753 | StartFinishSpan |
netcoreapp3.1 | 577ns | 0.351ns | 1.36ns | 0.00754 | 0 | 0 | 576 B |
#6753 | StartFinishSpan |
net472 | 592ns | 0.227ns | 0.818ns | 0.0916 | 0 | 0 | 578 B |
#6753 | StartFinishScope |
net6.0 | 490ns | 0.122ns | 0.455ns | 0.00985 | 0 | 0 | 696 B |
#6753 | StartFinishScope |
netcoreapp3.1 | 675ns | 0.332ns | 1.28ns | 0.00953 | 0 | 0 | 696 B |
#6753 | StartFinishScope |
net472 | 782ns | 0.211ns | 0.79ns | 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 | 602ns | 0.161ns | 0.623ns | 0.00966 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 1.04μs | 1.13ns | 4.37ns | 0.00933 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.04μs | 0.68ns | 2.64ns | 0.104 | 0 | 0 | 658 B |
#6753 | RunOnMethodBegin |
net6.0 | 666ns | 0.165ns | 0.638ns | 0.00966 | 0 | 0 | 696 B |
#6753 | RunOnMethodBegin |
netcoreapp3.1 | 964ns | 0.46ns | 1.72ns | 0.00918 | 0 | 0 | 696 B |
#6753 | RunOnMethodBegin |
net472 | 1.12μs | 5.3ns | 21.2ns | 0.104 | 0 | 0 | 658 B |
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.
A couple of suggestions, and once the tests pass so we know it works I think we'll be good! 😄
....Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/PopulateBasicPropertiesHeadersIntegration.cs
Outdated
Show resolved
Hide resolved
....Trace/ClrProfiler/AutoInstrumentation/RabbitMQ/PopulateBasicPropertiesHeadersIntegration.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
1f0708e
to
2be7c3f
Compare
Based on #6730 by @johang88.
Summary of changes
Fixes the header injection so that basic properties are preserved from the supplied argument list in case
PopulateBasicPropertiesHeaders
returns null which happens if the basic properties argument is writable or if no changes had to be made to it.Reason for change
Fixes a bug that would remove all user supplied basic properties.
Implementation details
Stores the basicproperties argument in the active scope and retrieves it a null return value is encountered. Changed
CachedBasicPropertiesHelper
to call the copy constructor that takes aIReadOnlyBasicProperties
as argument.Test coverage
Added basic properties to one of the rabbitmq7 test methods as well as assertions.
Other details
Fixes #6723