Skip to content

Conversation

@pablomartinezbernardo
Copy link
Contributor

@pablomartinezbernardo pablomartinezbernardo commented Nov 14, 2025

Summary of changes

Respect baggage in Azure messaging instrumentations. Related to #7810

Reason for change

Baggage was not being extracted from headers

Implementation details

Test coverage

Unit test AzureFunctionsCommon.ExtractPropagatedContextFromMessaging with baggage merging. CreateIsolatedFunctionScope would have been more complex to test.

Other details

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Nov 14, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7818) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration74.95 ± (74.69 - 75.31) ms76.54 ± (76.27 - 76.95) ms+2.1%✅⬆️
.NET Framework 4.8 - Bailout
duration79.93 ± (79.78 - 80.34) ms79.27 ± (79.23 - 79.92) ms-0.8%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1129.37 ± (1133.11 - 1145.23) ms1108.94 ± (1115.86 - 1127.67) ms-1.8%
.NET Core 3.1 - Baseline
process.internal_duration_ms23.04 ± (22.95 - 23.14) ms23.11 ± (23.01 - 23.21) ms+0.3%✅⬆️
process.time_to_main_ms87.98 ± (87.60 - 88.35) ms87.57 ± (87.19 - 87.96) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.93) MB10.93 ± (10.93 - 10.94) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms23.05 ± (22.97 - 23.14) ms22.98 ± (22.91 - 23.04) ms-0.3%
process.time_to_main_ms90.14 ± (89.72 - 90.55) ms89.78 ± (89.41 - 90.15) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.98 ± (10.97 - 10.98) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms219.36 ± (218.06 - 220.66) ms218.67 ± (217.21 - 220.13) ms-0.3%
process.time_to_main_ms550.29 ± (549.24 - 551.34) ms546.41 ± (545.29 - 547.52) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.65 ± (52.63 - 52.67) MB52.48 ± (52.47 - 52.50) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.69 ± (21.62 - 21.76) ms21.84 ± (21.77 - 21.91) ms+0.7%✅⬆️
process.time_to_main_ms76.82 ± (76.43 - 77.21) ms76.43 ± (76.11 - 76.75) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.62) MB10.63 ± (10.63 - 10.63) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.73 ± (21.65 - 21.80) ms21.51 ± (21.44 - 21.57) ms-1.0%
process.time_to_main_ms76.96 ± (76.63 - 77.29) ms76.79 ± (76.43 - 77.16) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.67) MB10.66 ± (10.66 - 10.67) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms207.78 ± (206.31 - 209.25) ms206.83 ± (205.58 - 208.08) ms-0.5%
process.time_to_main_ms516.85 ± (515.83 - 517.87) ms511.60 ± (510.61 - 512.60) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.73 ± (51.71 - 51.75) MB51.62 ± (51.58 - 51.65) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.89 ± (19.83 - 19.94) ms20.02 ± (19.95 - 20.09) ms+0.7%✅⬆️
process.time_to_main_ms75.00 ± (74.64 - 75.35) ms75.03 ± (74.66 - 75.40) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.66 ± (7.65 - 7.66) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.88 ± (19.83 - 19.94) ms19.91 ± (19.85 - 19.97) ms+0.1%✅⬆️
process.time_to_main_ms76.46 ± (76.17 - 76.74) ms75.53 ± (75.24 - 75.83) ms-1.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.71 - 7.72) MB7.72 ± (7.71 - 7.73) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms193.06 ± (192.09 - 194.03) ms194.06 ± (193.04 - 195.09) ms+0.5%✅⬆️
process.time_to_main_ms498.27 ± (497.40 - 499.15) ms489.24 ± (488.07 - 490.40) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed39.02 ± (38.97 - 39.06) MB38.93 ± (38.89 - 38.98) MB-0.2%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.1%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.63 ± (192.40 - 193.11) ms191.96 ± (191.86 - 192.66) ms-0.3%
.NET Framework 4.8 - Bailout
duration195.63 ± (195.49 - 196.17) ms195.89 ± (195.52 - 196.03) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1166.42 ± (1173.09 - 1183.28) ms1165.25 ± (1169.44 - 1178.32) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms188.56 ± (188.17 - 188.94) ms188.55 ± (188.13 - 188.97) ms-0.0%
process.time_to_main_ms80.70 ± (80.47 - 80.94) ms80.95 ± (80.72 - 81.17) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.06 ± (16.03 - 16.09) MB16.17 ± (16.14 - 16.20) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.7%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.54 ± (187.27 - 187.80) ms187.34 ± (187.01 - 187.68) ms-0.1%
process.time_to_main_ms81.80 ± (81.68 - 81.93) ms81.64 ± (81.50 - 81.79) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.12 - 16.18) MB16.20 ± (16.18 - 16.23) MB+0.3%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.5%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms392.08 ± (389.62 - 394.55) ms390.85 ± (388.61 - 393.09) ms-0.3%
process.time_to_main_ms518.56 ± (517.86 - 519.26) ms514.07 ± (513.44 - 514.69) ms-0.9%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.62 ± (62.46 - 62.77) MB62.59 ± (62.43 - 62.76) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.10 ± (191.64 - 192.56) ms191.93 ± (191.55 - 192.31) ms-0.1%
process.time_to_main_ms70.05 ± (69.87 - 70.23) ms69.74 ± (69.52 - 69.97) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.04 - 16.28) MB16.14 ± (16.00 - 16.29) MB-0.1%
runtime.dotnet.threads.count18 ± (18 - 19)18 ± (18 - 18)-0.8%
.NET 6 - Bailout
process.internal_duration_ms190.48 ± (190.23 - 190.72) ms190.65 ± (190.27 - 191.02) ms+0.1%✅⬆️
process.time_to_main_ms70.50 ± (70.42 - 70.57) ms70.47 ± (70.36 - 70.57) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.07 ± (15.92 - 16.22) MB16.25 ± (16.11 - 16.39) MB+1.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.7%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms413.47 ± (410.35 - 416.59) ms412.07 ± (408.95 - 415.20) ms-0.3%
process.time_to_main_ms487.92 ± (487.33 - 488.51) ms482.23 ± (481.60 - 482.87) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.26 ± (62.12 - 62.40) MB62.03 ± (61.89 - 62.18) MB-0.4%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.17 ± (189.77 - 190.56) ms190.29 ± (189.90 - 190.68) ms+0.1%✅⬆️
process.time_to_main_ms69.29 ± (69.09 - 69.49) ms69.57 ± (69.36 - 69.78) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.79 ± (11.76 - 11.82) MB11.73 ± (11.70 - 11.76) MB-0.5%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.1%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms188.88 ± (188.66 - 189.11) ms189.13 ± (188.84 - 189.42) ms+0.1%✅⬆️
process.time_to_main_ms70.02 ± (69.92 - 70.11) ms70.20 ± (70.09 - 70.31) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.67 - 11.86) MB11.76 ± (11.68 - 11.84) MB-0.1%
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (18 - 19)+0.7%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms364.19 ± (362.95 - 365.44) ms361.12 ± (359.78 - 362.46) ms-0.8%
process.time_to_main_ms468.03 ± (467.34 - 468.72) ms458.69 ± (458.08 - 459.31) ms-2.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.49 ± (50.46 - 50.52) MB50.33 ± (50.29 - 50.37) MB-0.3%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.2%
Comparison explanation

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 highlighted in **red**. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (77ms)  : 72, 81
    master - mean (75ms)  : 70, 80

    section Bailout
    This PR (7818) - mean (80ms)  : 74, 85
    master - mean (80ms)  : 76, 84

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (1,122ms)  : 1032, 1211
    master - mean (1,139ms)  : 1051, 1228

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (118ms)  : 111, 125
    master - mean (119ms)  : 112, 125

    section Bailout
    This PR (7818) - mean (120ms)  : 114, 126
    master - mean (121ms)  : 112, 130

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (802ms)  : 764, 840
    master - mean (808ms)  : 772, 845

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (105ms)  : 99, 112
    master - mean (105ms)  : 99, 112

    section Bailout
    This PR (7818) - mean (106ms)  : 98, 114
    master - mean (106ms)  : 99, 112

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (751ms)  : 712, 790
    master - mean (757ms)  : 716, 798

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (104ms)  : 95, 112
    master - mean (103ms)  : 97, 109

    section Bailout
    This PR (7818) - mean (104ms)  : 98, 109
    master - mean (105ms)  : 100, 110

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (718ms)  : 684, 752
    master - mean (732ms)  : 698, 766

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (192ms)  : 188, 196
    master - mean (193ms)  : 189, 197

    section Bailout
    This PR (7818) - mean (196ms)  : 193, 198
    master - mean (196ms)  : 192, 199

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (1,174ms)  : 1110, 1238
    master - mean (1,178ms)  : 1106, 1250

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (278ms)  : 272, 283
    master - mean (277ms)  : 271, 283

    section Bailout
    This PR (7818) - mean (277ms)  : 273, 282
    master - mean (277ms)  : 274, 280

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (935ms)  : 896, 975
    master - mean (941ms)  : 900, 982

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (270ms)  : 265, 275
    master - mean (270ms)  : 264, 277

    section Bailout
    This PR (7818) - mean (269ms)  : 265, 273
    master - mean (269ms)  : 266, 272

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (926ms)  : 867, 986
    master - mean (931ms)  : 884, 977

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7818) - mean (269ms)  : 264, 274
    master - mean (269ms)  : 264, 275

    section Bailout
    This PR (7818) - mean (269ms)  : 265, 273
    master - mean (268ms)  : 266, 271

    section CallTarget+Inlining+NGEN
    This PR (7818) - mean (851ms)  : 828, 875
    master - mean (864ms)  : 833, 894

