dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

Add SessionID as aspnet.session.id

Open bouwkast opened this issue 1 year ago • 4 comments

Summary of changes

Reason for change

Implementation details

Test coverage

Other details

bouwkast avatar Oct 09 '24 18:10 bouwkast

Datadog Report

Branch report: steven/session-id Commit report: f95415b Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 363346 Passed, 2064 Skipped, 14h 59m 28.23s Total Time

datadog-ddstaging[bot] avatar Oct 09 '24 18:10 datadog-ddstaging[bot]

Execution-Time Benchmarks Report :stopwatch:

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:

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

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (69ms)  : 67, 72
     .   : milestone, 69,
    master - mean (70ms)  : 67, 72
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (1,111ms)  : 1090, 1133
     .   : milestone, 1111,
    master - mean (1,109ms)  : 1081, 1138
     .   : milestone, 1109,

gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (110ms)  : 107, 112
     .   : milestone, 110,
    master - mean (108ms)  : 105, 111
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (772ms)  : 756, 788
     .   : milestone, 772,
    master - mean (770ms)  : 756, 783
     .   : milestone, 770,

gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (93ms)  : 90, 95
     .   : milestone, 93,
    master - mean (91ms)  : 89, 94
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (728ms)  : 712, 743
     .   : milestone, 728,
    master - mean (725ms)  : 706, 744
     .   : milestone, 725,

gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (194ms)  : 188, 201
     .   : milestone, 194,
    master - mean (191ms)  : 186, 196
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (1,210ms)  : 1186, 1235
     .   : milestone, 1210,
    master - mean (1,207ms)  : 1181, 1233
     .   : milestone, 1207,

gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (280ms)  : 274, 285
     .   : milestone, 280,
    master - mean (276ms)  : 271, 282
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (947ms)  : 927, 967
     .   : milestone, 947,
    master - mean (950ms)  : 928, 972
     .   : milestone, 950,

gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6137) - mean (267ms)  : 262, 273
     .   : milestone, 267,
    master - mean (267ms)  : 259, 275
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (6137) - mean (930ms)  : 906, 953
     .   : milestone, 930,
    master - mean (930ms)  : 910, 949
     .   : milestone, 930,

andrewlock avatar Oct 09 '24 18:10 andrewlock

Benchmarks Report for tracer :snail:

Benchmarks for #6137 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.129
  • 1 benchmarks are slower, with geometric mean 1.221
  • All benchmarks have the same 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 :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.91μs 43.9ns 274ns 0.0199 0.00796 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.82μs 52.6ns 297ns 0.0139 0.00463 0 5.62 KB
master StartStopWithChild net472 16.6μs 59.8ns 224ns 1.01 0.291 0.083 6.06 KB
#6137 StartStopWithChild net6.0 7.68μs 43.1ns 292ns 0.0114 0.00382 0 5.43 KB
#6137 StartStopWithChild netcoreapp3.1 10.4μs 57.1ns 333ns 0.02 0.01 0 5.62 KB
#6137 StartStopWithChild net472 16.5μs 76.4ns 286ns 1.03 0.315 0.097 6.05 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 470μs 313ns 1.21μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 247ns 956ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 840μs 612ns 2.37μs 0.417 0 0 3.3 KB
#6137 WriteAndFlushEnrichedTraces net6.0 482μs 405ns 1.57μs 0 0 0 2.7 KB
#6137 WriteAndFlushEnrichedTraces netcoreapp3.1 638μs 679ns 2.63μs 0 0 0 2.7 KB
#6137 WriteAndFlushEnrichedTraces net472 846μs 505ns 1.89μs 0.422 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 217μs 1.24μs 11.1μs 0.22 0 0 18.45 KB
master SendRequest netcoreapp3.1 249μs 1.67μs 16.3μs 0.222 0 0 20.61 KB
master SendRequest net472 0.00243ns 0.000803ns 0.003ns 0 0 0 0 b
#6137 SendRequest net6.0 211μs 1.23μs 11.1μs 0.213 0 0 18.46 KB
#6137 SendRequest netcoreapp3.1 234μs 1.37μs 11.8μs 0.216 0 0 20.61 KB
#6137 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 597μs 3.21μs 17μs 0.592 0 0 41.58 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 690μs 3.54μs 17μs 0.334 0 0 41.77 KB
master WriteAndFlushEnrichedTraces net472 875μs 2.64μs 9.14μs 8.04 2.23 0.446 53.37 KB
#6137 WriteAndFlushEnrichedTraces net6.0 601μs 2.92μs 11.7μs 0.579 0 0 41.61 KB
#6137 WriteAndFlushEnrichedTraces netcoreapp3.1 709μs 4.07μs 32.3μs 0.349 0 0 41.62 KB
#6137 WriteAndFlushEnrichedTraces net472 869μs 3.71μs 15.3μs 8.3 2.62 0.437 53.35 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.25μs 1.82ns 7.05ns 0.0143 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.74μs 2.5ns 9.7ns 0.0131 0 0 1.02 KB
master ExecuteNonQuery net472 2.07μs 3.31ns 12.4ns 0.157 0 0 987 B
#6137 ExecuteNonQuery net6.0 1.31μs 1.83ns 7.08ns 0.0144 0 0 1.02 KB
#6137 ExecuteNonQuery netcoreapp3.1 1.76μs 1.8ns 6.96ns 0.0133 0 0 1.02 KB
#6137 ExecuteNonQuery net472 2.09μs 1.96ns 7.34ns 0.156 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.26μs 1.89ns 7.32ns 0.0139 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 1.9ns 7.34ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.53μs 2.33ns 8.71ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.33μs 0.826ns 3.09ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.6μs 1.07ns 4ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.57μs 2.23ns 8.33ns 0.166 0 0 1.05 KB
#6137 CallElasticsearch net6.0 1.16μs 0.393ns 1.52ns 0.014 0 0 976 B
#6137 CallElasticsearch netcoreapp3.1 1.63μs 1.44ns 5.39ns 0.0128 0 0 976 B
#6137 CallElasticsearch net472 2.49μs 1.44ns 5.6ns 0.157 0 0 995 B
#6137 CallElasticsearchAsync net6.0 1.25μs 0.434ns 1.62ns 0.0132 0 0 952 B
#6137 CallElasticsearchAsync netcoreapp3.1 1.68μs 1.18ns 4.41ns 0.0134 0 0 1.02 KB
#6137 CallElasticsearchAsync net472 2.63μs 1.56ns 6.03ns 0.167 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #6137

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.144 1,375.74 1,202.48

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.38μs 1.45ns 5.44ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.61μs 0.591ns 2.21ns 0.013 0 0 952 B
master ExecuteAsync net472 1.87μs 1.59ns 6.15ns 0.145 0 0 915 B
#6137 ExecuteAsync net6.0 1.2μs 0.92ns 3.56ns 0.0133 0 0 952 B
#6137 ExecuteAsync netcoreapp3.1 1.6μs 0.892ns 3.45ns 0.0128 0 0 952 B
#6137 ExecuteAsync net472 1.74μs 1.16ns 4.48ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.35μs 2.57ns 9.25ns 0.0305 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.12μs 1.47ns 5.69ns 0.0358 0 0 2.76 KB
master SendAsync net472 7.68μs 1.75ns 6.77ns 0.497 0 0 3.15 KB
#6137 SendAsync net6.0 4.11μs 1.81ns 7.01ns 0.0308 0 0 2.22 KB
#6137 SendAsync netcoreapp3.1 5.04μs 1.32ns 4.94ns 0.0351 0 0 2.76 KB
#6137 SendAsync net472 7.79μs 2.98ns 11.5ns 0.497 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.45μs 1.09ns 3.91ns 0.0233 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.28μs 1.09ns 4.08ns 0.0217 0 0 1.64 KB
master EnrichedLog net472 2.48μs 1.28ns 4.77ns 0.249 0 0 1.57 KB
#6137 EnrichedLog net6.0 1.45μs 0.623ns 2.33ns 0.0231 0 0 1.64 KB
#6137 EnrichedLog netcoreapp3.1 2.36μs 0.734ns 2.75ns 0.0222 0 0 1.64 KB
#6137 EnrichedLog net472 2.52μs 0.996ns 3.86ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 114μs 110ns 426ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 108ns 389ns 0 0 0 4.28 KB
master EnrichedLog net472 148μs 106ns 411ns 0.663 0.221 0 4.46 KB
#6137 EnrichedLog net6.0 117μs 149ns 578ns 0.0587 0 0 4.28 KB
#6137 EnrichedLog netcoreapp3.1 122μs 324ns 1.25μs 0 0 0 4.28 KB
#6137 EnrichedLog net472 153μs 161ns 622ns 0.687 0.229 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.18μs 11.1ns 40.1ns 0.0302 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.22μs 0.935ns 3.62ns 0.0295 0 0 2.2 KB
master EnrichedLog net472 4.86μs 1.99ns 7.18ns 0.32 0 0 2.02 KB
#6137 EnrichedLog net6.0 3.01μs 0.953ns 3.57ns 0.0301 0 0 2.2 KB
#6137 EnrichedLog netcoreapp3.1 4.36μs 2.38ns 8.9ns 0.0298 0 0 2.2 KB
#6137 EnrichedLog net472 4.74μs 1.37ns 5.3ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.29μs 1.25ns 4.66ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.82μs 1.44ns 5.56ns 0.0154 0 0 1.14 KB
master SendReceive net472 2.04μs 1.42ns 5.5ns 0.183 0.00102 0 1.16 KB
#6137 SendReceive net6.0 1.31μs 0.582ns 2.18ns 0.0163 0 0 1.14 KB
#6137 SendReceive netcoreapp3.1 1.71μs 1.06ns 3.97ns 0.0154 0 0 1.14 KB
#6137 SendReceive net472 2.15μs 0.967ns 3.62ns 0.183 0.00107 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.77μs 1.08ns 4.04ns 0.0221 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 1.07ns 4.14ns 0.0218 0 0 1.65 KB
master EnrichedLog net472 4.31μs 3.75ns 14.5ns 0.322 0 0 2.04 KB
#6137 EnrichedLog net6.0 2.76μs 1.69ns 5.86ns 0.0221 0 0 1.6 KB
#6137 EnrichedLog netcoreapp3.1 3.95μs 2.05ns 7.94ns 0.0216 0 0 1.65 KB
#6137 EnrichedLog net472 4.51μs 2.09ns 7.83ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #6137

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.221 567.74 692.99

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 450ns 0.229ns 0.888ns 0.00813 0 0 576 B
master StartFinishSpan netcoreapp3.1 600ns 0.559ns 2.17ns 0.00776 0 0 576 B
master StartFinishSpan net472 569ns 0.614ns 2.3ns 0.0918 0 0 578 B
master StartFinishScope net6.0 548ns 0.14ns 0.524ns 0.00967 0 0 696 B
master StartFinishScope netcoreapp3.1 713ns 0.631ns 2.44ns 0.0096 0 0 696 B
master StartFinishScope net472 851ns 0.274ns 0.987ns 0.104 0 0 658 B
#6137 StartFinishSpan net6.0 414ns 0.129ns 0.501ns 0.00803 0 0 576 B
#6137 StartFinishSpan netcoreapp3.1 561ns 0.435ns 1.68ns 0.00781 0 0 576 B
#6137 StartFinishSpan net472 693ns 0.3ns 1.08ns 0.0918 0 0 578 B
#6137 StartFinishScope net6.0 505ns 0.262ns 1.02ns 0.00975 0 0 696 B
#6137 StartFinishScope netcoreapp3.1 671ns 0.304ns 1.18ns 0.00943 0 0 696 B
#6137 StartFinishScope net472 905ns 0.539ns 2.09ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #6137

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.115 701.30 629.09

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 701ns 0.286ns 1.11ns 0.00981 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 921ns 0.593ns 2.14ns 0.00925 0 0 696 B
master RunOnMethodBegin net472 1.14μs 0.715ns 2.48ns 0.104 0 0 658 B
#6137 RunOnMethodBegin net6.0 629ns 0.274ns 1.03ns 0.00961 0 0 696 B
#6137 RunOnMethodBegin netcoreapp3.1 952ns 0.315ns 1.14ns 0.0094 0 0 696 B
#6137 RunOnMethodBegin net472 1.21μs 0.707ns 2.74ns 0.104 0 0 658 B

andrewlock avatar Oct 09 '24 19:10 andrewlock

Throughput/Crank Report :zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6137) (11.017M)   : 0, 11016675
    master (10.938M)   : 0, 10938338
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6137) (7.252M)   : 0, 7251791
    master (7.287M)   : 0, 7287003
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.632M)   : 0, 7632146

    section Manual
    master (10.878M)   : 0, 10878310

    section Manual + Automatic
    This PR (6137) (6.689M)   : 0, 6689301
    master (6.730M)   : 0, 6729810

    section DD_TRACE_ENABLED=0
    master (10.111M)   : 0, 10111307

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6137) (9.342M)   : 0, 9341984
    master (9.427M)   : 0, 9426776
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6137) (6.549M)   : 0, 6549191
    master (6.636M)   : 0, 6636217

    section Trace stats
    master (6.851M)   : 0, 6851155

    section Manual
    master (9.461M)   : 0, 9461065

    section Manual + Automatic
    This PR (6137) (6.088M)   : 0, 6088298
    master (6.187M)   : 0, 6186642

    section DD_TRACE_ENABLED=0
    master (8.712M)   : 0, 8711537

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6137) (10.254M)   : 0, 10254398
    master (10.095M)   : 0, 10095451
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6137) (6.838M)   : 0, 6837727
    master (6.632M)   : 0, 6631756
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.222M)   : 0, 7222352

    section Manual
    master (9.922M)   : 0, 9921984

    section Manual + Automatic
    This PR (6137) (6.346M)   : 0, 6346054
    master (6.217M)   : 0, 6217342

    section DD_TRACE_ENABLED=0
    master (9.452M)   : 0, 9451878

andrewlock avatar Oct 09 '24 20:10 andrewlock

Closing can always revisit later if needed

bouwkast avatar Feb 14 '25 14:02 bouwkast