[Tracer] Add Azure Event Hubs instrumentation #7620
[Tracer] Add Azure Event Hubs instrumentation #7620pablomartinezbernardo merged 3 commits intomasterfrom
Conversation
|
|
@codex review |
I don't see |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting |
tracer/missing-nullability-files.csv
Outdated
| src/Datadog.Trace/Tagging/AwsSdkTags.cs | ||
| src/Datadog.Trace/Tagging/AwsSnsTags.cs | ||
| src/Datadog.Trace/Tagging/AwsSqsTags.cs | ||
| src/Datadog.Trace/Tagging/AzureEventHubsTags.cs |
There was a problem hiding this comment.
When adding new files, always use #nullable enable to prevent adding to this list. We want this list to get smaller over time until it's empty.
| using Datadog.Trace.ExtensionMethods; | ||
| using Datadog.Trace.SourceGenerators; | ||
|
|
||
| #pragma warning disable SA1402 // File must contain single type |
There was a problem hiding this comment.
New files should use #nullable enable until we have migrated everything and we can enable it solution-wide.
bouwkast
left a comment
There was a problem hiding this comment.
Still going through it, quite a large PR
Why is this disabled by default?
| "SampleProjectName": "Samples.AzureEventHubs", | ||
| "NugetPackageSearchName": "Azure.Messaging.EventHubs", | ||
| "MinVersion": "5.11.0", | ||
| "MaxVersionExclusive": "5.13.0", |
There was a problem hiding this comment.
| "MaxVersionExclusive": "5.13.0", | |
| "MaxVersionExclusive": "6.0.0", |
Otherwise we'd stop testing right away basically whereas we'd likely want to test all 5.11.0+
There was a problem hiding this comment.
Thanks! Changed it for SB as well
bf30035 to
9238498
Compare
Because of a misunderstanding on previous talks. Changed it to enabled by default along with SB |
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7620 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 ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 | 5.69 KB | 5.73 KB | 39 B | 0.69% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 6.11 KB | 5.99 KB | -120 B | -1.96% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.5μs | 58.5ns | 361ns | 0 | 0 | 0 | 5.51 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 14μs | 70.9ns | 333ns | 0 | 0 | 0 | 5.69 KB |
| master | StartStopWithChild |
net472 | 22.1μs | 119ns | 676ns | 0.952 | 0.212 | 0 | 6.11 KB |
| #7620 | StartStopWithChild |
net6.0 | 10.5μs | 58.9ns | 377ns | 0 | 0 | 0 | 5.52 KB |
| #7620 | StartStopWithChild |
netcoreapp3.1 | 13.2μs | 69.4ns | 347ns | 0 | 0 | 0 | 5.73 KB |
| #7620 | StartStopWithChild |
net472 | 22.1μs | 123ns | 797ns | 0.968 | 0.43 | 0.108 | 5.99 KB |
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 927μs | 173ns | 624ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.05ms | 599ns | 2.32μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.18ms | 71.7ns | 268ns | 0 | 0 | 0 | 3.31 KB |
| #7620 | WriteAndFlushEnrichedTraces |
net6.0 | 945μs | 223ns | 834ns | 0 | 0 | 0 | 2.71 KB |
| #7620 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 67.8ns | 235ns | 0 | 0 | 0 | 2.7 KB |
| #7620 | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 43.3ns | 156ns | 0 | 0 | 0 | 3.31 KB |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7620
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0
178.25 KB
180.41 KB
2.16 KB
1.21%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0
181.77 KB
183.93 KB
2.16 KB
1.19%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑netcoreapp3.1
184.01 KB
186.17 KB
2.16 KB
1.17%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑netcoreapp3.1
187.44 KB
189.6 KB
2.16 KB
1.15%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472
203.96 KB
206.21 KB
2.25 KB
1.10%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472
207.5 KB
209.74 KB
2.24 KB
1.08%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 | 178.25 KB | 180.41 KB | 2.16 KB | 1.21% |
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 | 181.77 KB | 183.93 KB | 2.16 KB | 1.19% |
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑netcoreapp3.1 | 184.01 KB | 186.17 KB | 2.16 KB | 1.17% |
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑netcoreapp3.1 | 187.44 KB | 189.6 KB | 2.16 KB | 1.15% |
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 | 203.96 KB | 206.21 KB | 2.25 KB | 1.10% |
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 | 207.5 KB | 209.74 KB | 2.24 KB | 1.08% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 345μs | 1.64μs | 6.75μs | 0 | 0 | 0 | 178.25 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 505μs | 1.46μs | 5.66μs | 0 | 0 | 0 | 184.01 KB |
| master | AllCycleSimpleBody |
net472 | 462μs | 84ns | 314ns | 31.2 | 0 | 0 | 203.96 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 353μs | 1.01μs | 3.76μs | 0 | 0 | 0 | 181.77 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 502μs | 1.71μs | 6.61μs | 0 | 0 | 0 | 187.44 KB |
| master | AllCycleMoreComplexBody |
net472 | 472μs | 97.3ns | 351ns | 32.4 | 0 | 0 | 207.5 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 325ns | 0.203ns | 0.784ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 388ns | 2.21ns | 15.2ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 308ns | 0.0144ns | 0.05ns | 0.0445 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.39μs | 31.1ns | 136ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.77μs | 35.6ns | 138ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.75μs | 1.81ns | 6.79ns | 0.573 | 0 | 0 | 3.8 KB |
| #7620 | AllCycleSimpleBody |
net6.0 | 348μs | 164ns | 590ns | 0 | 0 | 0 | 180.41 KB |
| #7620 | AllCycleSimpleBody |
netcoreapp3.1 | 495μs | 1.07μs | 4.14μs | 0 | 0 | 0 | 186.17 KB |
| #7620 | AllCycleSimpleBody |
net472 | 463μs | 69.4ns | 260ns | 32.4 | 0 | 0 | 206.21 KB |
| #7620 | AllCycleMoreComplexBody |
net6.0 | 354μs | 279ns | 1.08μs | 0 | 0 | 0 | 183.93 KB |
| #7620 | AllCycleMoreComplexBody |
netcoreapp3.1 | 539μs | 1.43μs | 5.54μs | 0 | 0 | 0 | 189.6 KB |
| #7620 | AllCycleMoreComplexBody |
net472 | 471μs | 114ns | 427ns | 32.4 | 0 | 0 | 209.74 KB |
| #7620 | ObjectExtractorSimpleBody |
net6.0 | 323ns | 0.14ns | 0.523ns | 0 | 0 | 0 | 280 B |
| #7620 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 395ns | 2.23ns | 14.4ns | 0 | 0 | 0 | 272 B |
| #7620 | ObjectExtractorSimpleBody |
net472 | 296ns | 0.0253ns | 0.0913ns | 0.0432 | 0 | 0 | 281 B |
| #7620 | ObjectExtractorMoreComplexBody |
net6.0 | 6.34μs | 30.4ns | 114ns | 0 | 0 | 0 | 3.78 KB |
| #7620 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.67μs | 37.8ns | 156ns | 0 | 0 | 0 | 3.69 KB |
| #7620 | ObjectExtractorMoreComplexBody |
net472 | 6.64μs | 0.923ns | 3.57ns | 0.599 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 78.7μs | 87.4ns | 327ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 98.3μs | 231ns | 896ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 13.2ns | 49.4ns | 4.9 | 0 | 0 | 32.51 KB |
| master | EncodeLegacyArgs |
net6.0 | 147μs | 193ns | 749ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 183ns | 709ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 265μs | 109ns | 423ns | 0 | 0 | 0 | 2.16 KB |
| #7620 | EncodeArgs |
net6.0 | 76.8μs | 272ns | 1.05μs | 0 | 0 | 0 | 32.4 KB |
| #7620 | EncodeArgs |
netcoreapp3.1 | 97.7μs | 171ns | 663ns | 0 | 0 | 0 | 32.4 KB |
| #7620 | EncodeArgs |
net472 | 110μs | 15.4ns | 59.6ns | 4.95 | 0 | 0 | 32.51 KB |
| #7620 | EncodeLegacyArgs |
net6.0 | 143μs | 33.5ns | 125ns | 0 | 0 | 0 | 2.15 KB |
| #7620 | EncodeLegacyArgs |
netcoreapp3.1 | 197μs | 164ns | 636ns | 0 | 0 | 0 | 2.14 KB |
| #7620 | EncodeLegacyArgs |
net472 | 262μs | 79.4ns | 308ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7620
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1
4.48 KB
4.51 KB
27 B
0.60%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 | 4.48 KB | 4.51 KB | 27 B | 0.60% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 409μs | 147ns | 510ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 819μs | 11.4μs | 113μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 434μs | 80.3ns | 311ns | 0 | 0 | 0 | 4.68 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 296μs | 62.9ns | 244ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 298μs | 224ns | 866ns | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 312μs | 56.3ns | 218ns | 0 | 0 | 0 | 2.29 KB |
| #7620 | RunWafRealisticBenchmark |
net6.0 | 398μs | 111ns | 417ns | 0 | 0 | 0 | 4.55 KB |
| #7620 | RunWafRealisticBenchmark |
netcoreapp3.1 | 853μs | 3.99μs | 15.4μs | 0 | 0 | 0 | 4.51 KB |
| #7620 | RunWafRealisticBenchmark |
net472 | 431μs | 52.7ns | 197ns | 0 | 0 | 0 | 4.66 KB |
| #7620 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 288μs | 45.6ns | 171ns | 0 | 0 | 0 | 2.24 KB |
| #7620 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 297μs | 71ns | 246ns | 0 | 0 | 0 | 2.22 KB |
| #7620 | RunWafRealisticBenchmarkWithAttack |
net472 | 312μs | 32.5ns | 122ns | 0 | 0 | 0 | 2.29 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net6.0 | 62μs | 56.9ns | 220ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 72.8μs | 106ns | 381ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00389ns | 0.0018ns | 0.00698ns | 0 | 0 | 0 | 0 b |
| #7620 | SendRequest |
net6.0 | 61.1μs | 95.8ns | 358ns | 0 | 0 | 0 | 14.52 KB |
| #7620 | SendRequest |
netcoreapp3.1 | 71.9μs | 99.7ns | 359ns | 0 | 0 | 0 | 17.42 KB |
| #7620 | SendRequest |
net472 | 0.000379ns | 0.000379ns | 0.00147ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7620
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
1 B
2 B
1 B
100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
4 B
7 B
3 B
75.00%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 1 B | 2 B | 1 B | 100.00% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 4 B | 7 B | 3 B | 75.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.95ms | 609ns | 2.28μs | 0 | 0 | 0 | 640.01 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.06ms | 4.72μs | 17.7μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.71ms | 1.73μs | 6.7μs | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.51ms | 210ns | 814ns | 0 | 0 | 0 | 4 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.67ms | 365ns | 1.42μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 1.94ms | 249ns | 965ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 807μs | 59.1ns | 229ns | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 835μs | 151ns | 586ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.2ms | 197ns | 738ns | 0 | 0 | 0 | 0 b |
| #7620 | OriginalCharSlice |
net6.0 | 1.91ms | 1.22μs | 4.58μs | 0 | 0 | 0 | 640.01 KB |
| #7620 | OriginalCharSlice |
netcoreapp3.1 | 2.14ms | 1.13μs | 3.9μs | 0 | 0 | 0 | 640 KB |
| #7620 | OriginalCharSlice |
net472 | 2.57ms | 3.17μs | 12.3μs | 100 | 0 | 0 | 641.95 KB |
| #7620 | OptimizedCharSlice |
net6.0 | 1.42ms | 253ns | 978ns | 0 | 0 | 0 | 7 B |
| #7620 | OptimizedCharSlice |
netcoreapp3.1 | 1.71ms | 722ns | 2.8μs | 0 | 0 | 0 | 1 B |
| #7620 | OptimizedCharSlice |
net472 | 1.9ms | 255ns | 989ns | 0 | 0 | 0 | 0 b |
| #7620 | OptimizedCharSliceWithPool |
net6.0 | 833μs | 21.6ns | 83.8ns | 0 | 0 | 0 | 2 B |
| #7620 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 843μs | 117ns | 452ns | 0 | 0 | 0 | 0 b |
| #7620 | OptimizedCharSliceWithPool |
net472 | 1.14ms | 99.5ns | 385ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #7620
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
1.171
984,761.30
840,784.38
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 1.171 | 984,761.30 | 840,784.38 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 695μs | 4.01μs | 33.8μs | 0 | 0 | 0 | 41.82 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 759μs | 4.01μs | 20.4μs | 0 | 0 | 0 | 42.29 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 987μs | 3.03μs | 11.3μs | 4.81 | 0 | 0 | 55.97 KB |
| #7620 | WriteAndFlushEnrichedTraces |
net6.0 | 685μs | 712ns | 2.76μs | 0 | 0 | 0 | 41.84 KB |
| #7620 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 776μs | 6.25μs | 62.5μs | 0 | 0 | 0 | 42.09 KB |
| #7620 | WriteAndFlushEnrichedTraces |
net472 | 838μs | 3.35μs | 13μs | 7.81 | 0 | 0 | 55.94 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net6.0 | 1.92μs | 9.49ns | 39.1ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.57μs | 11.6ns | 44.8ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.77μs | 5.69ns | 21.3ns | 0.15 | 0.0136 | 0 | 987 B |
| #7620 | ExecuteNonQuery |
net6.0 | 1.88μs | 9.5ns | 43.5ns | 0 | 0 | 0 | 1.02 KB |
| #7620 | ExecuteNonQuery |
netcoreapp3.1 | 2.51μs | 5.99ns | 22.4ns | 0 | 0 | 0 | 1.02 KB |
| #7620 | ExecuteNonQuery |
net472 | 2.7μs | 3.56ns | 13.8ns | 0.149 | 0.0136 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.75μs | 7.58ns | 36.4ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.32μs | 11.3ns | 46.7ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.5μs | 4ns | 15.5ns | 0.158 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.84μs | 6.28ns | 24.3ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.43μs | 8.84ns | 34.2ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.88μs | 3.58ns | 13.4ns | 0.173 | 0 | 0 | 1.1 KB |
| #7620 | CallElasticsearch |
net6.0 | 1.8μs | 6.63ns | 25.7ns | 0 | 0 | 0 | 1.03 KB |
| #7620 | CallElasticsearch |
netcoreapp3.1 | 2.31μs | 10.3ns | 38.4ns | 0 | 0 | 0 | 1.03 KB |
| #7620 | CallElasticsearch |
net472 | 3.51μs | 4.86ns | 18.8ns | 0.159 | 0 | 0 | 1.04 KB |
| #7620 | CallElasticsearchAsync |
net6.0 | 1.92μs | 8.16ns | 31.6ns | 0 | 0 | 0 | 1.01 KB |
| #7620 | CallElasticsearchAsync |
netcoreapp3.1 | 2.45μs | 12.2ns | 54.4ns | 0 | 0 | 0 | 1.08 KB |
| #7620 | CallElasticsearchAsync |
net472 | 3.74μs | 5.3ns | 20.5ns | 0.168 | 0 | 0 | 1.1 KB |
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #7620
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0
1.118
2,024.43
1,810.02
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 1.118 | 2,024.43 | 1,810.02 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 2.01μs | 8.69ns | 33.6ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.33μs | 9.79ns | 35.3ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.52μs | 7.62ns | 29.5ns | 0.141 | 0 | 0 | 915 B |
| #7620 | ExecuteAsync |
net6.0 | 1.8μs | 8.54ns | 33.1ns | 0 | 0 | 0 | 952 B |
| #7620 | ExecuteAsync |
netcoreapp3.1 | 2.43μs | 11.9ns | 54.6ns | 0 | 0 | 0 | 952 B |
| #7620 | ExecuteAsync |
net472 | 2.54μs | 2.49ns | 9.31ns | 0.14 | 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 | 6.98μs | 5.84ns | 20.2ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.65μs | 24.5ns | 91.5ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.3μs | 12.9ns | 50.1ns | 0.493 | 0 | 0 | 3.18 KB |
| #7620 | SendAsync |
net6.0 | 7.22μs | 7.08ns | 25.5ns | 0 | 0 | 0 | 2.36 KB |
| #7620 | SendAsync |
netcoreapp3.1 | 8.56μs | 17.3ns | 64.9ns | 0 | 0 | 0 | 2.9 KB |
| #7620 | SendAsync |
net472 | 12.4μs | 12.6ns | 48.8ns | 0.496 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7620
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
1.185
553,600.00
467,300.00
More allocations ⚠️ in #7620
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
248.67 KB
275.54 KB
26.86 KB
10.80%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
42.78 KB
43.93 KB
1.14 KB
2.67%
Fewer allocations 🎉 in #7620
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
44.9 KB
43.82 KB
-1.07 KB
-2.39%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
277.88 KB
257.91 KB
-19.97 KB
-7.19%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 1.185 | 553,600.00 | 467,300.00 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 248.67 KB | 275.54 KB | 26.86 KB | 10.80% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 42.78 KB | 43.93 KB | 1.14 KB | 2.67% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 44.9 KB | 43.82 KB | -1.07 KB | -2.39% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 277.88 KB | 257.91 KB | -19.97 KB | -7.19% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 51.7μs | 809ns | 8μs | 0 | 0 | 0 | 44.9 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 50.4μs | 444ns | 4.28μs | 0 | 0 | 0 | 42.78 KB |
| master | StringConcatBenchmark |
net472 | 57.4μs | 281ns | 1.16μs | 0 | 0 | 0 | 57.34 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 555μs | 2.58μs | 9.65μs | 0 | 0 | 0 | 277.88 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 523μs | 2.44μs | 9.11μs | 0 | 0 | 0 | 248.67 KB |
| master | StringConcatAspectBenchmark |
net472 | 404μs | 2.29μs | 16.8μs | 0 | 0 | 0 | 278.53 KB |
| #7620 | StringConcatBenchmark |
net6.0 | 42.7μs | 241ns | 1.52μs | 0 | 0 | 0 | 43.82 KB |
| #7620 | StringConcatBenchmark |
netcoreapp3.1 | 48.4μs | 241ns | 1.08μs | 0 | 0 | 0 | 43.93 KB |
| #7620 | StringConcatBenchmark |
net472 | 55.9μs | 213ns | 929ns | 0 | 0 | 0 | 57.34 KB |
| #7620 | StringConcatAspectBenchmark |
net6.0 | 469μs | 1.76μs | 6.33μs | 0 | 0 | 0 | 257.91 KB |
| #7620 | StringConcatAspectBenchmark |
netcoreapp3.1 | 511μs | 2.54μs | 10.8μs | 0 | 0 | 0 | 275.54 KB |
| #7620 | StringConcatAspectBenchmark |
net472 | 402μs | 2.17μs | 11.5μs | 0 | 0 | 0 | 278.53 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 | 2.48μs | 8.94ns | 34.6ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.58μs | 12.9ns | 50.1ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.78μs | 6.93ns | 26.9ns | 0.246 | 0 | 0 | 1.64 KB |
| #7620 | EnrichedLog |
net6.0 | 2.49μs | 0.815ns | 3.05ns | 0 | 0 | 0 | 1.7 KB |
| #7620 | EnrichedLog |
netcoreapp3.1 | 3.54μs | 17ns | 70.3ns | 0 | 0 | 0 | 1.7 KB |
| #7620 | EnrichedLog |
net472 | 3.63μs | 2.87ns | 11.1ns | 0.254 | 0 | 0 | 1.64 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 | 125μs | 546ns | 2.5μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 127μs | 133ns | 498ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 167μs | 105ns | 405ns | 0 | 0 | 0 | 4.52 KB |
| #7620 | EnrichedLog |
net6.0 | 126μs | 722ns | 5.64μs | 0 | 0 | 0 | 4.31 KB |
| #7620 | EnrichedLog |
netcoreapp3.1 | 128μs | 190ns | 711ns | 0 | 0 | 0 | 4.31 KB |
| #7620 | EnrichedLog |
net472 | 167μs | 92.8ns | 347ns | 0 | 0 | 0 | 4.52 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 | 4.98μs | 10.8ns | 41.6ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.8μs | 13.1ns | 50.6ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.26μs | 5.4ns | 20.9ns | 0.325 | 0 | 0 | 2.08 KB |
| #7620 | EnrichedLog |
net6.0 | 5.1μs | 17.3ns | 64.8ns | 0 | 0 | 0 | 2.26 KB |
| #7620 | EnrichedLog |
netcoreapp3.1 | 6.92μs | 14.6ns | 56.4ns | 0 | 0 | 0 | 2.26 KB |
| #7620 | EnrichedLog |
net472 | 7.68μs | 10.3ns | 40.1ns | 0.307 | 0 | 0 | 2.08 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.94μs | 10.1ns | 50.5ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.86μs | 7.7ns | 29.8ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.05μs | 4.77ns | 18.5ns | 0.186 | 0 | 0 | 1.2 KB |
| #7620 | SendReceive |
net6.0 | 2.04μs | 9.73ns | 40.1ns | 0 | 0 | 0 | 1.2 KB |
| #7620 | SendReceive |
netcoreapp3.1 | 2.68μs | 10.7ns | 41.4ns | 0 | 0 | 0 | 1.2 KB |
| #7620 | SendReceive |
net472 | 3.12μs | 3.66ns | 13.7ns | 0.185 | 0 | 0 | 1.2 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 | 4.16μs | 17.2ns | 61.9ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.47μs | 12.8ns | 49.6ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.43μs | 4.53ns | 16.3ns | 0.322 | 0 | 0 | 2.03 KB |
| #7620 | EnrichedLog |
net6.0 | 4.06μs | 2.57ns | 9.62ns | 0 | 0 | 0 | 1.58 KB |
| #7620 | EnrichedLog |
netcoreapp3.1 | 5.49μs | 11.8ns | 45.8ns | 0 | 0 | 0 | 1.63 KB |
| #7620 | EnrichedLog |
net472 | 6.48μs | 7.92ns | 30.7ns | 0.291 | 0 | 0 | 2.03 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 | 742ns | 3.39ns | 13.6ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 919ns | 0.601ns | 2.33ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 891ns | 0.563ns | 2.18ns | 0.0895 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 878ns | 4.86ns | 24.8ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.14μs | 6.1ns | 32.3ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.11μs | 1.53ns | 5.92ns | 0.0995 | 0 | 0 | 658 B |
| #7620 | StartFinishSpan |
net6.0 | 738ns | 3.76ns | 16.4ns | 0 | 0 | 0 | 576 B |
| #7620 | StartFinishSpan |
netcoreapp3.1 | 923ns | 5.05ns | 28.5ns | 0 | 0 | 0 | 576 B |
| #7620 | StartFinishSpan |
net472 | 894ns | 0.131ns | 0.471ns | 0.0893 | 0 | 0 | 578 B |
| #7620 | StartFinishScope |
net6.0 | 874ns | 3.76ns | 14.6ns | 0 | 0 | 0 | 696 B |
| #7620 | StartFinishScope |
netcoreapp3.1 | 1.16μs | 6.02ns | 30.1ns | 0 | 0 | 0 | 696 B |
| #7620 | StartFinishScope |
net472 | 1.07μs | 0.245ns | 0.918ns | 0.102 | 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 | 1.03μs | 5.57ns | 31ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.45μs | 6.05ns | 23.4ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.44μs | 0.394ns | 1.42ns | 0.101 | 0 | 0 | 658 B |
| #7620 | RunOnMethodBegin |
net6.0 | 1.02μs | 5.61ns | 28.1ns | 0 | 0 | 0 | 696 B |
| #7620 | RunOnMethodBegin |
netcoreapp3.1 | 1.39μs | 6.91ns | 29.3ns | 0 | 0 | 0 | 696 B |
| #7620 | RunOnMethodBegin |
net472 | 1.41μs | 1.35ns | 5.06ns | 0.0989 | 0 | 0 | 658 B |
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.8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (73ms) : 71, 76
. : milestone, 73,
master - mean (71ms) : 70, 73
. : milestone, 71,
section Baseline
This PR (7620) - mean (69ms) : 66, 72
. : milestone, 69,
master - mean (68ms) : 66, 69
. : milestone, 68,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (1,055ms) : 1004, 1107
. : milestone, 1055,
master - mean (1,044ms) : 992, 1095
. : milestone, 1044,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (109ms) : 107, 111
. : milestone, 109,
master - mean (106ms) : 105, 107
. : milestone, 106,
section Baseline
This PR (7620) - mean (108ms) : 104, 111
. : milestone, 108,
master - mean (105ms) : 103, 108
. : milestone, 105,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (755ms) : 720, 789
. : milestone, 755,
master - mean (747ms) : 724, 770
. : milestone, 747,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (96ms) : 93, 98
. : milestone, 96,
master - mean (94ms) : 93, 95
. : milestone, 94,
section Baseline
This PR (7620) - mean (96ms) : 93, 98
. : milestone, 96,
master - mean (93ms) : 91, 95
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (712ms) : 676, 748
. : milestone, 712,
master - mean (704ms) : 676, 733
. : milestone, 704,
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (94ms) : 92, 96
. : milestone, 94,
master - mean (92ms) : 91, 94
. : milestone, 92,
section Baseline
This PR (7620) - mean (94ms) : 91, 97
. : milestone, 94,
master - mean (91ms) : 89, 93
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (668ms) : 651, 685
. : milestone, 668,
master - mean (664ms) : 650, 678
. : milestone, 664,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (195ms) : 192, 198
. : milestone, 195,
master - mean (195ms) : 192, 198
. : milestone, 195,
section Baseline
This PR (7620) - mean (192ms) : 189, 196
. : milestone, 192,
master - mean (192ms) : 187, 197
. : milestone, 192,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (1,162ms) : 1105, 1219
. : milestone, 1162,
master - mean (1,151ms) : 1104, 1198
. : milestone, 1151,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (275ms) : 272, 278
. : milestone, 275,
master - mean (275ms) : 270, 279
. : milestone, 275,
section Baseline
This PR (7620) - mean (275ms) : 270, 280
. : milestone, 275,
master - mean (274ms) : 270, 278
. : milestone, 274,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (944ms) : 900, 987
. : milestone, 944,
master - mean (938ms) : 891, 985
. : milestone, 938,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (267ms) : 264, 270
. : milestone, 267,
master - mean (267ms) : 263, 272
. : milestone, 267,
section Baseline
This PR (7620) - mean (268ms) : 263, 274
. : milestone, 268,
master - mean (267ms) : 263, 270
. : milestone, 267,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (922ms) : 866, 977
. : milestone, 922,
master - mean (924ms) : 876, 972
. : milestone, 924,
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat X
axisFormat %s
todayMarker off
section Bailout
This PR (7620) - mean (267ms) : 262, 271
. : milestone, 267,
master - mean (265ms) : 262, 269
. : milestone, 265,
section Baseline
This PR (7620) - mean (267ms) : 261, 272
. : milestone, 267,
master - mean (266ms) : 261, 270
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (7620) - mean (849ms) : 832, 866
. : milestone, 849,
master - mean (850ms) : 833, 866
. : milestone, 850,
|
duncanpharvey
left a comment
There was a problem hiding this comment.
LGTM! Just one question - will spans be generated for EventHubBufferedProducerClient.EnqueueEventAsync? It looks like this is another option users have to send events
Yes! Being tested in TestEventHubsBufferedProducerAsync, it is actually how you use the buffered client. No specific instrumentation needed, it uses the non-buffered producer internally. |
9238498 to
3d0e858
Compare
#7810) ## Summary of changes Fixes `InvalidOperationException` in baggage handling ## Reason for change #7620 added support for event hubs to Azure Functions, but [we've subsequently seen errors related to baggage](https://app.datadoghq.com/error-tracking/issue/a0cbfac8-b924-11f0-a50e-da7ad0900002?query=source%3Adotnet%20%40tracer_version%3A3.30.0.0%20service%3Ainstrumentation-telemetry-data%20-%40error.is_crash%3Atrue&index=&tb=org_id%2C%40rc-client.tracer_version%2C%40org_id&from_ts=1761842690105&to_ts=1763052290105&live=true): ``` Error : Error creating or populating scope. System.InvalidOperationException at Datadog.Trace.Baggage.MergeInto(Baggage destination) at Datadog.Trace.ClrProfiler.AutoInstrumentation.Azure.Functions.AzureFunctionsCommon.CreateIsolatedFunctionScope[T](Tracer tracer, T context) ``` We can reproduce this if you pass the same baggage instance to itself in `MergeInto`, so we guard against that here. > _Why_ are we merging baggage into ourself, you may well ask. Good question... I haven't investigated... that's a problem for @pablomartinezbernardo and @lucaspimentel 😄 ## Implementation details Check that you're not merging into yourself ## Test coverage Added a unit test, confirmed it repros, then fixed it
Summary of changes
New integration for Azure Event Hubs configurable by:
DD_TRACE_AZUREEVENTHUBS_ENABLED(defaulttrue) enables/disables the integrationDD_TRACE_AZURE_EVENTHUBS_BATCH_LINKS_ENABLED(defaulttrue) enables/disables Span Linking andTryAddspansIntegration points
Azure.Messaging.EventHubs.Producer.EventDataBatch.TryAddthat adds anEventDatato a batch. Creates a span and stores context.Azure.Messaging.EventHubs.Producer.EventHubProducerClient.SendAsync(EventDataBatch)sends a batch. Creates a span extracting context for Span Links.Azure.Messaging.EventHubs.Producer.EventHubProducerClient.SendAsync(IEnumerable<EventData>)sends a collection ofEventData. Creates a span.Azure.Core.Shared.MessagingClientDiagnostics.InstrumentMessage(In theAzure.Messaging.EventHubsassembly) function to instrument specific messages. Adds context to messages.Azure.Messaging.EventHubs.Amqp.AmqpConsumer.ReceiveAsyncreceives all messages, single entry point for all reception. Creates span and links.Test coverage
Integration tests
Other details
Some refactoring has been made to the Service Bus integration to better reuse components. I also added previously missing calls to
IntegrationGeneratedSpanin Service Bus. Unlike the previous Service Bus PRs, these are all changes in a single PR.