Loading

@pablomartinezbernardo pablomartinezbernardo marked this pull request as ready for review November 14, 2025 13:50
@pr-commenter
Copy link

pr-commenter bot commented Nov 14, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7818 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.450
  • 1 benchmarks are slower, with geometric mean 2.428
  • 6 benchmarks have fewer allocations
  • 4 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.3μs 57.8ns 374ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 13.4μs 71.1ns 355ns 0 0 0 5.7 KB
master StartStopWithChild net472 22μs 119ns 662ns 0.999 0.333 0.111 6.06 KB
#7818 StartStopWithChild net6.0 10.5μs 57.7ns 327ns 0 0 0 5.52 KB
#7818 StartStopWithChild netcoreapp3.1 13.5μs 71ns 341ns 0 0 0 5.7 KB
#7818 StartStopWithChild net472 22.4μs 123ns 778ns 1.06 0.317 0.106 6.06 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 925μs 551ns 2.13μs 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 82.4ns 297ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.21ms 568ns 2.2μs 0 0 0 3.31 KB
#7818 WriteAndFlushEnrichedTraces net6.0 930μs 53.3ns 192ns 0 0 0 2.7 KB
#7818 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 155ns 579ns 0 0 0 2.7 KB
#7818 WriteAndFlushEnrichedTraces net472 1.21ms 629ns 2.36μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.1μs 5.93ns 35.1ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.4μs 7.78ns 51ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.03μs 0.335ns 1.25ns 0.191 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.99μs 38.8ns 233ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.04μs 2.5ns 9.69ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.57μs 3.17ns 12.3ns 0.72 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 318ns 1.63ns 7.63ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 395ns 2.25ns 14.7ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 296ns 0.0704ns 0.264ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.33μs 28.5ns 110ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.75μs 39ns 165ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.73μs 4.41ns 17.1ns 0.574 0 0 3.8 KB
#7818 AllCycleSimpleBody net6.0 1.08μs 2.71ns 10.5ns 0 0 0 1.22 KB
#7818 AllCycleSimpleBody netcoreapp3.1 1.4μs 7.86ns 52.1ns 0 0 0 1.2 KB
#7818 AllCycleSimpleBody net472 1.03μs 0.493ns 1.85ns 0.195 0 0 1.23 KB
#7818 AllCycleMoreComplexBody net6.0 7.12μs 9.88ns 38.3ns 0 0 0 4.72 KB
#7818 AllCycleMoreComplexBody netcoreapp3.1 9.14μs 3.87ns 14.5ns 0 0 0 4.62 KB
#7818 AllCycleMoreComplexBody net472 7.62μs 2.99ns 11.6ns 0.724 0 0 4.74 KB
#7818 ObjectExtractorSimpleBody net6.0 324ns 0.108ns 0.42ns 0 0 0 280 B
#7818 ObjectExtractorSimpleBody netcoreapp3.1 407ns 2.2ns 12.3ns 0 0 0 272 B
#7818 ObjectExtractorSimpleBody net472 304ns 0.12ns 0.465ns 0.0445 0 0 281 B
#7818 ObjectExtractorMoreComplexBody net6.0 6.28μs 2.12ns 8.23ns 0 0 0 3.78 KB
#7818 ObjectExtractorMoreComplexBody netcoreapp3.1 7.88μs 38ns 147ns 0 0 0 3.69 KB
#7818 ObjectExtractorMoreComplexBody net472 6.82μs 1.55ns 5.58ns 0.577 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.4μs 52.1ns 195ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 99.2μs 105ns 394ns 0 0 0 32.4 KB
master EncodeArgs net472 113μs 138ns 536ns 5.1 0 0 32.5 KB
master EncodeLegacyArgs net6.0 143μs 11.2ns 38.7ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 200μs 53.2ns 184ns 0 0 0 2.15 KB
master EncodeLegacyArgs net472 263μs 62.9ns 243ns 0 0 0 2.16 KB
#7818 EncodeArgs net6.0 76.7μs 356ns 1.33μs 0 0 0 32.4 KB
#7818 EncodeArgs netcoreapp3.1 97μs 205ns 792ns 0 0 0 32.4 KB
#7818 EncodeArgs net472 110μs 11.5ns 43ns 4.96 0 0 32.51 KB
#7818 EncodeLegacyArgs net6.0 148μs 180ns 697ns 0 0 0 2.15 KB
#7818 EncodeLegacyArgs netcoreapp3.1 197μs 205ns 793ns 0 0 0 2.14 KB
#7818 EncodeLegacyArgs net472 264μs 22.6ns 87.6ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7818

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.428 296,614.39 720,112.50

Faster 🎉 in #7818

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.103 861,943.85 409,808.37

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 398μs 61.7ns 231ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 845μs 5.8μs 58μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 428μs 49.1ns 190ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 283μs 49.3ns 191ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 297μs 239ns 924ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 311μs 33ns 128ns 0 0 0 2.29 KB
#7818 RunWafRealisticBenchmark net6.0 396μs 43.6ns 169ns 0 0 0 4.55 KB
#7818 RunWafRealisticBenchmark netcoreapp3.1 410μs 81ns 303ns 0 0 0 4.48 KB
#7818 RunWafRealisticBenchmark net472 428μs 66.8ns 259ns 0 0 0 4.66 KB
#7818 RunWafRealisticBenchmarkWithAttack net6.0 284μs 39.2ns 152ns 0 0 0 2.24 KB
#7818 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 679μs 12.3μs 123μs 0 0 0 2.22 KB
#7818 RunWafRealisticBenchmarkWithAttack net472 315μs 20.2ns 78.2ns 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 60.9μs 285ns 1.07μs 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.8μs 255ns 1.37μs 0 0 0 17.42 KB
master SendRequest net472 0.00399ns 0.00239ns 0.00893ns 0 0 0 0 b
#7818 SendRequest net6.0 61.9μs 53.8ns 208ns 0 0 0 14.52 KB
#7818 SendRequest netcoreapp3.1 72.6μs 331ns 1.28μs 0 0 0 17.42 KB
#7818 SendRequest net472 0.00143ns 0.000733ns 0.00284ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7818

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 0 b 73 B 73 B
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 0 b 1 B 1 B
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 0 b 47 B 47 B
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 3 B 5 B 2 B 66.67%

Fewer allocations 🎉 in #7818

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 7 B 4 B -3 B -42.86%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.93ms 5.6μs 21.7μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.1ms 1.22μs 4.73μs 0 0 0 640 KB
master OriginalCharSlice net472 2.56ms 420ns 1.51μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.4ms 219ns 849ns 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.67ms 334ns 1.25μs 0 0 0 1 B
master OptimizedCharSlice net472 1.95ms 531ns 2.06μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 864μs 29.9ns 112ns 0 0 0 3 B
master OptimizedCharSliceWithPool netcoreapp3.1 797μs 76.4ns 296ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.15ms 147ns 568ns 0 0 0 0 b
#7818 OriginalCharSlice net6.0 1.94ms 532ns 1.99μs 0 0 0 640 KB
#7818 OriginalCharSlice netcoreapp3.1 2.09ms 6.5μs 22.5μs 0 0 0 640 KB
#7818 OriginalCharSlice net472 2.64ms 192ns 745ns 100 0 0 641.95 KB
#7818 OptimizedCharSlice net6.0 1.41ms 284ns 1.1μs 0 0 0 4 B
#7818 OptimizedCharSlice netcoreapp3.1 1.75ms 7.4μs 28.7μs 0 0 0 1 B
#7818 OptimizedCharSlice net472 1.98ms 242ns 938ns 0 0 0 73 B
#7818 OptimizedCharSliceWithPool net6.0 800μs 43.5ns 169ns 0 0 0 5 B
#7818 OptimizedCharSliceWithPool netcoreapp3.1 805μs 58.6ns 227ns 0 0 0 1 B
#7818 OptimizedCharSliceWithPool net472 1.13ms 108ns 404ns 0 0 0 47 B
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 Fewer allocations 🎉

Faster 🎉 in #7818

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.218 853,658.55 700,942.63 bimodal
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 1.191 1,010,006.04 847,976.67

Fewer allocations 🎉 in #7818

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.73 KB 56.42 KB -307 B -0.54%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 650μs 963ns 3.73μs 0 0 0 41.69 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 828μs 4.8μs 39.5μs 0 0 0 42.13 KB
master WriteAndFlushEnrichedTraces net472 1.01ms 5.15μs 24.2μs 8.33 0 0 56.73 KB
#7818 WriteAndFlushEnrichedTraces net6.0 672μs 1.11μs 4.31μs 0 0 0 41.76 KB
#7818 WriteAndFlushEnrichedTraces netcoreapp3.1 708μs 4.07μs 34.6μs 0 0 0 42.28 KB
#7818 WriteAndFlushEnrichedTraces net472 849μs 2.53μs 9.47μs 8.33 0 0 56.42 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.9μs 7.13ns 26.7ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.63μs 9.29ns 36ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.86μs 4.11ns 15.4ns 0.154 0.014 0 987 B
#7818 ExecuteNonQuery net6.0 1.9μs 2.27ns 8.81ns 0 0 0 1.02 KB
#7818 ExecuteNonQuery netcoreapp3.1 2.57μs 9.92ns 38.4ns 0 0 0 1.02 KB
#7818 ExecuteNonQuery net472 2.9μs 15.4ns 80.1ns 0.154 0 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.7μs 8.37ns 35.5ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.3μs 10.7ns 42.7ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.5μs 2.92ns 10.9ns 0.157 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.88μs 3.46ns 12.5ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.38μs 9.31ns 36ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.69μs 4.1ns 15.9ns 0.166 0 0 1.1 KB
#7818 CallElasticsearch net6.0 1.72μs 7.29ns 29.2ns 0 0 0 1.03 KB
#7818 CallElasticsearch netcoreapp3.1 2.31μs 9.28ns 34.7ns 0 0 0 1.03 KB
#7818 CallElasticsearch net472 3.44μs 1.45ns 5.21ns 0.155 0 0 1.04 KB
#7818 CallElasticsearchAsync net6.0 1.89μs 10ns 50.2ns 0 0 0 1.01 KB
#7818 CallElasticsearchAsync netcoreapp3.1 2.45μs 11.8ns 45.8ns 0 0 0 1.08 KB
#7818 CallElasticsearchAsync net472 3.58μs 1.73ns 6.49ns 0.161 0 0 1.1 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.97μs 1.76ns 6.83ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.55μs 12.5ns 49.9ns 0 0 0 952 B
master ExecuteAsync net472 2.65μs 2.67ns 10.3ns 0.133 0 0 915 B
#7818 ExecuteAsync net6.0 1.84μs 5.86ns 22.7ns 0 0 0 952 B
#7818 ExecuteAsync netcoreapp3.1 2.45μs 7.08ns 27.4ns 0 0 0 952 B
#7818 ExecuteAsync net472 2.6μs 5.34ns 20.7ns 0.143 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.78μs 8.74ns 31.5ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.81μs 26.5ns 103ns 0 0 0 2.9 KB
master SendAsync net472 12.3μs 11.9ns 46.2ns 0.495 0 0 3.18 KB
#7818 SendAsync net6.0 6.86μs 6.76ns 24.4ns 0 0 0 2.36 KB
#7818 SendAsync netcoreapp3.1 8.5μs 20.1ns 78ns 0 0 0 2.9 KB
#7818 SendAsync net472 12μs 15.5ns 60.2ns 0.482 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7818

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.43 KB 43.94 KB -496 B -1.12%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 282.21 KB 278.53 KB -3.68 KB -1.30%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 261.47 KB 252.21 KB -9.26 KB -3.54%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 272.87 KB 256.58 KB -16.29 KB -5.97%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 43.9μs 240ns 1.25μs 0 0 0 44.43 KB
master StringConcatBenchmark netcoreapp3.1 47.2μs 262ns 1.57μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 56.9μs 137ns 493ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 471μs 1.48μs 5.33μs 0 0 0 261.47 KB
master StringConcatAspectBenchmark netcoreapp3.1 524μs 914ns 3.16μs 0 0 0 272.87 KB
master StringConcatAspectBenchmark net472 411μs 2.34μs 16.6μs 0 0 0 282.21 KB
#7818 StringConcatBenchmark net6.0 42.4μs 216ns 944ns 0 0 0 43.94 KB
#7818 StringConcatBenchmark netcoreapp3.1 49.8μs 294ns 2.68μs 0 0 0 42.8 KB
#7818 StringConcatBenchmark net472 57.3μs 75.7ns 262ns 0 0 0 65.54 KB
#7818 StringConcatAspectBenchmark net6.0 454μs 2.05μs 7.39μs 0 0 0 252.21 KB
#7818 StringConcatAspectBenchmark netcoreapp3.1 512μs 1.87μs 6.74μs 0 0 0 256.58 KB
#7818 StringConcatAspectBenchmark net472 409μs 2.25μs 14.1μ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.63μs 12.2ns 45.8ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.76μs 13.5ns 52.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.85μs 4.39ns 17ns 0.25 0 0 1.64 KB
#7818 EnrichedLog net6.0 2.62μs 12.4ns 49.5ns 0 0 0 1.7 KB
#7818 EnrichedLog netcoreapp3.1 3.6μs 12.4ns 48ns 0 0 0 1.7 KB
#7818 EnrichedLog net472 3.88μs 2.4ns 8.3ns 0.248 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 380ns 1.42μs 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 132μs 284ns 1.1μs 0 0 0 4.31 KB
master EnrichedLog net472 174μs 203ns 786ns 0 0 0 4.52 KB
#7818 EnrichedLog net6.0 123μs 132ns 510ns 0 0 0 4.31 KB
#7818 EnrichedLog netcoreapp3.1 130μs 200ns 748ns 0 0 0 4.31 KB
#7818 EnrichedLog net472 167μs 84.1ns 326ns 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 5.1μs 3.7ns 13.8ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.77μs 6.86ns 25.7ns 0 0 0 2.26 KB
master EnrichedLog net472 7.46μs 9.23ns 35.7ns 0.296 0 0 2.08 KB
#7818 EnrichedLog net6.0 5.12μs 11.2ns 41.9ns 0 0 0 2.26 KB
#7818 EnrichedLog netcoreapp3.1 6.83μs 33.3ns 141ns 0 0 0 2.26 KB
#7818 EnrichedLog net472 7.71μs 5.36ns 20.1ns 0.305 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 2.02μs 9.03ns 35ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.58μs 8.73ns 33.8ns 0 0 0 1.2 KB
master SendReceive net472 3.01μs 1.76ns 6.83ns 0.18 0 0 1.2 KB
#7818 SendReceive net6.0 2.07μs 8.69ns 33.6ns 0 0 0 1.2 KB
#7818 SendReceive netcoreapp3.1 2.52μs 11.8ns 45.7ns 0 0 0 1.2 KB
#7818 SendReceive net472 3.05μs 4.21ns 16.3ns 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.24μs 6.49ns 25.1ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.69μs 12ns 45ns 0 0 0 1.63 KB
master EnrichedLog net472 6.63μs 5.88ns 22ns 0.3 0 0 2.03 KB
#7818 EnrichedLog net6.0 4.36μs 15.4ns 53.3ns 0 0 0 1.58 KB
#7818 EnrichedLog netcoreapp3.1 5.59μs 9.15ns 31.7ns 0 0 0 1.63 KB
#7818 EnrichedLog net472 6.68μs 8.18ns 30.6ns 0.302 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 768ns 3.75ns 15ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 1μs 0.358ns 1.39ns 0 0 0 576 B
master StartFinishSpan net472 950ns 0.3ns 1.12ns 0.0902 0 0 578 B
master StartFinishScope net6.0 917ns 4.94ns 25.7ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.19μs 6.5ns 39ns 0 0 0 696 B
master StartFinishScope net472 1.15μs 0.488ns 1.89ns 0.104 0 0 658 B
#7818 StartFinishSpan net6.0 781ns 0.342ns 1.23ns 0 0 0 576 B
#7818 StartFinishSpan netcoreapp3.1 977ns 4.68ns 19.3ns 0 0 0 576 B
#7818 StartFinishSpan net472 956ns 0.714ns 2.57ns 0.0907 0 0 578 B
#7818 StartFinishScope net6.0 976ns 4.76ns 19ns 0 0 0 696 B
#7818 StartFinishScope netcoreapp3.1 1.19μs 6.08ns 29.2ns 0 0 0 696 B
#7818 StartFinishScope net472 1.15μs 0.378ns 1.41ns 0.103 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.08μs 0.711ns 2.66ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.42μs 7.38ns 35.4ns 0 0 0 697 B
master RunOnMethodBegin net472 1.47μs 0.948ns 3.42ns 0.103 0 0 658 B
#7818 RunOnMethodBegin net6.0 1.06μs 3.39ns 13.1ns 0 0 0 696 B
#7818 RunOnMethodBegin netcoreapp3.1 1.45μs 7.19ns 31.3ns 0 0 0 696 B
#7818 RunOnMethodBegin net472 1.43μs 0.537ns 1.94ns 0.0998 0 0 658 B

Comment on lines -411 to +413
return new PropagationContext(spanContexts[0], Baggage.Current, null);
return extractedContexts[0];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually the bug resulting in Baggage.Current merging into itself

Copy link
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pablomartinezbernardo pablomartinezbernardo merged commit 60661e9 into master Nov 18, 2025
156 checks passed
@pablomartinezbernardo pablomartinezbernardo deleted the pmartinez/respect-baggage branch November 18, 2025 10:36
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants