Skip to content

Conversation

@rithikanarayan
Copy link

@rithikanarayan rithikanarayan commented Oct 31, 2025

Summary of changes

  • Removed classes Aws{Service}V1Tags (such as AWSS3V1Tags) from Datadog.Trace.Tagging.
  • Removed accompanying usages of the classes in MessagingSchema and unit tests.
  • Added PeerService and PeerServiceSource tags to AwsSDKTags.
  • Deletion of Aws{Service}V1 snapshots and removal of V1 schema from Aws managed service integration tests

Reason for change

Cleanup of unused V1 code. Preparation for follow up PR addressing Serverless Service Representation for AWS Managed Services, which requires the V0 schema for these services to have access to the peer service and peer service source tags to hardcode their values in serverless environments.

Implementation details

  • Added PeerService and PeerServiceSource tags in Datadog.Trace/src/Datadog.Trace/Tagging/AwsSdkTags.cs
  • Removed classes AwsEventBridgeV1Tags, AwsKinesisV1Tags, AwsS3V1Tags, AwsSnsV1Tags, AwsSqsV1Tags, AwsStepFunctionsV1Tags.
  • Edited MessagingSchema and DatabaseSchema to not use the deleted classes in the CreateAws{Service}Tags() functions
  • Did same as above for MessagingSchema unit tests
  • Deleted V1 snapshots and any uses of V1 in the integration tests for AWS managed services.

Test coverage

Other details

@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Oct 31, 2025
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Oct 31, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7746) 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
duration68.96 ± (68.91 - 69.22) ms70.75 ± (70.62 - 71.19) ms+2.6%✅⬆️
.NET Framework 4.8 - Bailout
duration72.19 ± (72.28 - 72.57) ms75.66 ± (75.53 - 75.91) ms+4.8%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1047.28 ± (1050.52 - 1059.02) ms1069.64 ± (1077.12 - 1089.68) ms+2.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.97 ± (21.94 - 22.00) ms22.12 ± (22.09 - 22.15) ms+0.7%✅⬆️
process.time_to_main_ms79.69 ± (79.52 - 79.86) ms80.12 ± (79.96 - 80.27) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.87 ± (10.86 - 10.87) MB10.87 ± (10.87 - 10.88) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.95 ± (21.93 - 21.97) ms22.12 ± (22.09 - 22.15) ms+0.8%✅⬆️
process.time_to_main_ms80.94 ± (80.74 - 81.14) ms82.04 ± (81.86 - 82.23) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.92 ± (10.92 - 10.93) MB+0.2%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms210.86 ± (209.56 - 212.16) ms212.88 ± (211.56 - 214.20) ms+1.0%✅⬆️
process.time_to_main_ms519.36 ± (518.80 - 519.91) ms522.08 ± (521.23 - 522.94) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.62 ± (52.60 - 52.64) MB52.44 ± (52.42 - 52.46) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms20.77 ± (20.74 - 20.80) ms21.04 ± (21.00 - 21.09) ms+1.3%✅⬆️
process.time_to_main_ms69.11 ± (68.95 - 69.26) ms70.88 ± (70.71 - 71.04) ms+2.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.57 ± (10.57 - 10.57) MB10.61 ± (10.60 - 10.61) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.81 ± (20.78 - 20.85) ms21.08 ± (21.03 - 21.13) ms+1.3%✅⬆️
process.time_to_main_ms70.32 ± (70.18 - 70.47) ms72.53 ± (72.30 - 72.76) ms+3.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.63) MB10.64 ± (10.63 - 10.64) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms201.82 ± (199.42 - 204.23) ms205.17 ± (202.60 - 207.74) ms+1.7%✅⬆️
process.time_to_main_ms488.59 ± (488.00 - 489.17) ms489.05 ± (488.27 - 489.82) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.43 ± (51.36 - 51.51) MB51.56 ± (51.51 - 51.61) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.02 ± (18.98 - 19.05) ms19.28 ± (19.24 - 19.33) ms+1.4%✅⬆️
process.time_to_main_ms68.48 ± (68.34 - 68.63) ms71.07 ± (70.83 - 71.32) ms+3.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.63 ± (7.62 - 7.64) MB7.60 ± (7.60 - 7.61) MB-0.4%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.97 ± (18.95 - 18.99) ms19.35 ± (19.31 - 19.39) ms+2.0%✅⬆️
process.time_to_main_ms69.35 ± (69.23 - 69.48) ms72.90 ± (72.68 - 73.11) ms+5.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.68) MB7.67 ± (7.66 - 7.68) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.02 ± (177.09 - 178.95) ms184.62 ± (183.53 - 185.70) ms+3.7%✅⬆️
process.time_to_main_ms462.25 ± (461.61 - 462.88) ms472.12 ± (471.13 - 473.10) ms+2.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.76 ± (38.73 - 38.79) MB38.58 ± (38.55 - 38.62) MB-0.5%
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.17 ± (192.07 - 192.69) ms192.37 ± (192.13 - 192.84) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration195.56 ± (195.46 - 196.08) ms195.78 ± (195.61 - 196.13) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1156.85 ± (1159.66 - 1168.27) ms1153.51 ± (1161.81 - 1172.56) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms187.82 ± (187.46 - 188.17) ms188.24 ± (187.82 - 188.67) ms+0.2%✅⬆️
process.time_to_main_ms80.54 ± (80.37 - 80.71) ms80.74 ± (80.51 - 80.97) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.16) MB16.12 ± (16.09 - 16.15) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.4%
.NET Core 3.1 - Bailout
process.internal_duration_ms186.81 ± (186.48 - 187.14) ms189.52 ± (189.08 - 189.96) ms+1.5%✅⬆️
process.time_to_main_ms81.89 ± (81.73 - 82.04) ms82.58 ± (82.39 - 82.77) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.18) MB16.15 ± (16.13 - 16.18) MB-0.0%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.4%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms396.14 ± (393.84 - 398.43) ms397.36 ± (394.87 - 399.86) ms+0.3%✅⬆️
process.time_to_main_ms521.90 ± (520.88 - 522.92) ms517.89 ± (517.14 - 518.65) ms-0.8%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.20 ± (63.05 - 63.34) MB63.05 ± (62.90 - 63.20) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.32 ± (190.95 - 191.69) ms193.52 ± (193.08 - 193.96) ms+1.2%✅⬆️
process.time_to_main_ms69.47 ± (69.33 - 69.61) ms70.45 ± (70.27 - 70.63) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.25 - 16.41) MB16.28 ± (16.24 - 16.32) MB-0.3%
runtime.dotnet.threads.count18 ± (18 - 19)19 ± (19 - 19)+2.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms190.59 ± (190.29 - 190.90) ms192.41 ± (192.11 - 192.71) ms+1.0%✅⬆️
process.time_to_main_ms70.48 ± (70.38 - 70.58) ms71.13 ± (71.01 - 71.26) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.03 - 16.32) MB16.08 ± (15.93 - 16.22) MB-0.6%
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (19 - 20)+2.4%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms411.81 ± (408.89 - 414.73) ms414.36 ± (411.30 - 417.43) ms+0.6%✅⬆️
process.time_to_main_ms488.22 ± (487.62 - 488.81) ms485.93 ± (485.26 - 486.59) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.38 ± (62.24 - 62.52) MB62.11 ± (61.97 - 62.25) MB-0.4%
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (29 - 30)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.47 ± (190.04 - 190.89) ms193.69 ± (193.16 - 194.21) ms+1.7%✅⬆️
process.time_to_main_ms69.51 ± (69.32 - 69.69) ms70.61 ± (70.39 - 70.82) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.67 - 11.73) MB11.68 ± (11.66 - 11.69) MB-0.2%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.5%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.22 ± (188.96 - 189.47) ms191.22 ± (190.73 - 191.72) ms+1.1%✅⬆️
process.time_to_main_ms70.23 ± (70.11 - 70.34) ms70.85 ± (70.69 - 71.02) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.77 - 11.83) MB11.73 ± (11.71 - 11.76) MB-0.5%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.4%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms360.11 ± (358.67 - 361.55) ms366.01 ± (364.68 - 367.34) ms+1.6%✅⬆️
process.time_to_main_ms465.14 ± (464.52 - 465.76) ms465.43 ± (464.72 - 466.15) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.38 ± (50.34 - 50.42) MB50.30 ± (50.27 - 50.33) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.1%
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 (7746) - mean (71ms)  : 66, 75
    master - mean (69ms)  : 67, 71

    section Bailout
    This PR (7746) - mean (76ms)  : 74, 78
    master - mean (72ms)  : 71, 74

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (1,083ms)  : 988, 1179
    master - mean (1,055ms)  : 994, 1116

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 (7746) - mean (108ms)  : 105, 112
    master - mean (107ms)  : 104, 110

    section Bailout
    This PR (7746) - mean (110ms)  : 107, 113
    master - mean (108ms)  : 106, 111

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (764ms)  : 735, 792
    master - mean (756ms)  : 731, 782

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7746) - mean (98ms)  : 94, 102
    master - mean (95ms)  : 93, 97

    section Bailout
    This PR (7746) - mean (100ms)  : 95, 105
    master - mean (96ms)  : 94, 98

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (723ms)  : 680, 765
    master - mean (719ms)  : 684, 754

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7746) - mean (98ms)  : 93, 103
    master - mean (94ms)  : 91, 97

    section Bailout
    This PR (7746) - mean (100ms)  : crit, 95, 104
    master - mean (94ms)  : 93, 96

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (687ms)  : 671, 703
    master - mean (670ms)  : 649, 690

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 (7746) - mean (192ms)  : 189, 196
    master - mean (192ms)  : 189, 195

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

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (1,167ms)  : 1084, 1250
    master - mean (1,164ms)  : 1102, 1226

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 (7746) - mean (278ms)  : 270, 285
    master - mean (277ms)  : 272, 281

    section Bailout
    This PR (7746) - mean (280ms)  : 272, 288
    master - mean (277ms)  : 273, 281

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (946ms)  : 902, 990
    master - mean (954ms)  : 901, 1008

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

    section Bailout
    This PR (7746) - mean (272ms)  : 268, 275
    master - mean (269ms)  : 265, 273

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (934ms)  : 874, 994
    master - mean (932ms)  : 880, 985

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

    section Bailout
    This PR (7746) - mean (272ms)  : 264, 279
    master - mean (269ms)  : 266, 272

    section CallTarget+Inlining+NGEN
    This PR (7746) - mean (862ms)  : 835, 889
    master - mean (856ms)  : 837, 874

Loading

@datadog-datadog-prod-us1

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented Oct 31, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7746 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.127
  • 2 benchmarks are slower, with geometric mean 2.262
  • 4 benchmarks have fewer allocations
  • 5 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 ✔️ More allocations ⚠️

More allocations ⚠️ in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.05 KB 6.1 KB 51 B 0.84%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.2μs 12.3ns 42.5ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 13.9μs 67.5ns 286ns 0 0 0 5.71 KB
master StartStopWithChild net472 22.1μs 121ns 756ns 1.07 0.321 0.107 6.05 KB
#7746 StartStopWithChild net6.0 10.7μs 60ns 384ns 0 0 0 5.52 KB
#7746 StartStopWithChild netcoreapp3.1 13.7μs 66.8ns 284ns 0 0 0 5.72 KB
#7746 StartStopWithChild net472 21.9μs 120ns 679ns 0.882 0.22 0 6.1 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.31 KB 3.35 KB 46 B 1.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 930μs 99.2ns 384ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.01ms 1.09μs 4.24μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.21ms 1.06μs 4.1μs 0 0 0 3.31 KB
#7746 WriteAndFlushEnrichedTraces net6.0 945μs 117ns 438ns 0 0 0 2.71 KB
#7746 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 814ns 3.15μs 0 0 0 2.7 KB
#7746 WriteAndFlushEnrichedTraces net472 1.2ms 123ns 459ns 0 0 0 3.35 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.05μs 6.19ns 61ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.46μs 6.54ns 25.3ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.02μs 0.475ns 1.84ns 0.194 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.09μs 35.1ns 161ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.81μs 47.2ns 183ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.56μs 8.96ns 34.7ns 0.721 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 320ns 0.194ns 0.727ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 401ns 2.23ns 13.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 300ns 0.0988ns 0.383ns 0.0437 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.27μs 28.6ns 111ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.81μs 36.9ns 148ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.7μs 1.88ns 7.28ns 0.602 0 0 3.8 KB
#7746 AllCycleSimpleBody net6.0 1.06μs 6.19ns 60.3ns 0 0 0 1.22 KB
#7746 AllCycleSimpleBody netcoreapp3.1 1.39μs 7.46ns 42.2ns 0 0 0 1.2 KB
#7746 AllCycleSimpleBody net472 1.01μs 0.771ns 2.99ns 0.191 0 0 1.23 KB
#7746 AllCycleMoreComplexBody net6.0 7.28μs 3.01ns 11.7ns 0 0 0 4.72 KB
#7746 AllCycleMoreComplexBody netcoreapp3.1 9μs 45.2ns 197ns 0 0 0 4.62 KB
#7746 AllCycleMoreComplexBody net472 7.64μs 1.94ns 6.99ns 0.729 0 0 4.74 KB
#7746 ObjectExtractorSimpleBody net6.0 322ns 1.79ns 10.4ns 0 0 0 280 B
#7746 ObjectExtractorSimpleBody netcoreapp3.1 402ns 2ns 8.5ns 0 0 0 272 B
#7746 ObjectExtractorSimpleBody net472 297ns 0.0618ns 0.231ns 0.0437 0 0 281 B
#7746 ObjectExtractorMoreComplexBody net6.0 6.34μs 28.6ns 111ns 0 0 0 3.78 KB
#7746 ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 30.4ns 118ns 0 0 0 3.69 KB
#7746 ObjectExtractorMoreComplexBody net472 6.83μs 6.45ns 25ns 0.57 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.3μs 354ns 1.37μs 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.4μs 164ns 633ns 0 0 0 32.4 KB
master EncodeArgs net472 110μs 55.9ns 216ns 4.95 0 0 32.51 KB
master EncodeLegacyArgs net6.0 144μs 149ns 579ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 200μs 291ns 1.05μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 263μs 18.2ns 62.9ns 0 0 0 2.16 KB
#7746 EncodeArgs net6.0 77μs 107ns 416ns 0 0 0 32.4 KB
#7746 EncodeArgs netcoreapp3.1 97.9μs 250ns 970ns 0 0 0 32.4 KB
#7746 EncodeArgs net472 112μs 10.2ns 39.4ns 5.05 0 0 32.51 KB
#7746 EncodeLegacyArgs net6.0 146μs 154ns 595ns 0 0 0 2.15 KB
#7746 EncodeLegacyArgs netcoreapp3.1 197μs 328ns 1.27μs 0 0 0 2.14 KB
#7746 EncodeLegacyArgs net472 262μs 32ns 124ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7746

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.444 295,911.83 723,230.80
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.093 412,424.79 863,258.96

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 393μs 50.8ns 190ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 412μs 87.3ns 327ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 427μs 52ns 201ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 285μs 21.8ns 84.5ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 296μs 91.6ns 343ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 309μs 24.6ns 92.2ns 0 0 0 2.29 KB
#7746 RunWafRealisticBenchmark net6.0 402μs 93.8ns 351ns 0 0 0 4.55 KB
#7746 RunWafRealisticBenchmark netcoreapp3.1 784μs 14.7μs 147μs 0 0 0 4.48 KB
#7746 RunWafRealisticBenchmark net472 428μs 81.5ns 316ns 0 0 0 4.66 KB
#7746 RunWafRealisticBenchmarkWithAttack net6.0 283μs 39.7ns 154ns 0 0 0 2.24 KB
#7746 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 678μs 13.2μs 132μs 0 0 0 2.22 KB
#7746 RunWafRealisticBenchmarkWithAttack net472 312μs 37.6ns 146ns 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 61μs 69.8ns 261ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 73.1μs 61.9ns 240ns 0 0 0 17.42 KB
master SendRequest net472 0.0118ns 0.00183ns 0.0071ns 0 0 0 0 b
#7746 SendRequest net6.0 60.8μs 48.8ns 189ns 0 0 0 14.52 KB
#7746 SendRequest netcoreapp3.1 71.4μs 69.9ns 252ns 0 0 0 17.42 KB
#7746 SendRequest net472 0.000114ns 0.000114ns 0.000443ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7746

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 1.127 934,319.14 829,032.44

More allocations ⚠️ in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1 B 3 B 2 B 200.00%

Fewer allocations 🎉 in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 7 B 2 B -5 B -71.43%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.95ms 2.84μs 11μs 0 0 0 640 KB
master OriginalCharSlice netcoreapp3.1 2.13ms 9.9μs 38.3μs 0 0 0 640 KB
master OriginalCharSlice net472 2.61ms 104ns 391ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.37ms 140ns 542ns 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.66ms 507ns 1.96μs 0 0 0 1 B
master OptimizedCharSlice net472 1.92ms 2.9μs 11.2μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 811μs 31.8ns 123ns 0 0 0 1 B
master OptimizedCharSliceWithPool netcoreapp3.1 934μs 122ns 471ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.16ms 131ns 506ns 0 0 0 0 b
#7746 OriginalCharSlice net6.0 1.89ms 231ns 897ns 0 0 0 640.01 KB
#7746 OriginalCharSlice netcoreapp3.1 2.14ms 6.46μs 23.3μs 0 0 0 640 KB
#7746 OriginalCharSlice net472 2.56ms 83.6ns 301ns 100 0 0 641.95 KB
#7746 OptimizedCharSlice net6.0 1.47ms 334ns 1.3μs 0 0 0 2 B
#7746 OptimizedCharSlice netcoreapp3.1 1.67ms 454ns 1.76μs 0 0 0 1 B
#7746 OptimizedCharSlice net472 2.03ms 385ns 1.49μs 0 0 0 0 b
#7746 OptimizedCharSliceWithPool net6.0 803μs 36.5ns 142ns 0 0 0 3 B
#7746 OptimizedCharSliceWithPool netcoreapp3.1 829μs 40.9ns 153ns 0 0 0 0 b
#7746 OptimizedCharSliceWithPool net472 1.13ms 82.3ns 308ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.64 KB 56.25 KB 614 B 1.10%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 669μs 3.1μs 11.6μs 0 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 719μs 3.34μs 13.8μs 0 0 0 41.75 KB
master WriteAndFlushEnrichedTraces net472 907μs 3.6μs 13.9μs 8.33 0 0 55.64 KB
#7746 WriteAndFlushEnrichedTraces net6.0 704μs 3.41μs 13.6μs 0 0 0 41.72 KB
#7746 WriteAndFlushEnrichedTraces netcoreapp3.1 669μs 3.04μs 11.4μs 0 0 0 41.93 KB
#7746 WriteAndFlushEnrichedTraces net472 839μs 1.61μs 5.8μs 8.33 0 0 56.25 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.85μs 9.06ns 39.5ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.7μs 9.32ns 34.9ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.89μs 2.27ns 8.79ns 0.143 0.0143 0 987 B
#7746 ExecuteNonQuery net6.0 1.86μs 0.626ns 2.34ns 0 0 0 1.02 KB
#7746 ExecuteNonQuery netcoreapp3.1 2.74μs 11.7ns 45.3ns 0 0 0 1.02 KB
#7746 ExecuteNonQuery net472 2.93μs 2.24ns 8.4ns 0.144 0.0144 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.74μs 8.34ns 33.4ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.19μs 3.45ns 13.4ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.62μs 2.2ns 8.23ns 0.163 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.83μs 9.36ns 37.4ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.37μs 9.16ns 33ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.6μs 4.63ns 17.9ns 0.163 0 0 1.1 KB
#7746 CallElasticsearch net6.0 1.67μs 8.72ns 41.8ns 0 0 0 1.03 KB
#7746 CallElasticsearch netcoreapp3.1 2.27μs 9.85ns 38.1ns 0 0 0 1.03 KB
#7746 CallElasticsearch net472 3.48μs 1.98ns 7.4ns 0.157 0 0 1.04 KB
#7746 CallElasticsearchAsync net6.0 1.89μs 9.34ns 40.7ns 0 0 0 1.01 KB
#7746 CallElasticsearchAsync netcoreapp3.1 2.38μs 11.8ns 48.7ns 0 0 0 1.08 KB
#7746 CallElasticsearchAsync net472 3.64μs 1.83ns 7.07ns 0.163 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.83μs 5.94ns 23ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.41μs 9.84ns 38.1ns 0 0 0 952 B
master ExecuteAsync net472 2.53μs 1.22ns 4.41ns 0.14 0 0 915 B
#7746 ExecuteAsync net6.0 1.79μs 9.23ns 44.3ns 0 0 0 952 B
#7746 ExecuteAsync netcoreapp3.1 2.54μs 2.75ns 10.6ns 0 0 0 952 B
#7746 ExecuteAsync net472 2.55μs 3.09ns 12ns 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 7.05μs 28ns 109ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 9.06μs 13.2ns 51ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 6.67ns 24.9ns 0.487 0 0 3.18 KB
#7746 SendAsync net6.0 6.75μs 5.94ns 22.2ns 0 0 0 2.36 KB
#7746 SendAsync netcoreapp3.1 8.51μs 8.87ns 34.4ns 0 0 0 2.9 KB
#7746 SendAsync net472 12μs 10.5ns 40.5ns 0.48 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.11 KB 274.64 KB 15.53 KB 5.99%

Fewer allocations 🎉 in #7746

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.33 KB 44.06 KB -264 B -0.60%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 259.74 KB 256.93 KB -2.82 KB -1.08%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 45.72 KB 43.66 KB -2.06 KB -4.51%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 48.1μs 603ns 5.84μs 0 0 0 45.72 KB
master StringConcatBenchmark netcoreapp3.1 50.2μs 277ns 2.28μs 0 0 0 44.33 KB
master StringConcatBenchmark net472 58.6μs 226ns 847ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 459μs 2.19μs 9.56μs 0 0 0 259.11 KB
master StringConcatAspectBenchmark netcoreapp3.1 547μs 2.47μs 9.58μs 0 0 0 259.74 KB
master StringConcatAspectBenchmark net472 404μs 1.89μs 15.3μs 0 0 0 279.31 KB
#7746 StringConcatBenchmark net6.0 42.2μs 212ns 969ns 0 0 0 43.66 KB
#7746 StringConcatBenchmark netcoreapp3.1 48.9μs 242ns 1.03μs 0 0 0 44.06 KB
#7746 StringConcatBenchmark net472 57.5μs 155ns 580ns 0 0 0 57.34 KB
#7746 StringConcatAspectBenchmark net6.0 469μs 1.71μs 6.16μs 0 0 0 274.64 KB
#7746 StringConcatAspectBenchmark netcoreapp3.1 490μs 2.23μs 8.36μs 0 0 0 256.93 KB
#7746 StringConcatAspectBenchmark net472 415μs 2.36μs 17μs 0 0 0 278.29 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.64μs 13.1ns 57.1ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.62μs 17.5ns 74.2ns 0 0 0 1.7 KB
master EnrichedLog net472 4.03μs 8.03ns 31.1ns 0.26 0 0 1.64 KB
#7746 EnrichedLog net6.0 2.61μs 0.688ns 2.48ns 0 0 0 1.7 KB
#7746 EnrichedLog netcoreapp3.1 3.66μs 12.9ns 49.9ns 0 0 0 1.7 KB
#7746 EnrichedLog net472 4.02μs 11.1ns 43ns 0.245 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 123μs 77.2ns 278ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 130μs 170ns 636ns 0 0 0 4.31 KB
master EnrichedLog net472 169μs 306ns 1.18μs 0 0 0 4.52 KB
#7746 EnrichedLog net6.0 123μs 180ns 674ns 0 0 0 4.31 KB
#7746 EnrichedLog netcoreapp3.1 132μs 358ns 1.39μs 0 0 0 4.31 KB
#7746 EnrichedLog net472 173μs 281ns 1.09μs 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.01μs 4.55ns 17ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.77μs 23ns 88.9ns 0 0 0 2.26 KB
master EnrichedLog net472 7.56μs 6.66ns 25.8ns 0.302 0 0 2.08 KB
#7746 EnrichedLog net6.0 5.19μs 13.9ns 53.7ns 0 0 0 2.26 KB
#7746 EnrichedLog netcoreapp3.1 6.95μs 17.4ns 65ns 0 0 0 2.26 KB
#7746 EnrichedLog net472 7.74μs 13ns 50.4ns 0.309 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.99μs 10.3ns 49.4ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.63μs 8.47ns 32.8ns 0 0 0 1.2 KB
master SendReceive net472 3.15μs 2.55ns 9.87ns 0.189 0 0 1.2 KB
#7746 SendReceive net6.0 2.04μs 3.86ns 14.5ns 0 0 0 1.2 KB
#7746 SendReceive netcoreapp3.1 2.65μs 7.53ns 29.1ns 0 0 0 1.2 KB
#7746 SendReceive net472 3.07μs 3.7ns 14.3ns 0.184 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.21μs 11.8ns 45.8ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.57μs 20.5ns 79.4ns 0 0 0 1.63 KB
master EnrichedLog net472 6.45μs 6.8ns 26.3ns 0.321 0 0 2.03 KB
#7746 EnrichedLog net6.0 4.32μs 6.81ns 26.4ns 0 0 0 1.58 KB
#7746 EnrichedLog netcoreapp3.1 5.46μs 17.8ns 68.9ns 0 0 0 1.63 KB
#7746 EnrichedLog net472 6.85μs 15.6ns 60.3ns 0.307 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 782ns 3.89ns 17.4ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 973ns 4.36ns 16.9ns 0 0 0 576 B
master StartFinishSpan net472 932ns 0.531ns 2.06ns 0.0888 0 0 578 B
master StartFinishScope net6.0 939ns 4.72ns 22.1ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.23μs 5.95ns 25.2ns 0 0 0 696 B
master StartFinishScope net472 1.11μs 1.12ns 4.35ns 0.1 0 0 658 B
#7746 StartFinishSpan net6.0 779ns 0.578ns 2.24ns 0 0 0 576 B
#7746 StartFinishSpan netcoreapp3.1 966ns 4.59ns 18.9ns 0 0 0 576 B
#7746 StartFinishSpan net472 929ns 0.724ns 2.8ns 0.0881 0 0 578 B
#7746 StartFinishScope net6.0 914ns 4.91ns 26.4ns 0 0 0 696 B
#7746 StartFinishScope netcoreapp3.1 1.22μs 6.46ns 34.2ns 0 0 0 696 B
#7746 StartFinishScope net472 1.11μs 0.943ns 3.65ns 0.0993 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.06μs 2.51ns 9.73ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 4.72ns 18.3ns 0 0 0 696 B
master RunOnMethodBegin net472 1.47μs 0.466ns 1.81ns 0.102 0 0 658 B
#7746 RunOnMethodBegin net6.0 1.06μs 0.642ns 2.23ns 0 0 0 696 B
#7746 RunOnMethodBegin netcoreapp3.1 1.45μs 7.28ns 34.1ns 0 0 0 696 B
#7746 RunOnMethodBegin net472 1.49μs 1.63ns 6.32ns 0.0971 0 0 658 B

@rithikanarayan rithikanarayan marked this pull request as ready for review November 5, 2025 14:12
@rithikanarayan rithikanarayan requested review from a team as code owners November 5, 2025 14:12
Comment on lines +40 to +45
[Tag(Trace.Tags.PeerService)]
public string PeerService { get; set; }

[Tag(Trace.Tags.PeerServiceSource)]
public string PeerServiceSource { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

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

If we are planning to set them in future PRs, let's wait until that logic is ready before actually adding the tags empty

Copy link
Member

@lucaspimentel lucaspimentel Nov 5, 2025

Choose a reason for hiding this comment

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

fwiw, if the tag has no value (null or empty string), we don't serialize it into MessagePack when sending to the agent, so this is pretty harmless.

Copy link
Member

Choose a reason for hiding this comment

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

For context, this work was going to be a single PR, but it was growing too big so @rithikanarayan decided to split it into two PRs. She will be setting these tags in the next PR.

public async Task SubmitsTraces(string packageVersion)
{
string metadataSchemaVersion = "v0";
SetEnvironmentVariable("DD_TRACE_SPAN_ATTRIBUTE_SCHEMA", metadataSchemaVersion);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's skip setting DD_TRACE_SPAN_ATTRIBUTE_SCHEMA given that it now does nothing for these tests.

Comment on lines 42 to 43
var isExternalSpan = metadataSchemaVersion == "v0";
var clientSpanServiceName = isExternalSpan ? $"{EnvironmentHelper.FullSampleName}-aws-dynamodb" : EnvironmentHelper.FullSampleName;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can clean these up now

span => span.Tags.TryGetValue("component", out var component) && component == "aws-sdk");

dynamoDbSpans.Should().NotBeEmpty();
ValidateIntegrationSpans(dynamoDbSpans, metadataSchemaVersion, expectedServiceName: clientSpanServiceName, isExternalSpan);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just completely get rid of the metadataSchemaVersion variable? Is there a way to ValidateIntegrationSpans that doesn't make us call this "v0"? Don't really like calling the snapshots v0 because this is now a mix between v0 and v1

Copy link
Author

Choose a reason for hiding this comment

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

ValidateIntegationSpans is a shared function between many tests, including those that still have V1 schemas, so for readability and consistency between these tests I think we should keep the metadataSchemaVersion. I have removed its uses where possible (AWS-specific functions).

Comment on lines 127 to 136
[Theory]
[MemberData(nameof(GetAllConfigs))]
public void CreateAwsS3TagsReturnsCorrectImplementation(object schemaVersionObject, bool peerServiceTagsEnabled, bool removeClientServiceNamesEnabled)
{
var schemaVersion = (SchemaVersion)schemaVersionObject; // Unbox SchemaVersion, which is only defined internally
var expectedType = schemaVersion switch
{
SchemaVersion.V0 when peerServiceTagsEnabled == false => typeof(AwsS3Tags),
_ => typeof(AwsS3V1Tags),
};
var expectedType = typeof(AwsS3Tags);

var namingSchema = new NamingSchema(schemaVersion, peerServiceTagsEnabled, removeClientServiceNamesEnabled, DefaultServiceName, _mappings, new Dictionary<string, string>());
namingSchema.Messaging.CreateAwsS3Tags("spanKind").Should().BeOfType(expectedType);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we skip these tests altogether now? I don't think they are testing much anymore, maybe you were planning on repurposing them in future PRs?

SetEnvironmentVariable("DD_TRACE_SPAN_ATTRIBUTE_SCHEMA", metadataSchemaVersion);
var isExternalSpan = metadataSchemaVersion == "v0";
var clientSpanServiceName = isExternalSpan ? $"{EnvironmentHelper.FullSampleName}-aws-dynamodb" : EnvironmentHelper.FullSampleName;
string metadataSchemaVersion = "v0";
Copy link
Member

Choose a reason for hiding this comment

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

Just a small nit-pick, when a local variable never changes, we like to make it a constant. It makes it more obvious to readers, and can avoid bugs where someone changes the value later on (the compiler won't let you if it's const).

Suggested change
string metadataSchemaVersion = "v0";
const string metadataSchemaVersion = "v0";

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't matter much here since this a test, but I think that following guidelines everywhere is a good practice 😅


dynamoDbSpans.Should().NotBeEmpty();
ValidateIntegrationSpans(dynamoDbSpans, metadataSchemaVersion, expectedServiceName: clientSpanServiceName, isExternalSpan);
ValidateIntegrationSpans(dynamoDbSpans, metadataSchemaVersion, expectedServiceName: clientSpanServiceName, true);
Copy link
Member

Choose a reason for hiding this comment

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

In C# you can optionally include the parameter name. It can be used to provide arguments out of order or to skip optional parameters, or, in this case, just to document which value you are passing to make the code more readable. It's especially useful when passing a Boolean ("true what??") 😅

Suggested change
ValidateIntegrationSpans(dynamoDbSpans, metadataSchemaVersion, expectedServiceName: clientSpanServiceName, true);
ValidateIntegrationSpans(dynamoDbSpans, metadataSchemaVersion, expectedServiceName: clientSpanServiceName, isExternalSpan: true);

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.

I left small coding-style comments, but feel free to do those in the next PR.

SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsS3Tags(),
_ => new AwsS3V1Tags(spanKind),
};
public AwsS3Tags CreateAwsS3Tags(string spanKind) => new AwsS3Tags();
Copy link
Member

@lucaspimentel lucaspimentel Nov 5, 2025

Choose a reason for hiding this comment

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

These types all have constructors that take a spanKind, so we should pass that long.

Suggested change
public AwsS3Tags CreateAwsS3Tags(string spanKind) => new AwsS3Tags();
public AwsS3Tags CreateAwsS3Tags(string spanKind) => new AwsS3Tags(spanKind);

You already did this with AwsKinesisTags and AwsStepFunctionsTags below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants