Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASM] Downgrade middleware log if no current span found #4932

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

anna-git
Copy link
Contributor

Summary of changes

It's not an error as it can happen if the aspnetcore integration has been disabled for example.
To fix later: maybe create a span, in case there's none or just run security checks at least to ensure protection

Reason for change

Implementation details

Test coverage

Other details

@anna-git anna-git requested a review from a team as a code owner November 28, 2023 12:07
@anna-git anna-git changed the title [ASM] Downgrade log [ASM] Downgrade middleware log if no current span found Nov 28, 2023
Copy link
Member

@robertpi robertpi left a comment

Choose a reason for hiding this comment

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

Mostly harmless :)

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 28, 2023

Datadog Report

Branch report: anna/asm/downgrade-log-middleware
Commit report: ea95f05

dd-trace-dotnet: 0 Failed, 0 New Flaky, 305563 Passed, 955 Skipped, 31m 4.29s Wall Time

@andrewlock
Copy link
Member

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:

  • 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 (4932) - mean (72ms)  : 62, 82
     .   : milestone, 72,
    master - mean (70ms)  : 62, 79
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (1,000ms)  : 968, 1032
     .   : milestone, 1000,
    master - mean (996ms)  : 974, 1017
     .   : milestone, 996,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4932) - mean (106ms)  : 102, 110
     .   : milestone, 106,
    master - mean (106ms)  : 103, 109
     .   : milestone, 106,

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (692ms)  : 674, 710
     .   : milestone, 692,
    master - mean (691ms)  : 674, 708
     .   : milestone, 691,

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

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (660ms)  : 639, 681
     .   : milestone, 660,
    master - mean (657ms)  : 637, 676
     .   : milestone, 657,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4932) - mean (188ms)  : 186, 191
     .   : milestone, 188,
    master - mean (189ms)  : 185, 193
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (1,132ms)  : 1111, 1153
     .   : milestone, 1132,
    master - mean (1,137ms)  : 1114, 1159
     .   : milestone, 1137,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4932) - mean (272ms)  : 267, 278
     .   : milestone, 272,
    master - mean (271ms)  : 269, 274
     .   : milestone, 271,

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (1,096ms)  : 1065, 1127
     .   : milestone, 1096,
    master - mean (1,093ms)  : 1069, 1116
     .   : milestone, 1093,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4932) - mean (262ms)  : 257, 266
     .   : milestone, 262,
    master - mean (261ms)  : 257, 265
     .   : milestone, 261,

    section CallTarget+Inlining+NGEN
    This PR (4932) - mean (1,057ms)  : 1035, 1080
     .   : milestone, 1057,
    master - mean (1,059ms)  : 1037, 1080
     .   : milestone, 1059,

Loading

@andrewlock
Copy link
Member

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 (4932) (11.548M)   : 0, 11547779
    master (11.398M)   : 0, 11397842
    benchmarks/2.9.0 (11.178M)   : 0, 11177752

    section Automatic
    This PR (4932) (7.903M)   : 0, 7903311
    master (7.741M)   : 0, 7741213
    benchmarks/2.9.0 (8.258M)   : 0, 8258139

    section Trace stats
    This PR (4932) (8.147M)   : 0, 8146888
    master (7.838M)   : 0, 7838308

    section Manual
    This PR (4932) (10.045M)   : 0, 10045486
    master (9.640M)   : 0, 9639565

    section Manual + Automatic
    This PR (4932) (7.523M)   : 0, 7522697
    master (7.091M)   : 0, 7090844

    section Version Conflict
    This PR (4932) (6.772M)   : 0, 6772010
    master (6.356M)   : 0, 6355720

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4932) (9.619M)   : 0, 9618535
    master (9.626M)   : 0, 9625782
    benchmarks/2.9.0 (9.499M)   : 0, 9498942

    section Automatic
    This PR (4932) (6.585M)   : 0, 6584764
    master (6.688M)   : 0, 6687590

    section Trace stats
    This PR (4932) (6.921M)   : 0, 6920754
    master (6.778M)   : 0, 6778098

    section Manual
    This PR (4932) (8.331M)   : 0, 8330539
    master (8.409M)   : 0, 8408747

    section Manual + Automatic
    This PR (4932) (5.959M)   : 0, 5959285
    master (6.238M)   : 0, 6238241

    section Version Conflict
    This PR (4932) (5.727M)   : 0, 5727068
    master (5.861M)   : 0, 5860949

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4932) (10.578M)   : 0, 10577982

    section Automatic
    This PR (4932) (7.343M)   : 0, 7342582

    section Trace stats
    This PR (4932) (7.584M)   : 0, 7584433

    section Manual
    This PR (4932) (9.019M)   : 0, 9018953

    section Manual + Automatic
    This PR (4932) (6.901M)   : 0, 6901197

    section Version Conflict
    This PR (4932) (6.207M)   : 0, 6207196

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.354M)   : 0, 7353594
    benchmarks/2.9.0 (7.850M)   : 0, 7850470

    section No attack
    master (1.955M)   : 0, 1954984
    benchmarks/2.9.0 (3.255M)   : 0, 3255134

    section Attack
    master (1.550M)   : 0, 1549695
    benchmarks/2.9.0 (2.479M)   : 0, 2478846

    section Blocking
    master (3.280M)   : 0, 3279832

    section IAST default
    master (6.465M)   : 0, 6465390

    section IAST full
    master (5.850M)   : 0, 5849810

    section Base vuln
    master (0.945M)   : 0, 944933

    section IAST vuln
    master (0.871M)   : 0, 871244

Loading

@andrewlock
Copy link
Member

Benchmarks Report 🐌

Benchmarks for #4932 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.197
  • 2 benchmarks are slower, with geometric mean 1.190
  • 2 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 8.74μs 48.6ns 322ns 0.0219 0.00876 0 7.48 KB
master StartStopWithChild netcoreapp3.1 10.9μs 57.5ns 299ns 0.0267 0.0107 0 7.58 KB
master StartStopWithChild net472 17.4μs 40.6ns 152ns 1.33 0.376 0.123 7.96 KB
#4932 StartStopWithChild net6.0 8.67μs 48.4ns 306ns 0.0251 0.0126 0 7.48 KB
#4932 StartStopWithChild netcoreapp3.1 10.6μs 54.9ns 269ns 0.0215 0.0108 0 7.58 KB
#4932 StartStopWithChild net472 17.1μs 56.5ns 219ns 1.34 0.342 0.111 7.96 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 480μs 78.7ns 272ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 621μs 203ns 761ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 775μs 298ns 1.12μs 0.388 0 0 3.3 KB
#4932 WriteAndFlushEnrichedTraces net6.0 464μs 251ns 972ns 0 0 0 2.7 KB
#4932 WriteAndFlushEnrichedTraces netcoreapp3.1 636μs 149ns 579ns 0 0 0 2.7 KB
#4932 WriteAndFlushEnrichedTraces net472 776μs 445ns 1.72μs 0.386 0 0 3.3 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 43.7μs 9.76ns 37.8ns 0.0215 0 0 1.77 KB
master AllCycleSimpleBody netcoreapp3.1 46.4μs 33.5ns 130ns 0.0231 0 0 1.74 KB
master AllCycleSimpleBody net472 50.2μs 74.7ns 289ns 0.27 0 0 1.81 KB
master AllCycleMoreComplexBody net6.0 214μs 65.1ns 252ns 0.107 0 0 9.25 KB
master AllCycleMoreComplexBody netcoreapp3.1 222μs 240ns 900ns 0.111 0 0 9.14 KB
master AllCycleMoreComplexBody net472 241μs 74.1ns 277ns 1.44 0 0 9.32 KB
master ObjectExtractorSimpleBody net6.0 134ns 0.0373ns 0.14ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 181ns 0.126ns 0.473ns 0.00374 0 0 272 B
master ObjectExtractorSimpleBody net472 151ns 0.123ns 0.478ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.82μs 1.73ns 6.47ns 0.0524 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.71μs 0.658ns 2.46ns 0.0501 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.5μs 3.01ns 11.3ns 0.602 0.00525 0 3.8 KB
#4932 AllCycleSimpleBody net6.0 43.9μs 25.8ns 93.1ns 0.0222 0 0 1.77 KB
#4932 AllCycleSimpleBody netcoreapp3.1 46.3μs 107ns 414ns 0.0233 0 0 1.74 KB
#4932 AllCycleSimpleBody net472 50μs 121ns 468ns 0.269 0 0 1.81 KB
#4932 AllCycleMoreComplexBody net6.0 214μs 175ns 821ns 0.106 0 0 9.25 KB
#4932 AllCycleMoreComplexBody netcoreapp3.1 225μs 141ns 546ns 0.112 0 0 9.14 KB
#4932 AllCycleMoreComplexBody net472 239μs 81.1ns 314ns 1.43 0 0 9.32 KB
#4932 ObjectExtractorSimpleBody net6.0 132ns 0.0348ns 0.125ns 0.00396 0 0 280 B
#4932 ObjectExtractorSimpleBody netcoreapp3.1 186ns 0.0562ns 0.21ns 0.00375 0 0 272 B
#4932 ObjectExtractorSimpleBody net472 151ns 0.129ns 0.498ns 0.0446 0 0 281 B
#4932 ObjectExtractorMoreComplexBody net6.0 2.8μs 1.15ns 4.16ns 0.0529 0 0 3.78 KB
#4932 ObjectExtractorMoreComplexBody netcoreapp3.1 3.76μs 1.38ns 5.16ns 0.0491 0 0 3.69 KB
#4932 ObjectExtractorMoreComplexBody net472 3.47μs 1.55ns 6.01ns 0.603 0.00693 0 3.8 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWaf(args=NestedMap (10)) net6.0 51.1μs 186ns 722ns 0.224 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 68.5μs 311ns 1.2μs 0.198 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) net472 95.2μs 503ns 2.66μs 2.56 0.0931 0 16.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 115μs 52.9ns 198ns 0.286 0 0 22.41 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 138μs 282ns 1.06μs 0.279 0 0 22.36 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 169μs 699ns 2.71μs 3.59 0.163 0 22.7 KB
master RunWaf(args=NestedMap (100)) net6.0 97.6μs 419ns 1.62μs 0.426 0 0 32.76 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 133μs 734ns 4.64μs 0.409 0 0 33.33 KB
master RunWaf(args=NestedMap (100)) net472 182μs 80.9ns 313ns 5.27 0.363 0 33.67 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 170μs 312ns 1.21μs 0.492 0 0 39.1 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 208μs 1.02μs 4.22μs 0.518 0 0 39.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 267μs 92.6ns 334ns 6.28 0.512 0 40.23 KB
master RunWaf(args=NestedMap (20)) net6.0 103μs 554ns 2.83μs 0.426 0 0 32.18 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 127μs 706ns 4.35μs 0.399 0 0 32.3 KB
master RunWaf(args=NestedMap (20)) net472 188μs 925ns 3.81μs 5.15 0.368 0 32.63 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 173μs 98.8ns 356ns 0.487 0 0 38.53 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 207μs 1.09μs 5.35μs 0.424 0 0 38.6 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 261μs 1.28μs 5.28μs 6.12 0.51 0 39.2 KB
#4932 RunWaf(args=NestedMap (10)) net6.0 55.8μs 83.3ns 323ns 0.218 0 0 16.06 KB
#4932 RunWaf(args=NestedMap (10)) netcoreapp3.1 65.6μs 87.7ns 304ns 0.205 0 0 16.06 KB
#4932 RunWaf(args=NestedMap (10)) net472 93.9μs 41.1ns 159ns 2.54 0.094 0 16.14 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 122μs 48.8ns 182ns 0.3 0 0 22.41 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 139μs 490ns 1.9μs 0.27 0 0 22.36 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) net472 169μs 611ns 2.37μs 3.6 0.167 0 22.7 KB
#4932 RunWaf(args=NestedMap (100)) net6.0 108μs 47.7ns 172ns 0.431 0 0 32.76 KB
#4932 RunWaf(args=NestedMap (100)) netcoreapp3.1 131μs 739ns 5.01μs 0.411 0 0 33.33 KB
#4932 RunWaf(args=NestedMap (100)) net472 186μs 912ns 3.65μs 5.28 0.364 0 33.67 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 164μs 62.6ns 234ns 0.519 0 0 39.1 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 204μs 543ns 2.1μs 0.526 0 0 39.63 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [23]) net472 266μs 1.04μs 4.02μs 6.35 0.519 0 40.23 KB
#4932 RunWaf(args=NestedMap (20)) net6.0 93.2μs 30.4ns 118ns 0.452 0 0 32.18 KB
#4932 RunWaf(args=NestedMap (20)) netcoreapp3.1 133μs 728ns 4.6μs 0.396 0 0 32.3 KB
#4932 RunWaf(args=NestedMap (20)) net472 183μs 827ns 3.2μs 5.15 0.361 0 32.63 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 177μs 77.2ns 289ns 0.53 0 0 38.53 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 201μs 154ns 533ns 0.52 0 0 38.6 KB
#4932 RunWafWithAttack(args=Neste(...)tack) [22]) net472 268μs 643ns 2.49μs 6.15 0.392 0 39.2 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 174μs 148ns 556ns 0.173 0 0 18.24 KB
master SendRequest netcoreapp3.1 193μs 309ns 1.2μs 0.194 0 0 20.4 KB
master SendRequest net472 0.000675ns 0.000217ns 0.000811ns 0 0 0 0 b
#4932 SendRequest net6.0 175μs 262ns 979ns 0.174 0 0 18.24 KB
#4932 SendRequest netcoreapp3.1 188μs 263ns 1.02μs 0.188 0 0 20.4 KB
#4932 SendRequest net472 0.000952ns 0.000418ns 0.00162ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #4932

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.4 KB 41.77 KB 363 B 0.88%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 561μs 1.07μs 4.14μs 0.541 0 0 41.4 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 1.2μs 4.63μs 0.329 0 0 41.69 KB
master WriteAndFlushEnrichedTraces net472 823μs 3.17μs 12.3μs 8.12 2.44 0.406 53.24 KB
#4932 WriteAndFlushEnrichedTraces net6.0 547μs 1.88μs 7.26μs 0.563 0 0 41.77 KB
#4932 WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 981ns 3.8μs 0.331 0 0 41.62 KB
#4932 WriteAndFlushEnrichedTraces net472 827μs 2.89μs 11.2μs 8.13 2.57 0.428 53.23 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.13μs 0.506ns 1.89ns 0.0107 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.44μs 0.566ns 2.19ns 0.0101 0 0 768 B
master ExecuteNonQuery net472 1.71μs 0.802ns 3.11ns 0.116 0 0 730 B
#4932 ExecuteNonQuery net6.0 1.03μs 4.26ns 16.5ns 0.0106 0 0 768 B
#4932 ExecuteNonQuery netcoreapp3.1 1.45μs 1.12ns 4.34ns 0.01 0 0 768 B
#4932 ExecuteNonQuery net472 1.81μs 3.53ns 13.7ns 0.116 0 0 730 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.29μs 0.819ns 3.17ns 0.013 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.49μs 0.728ns 2.72ns 0.0129 0 0 936 B
master CallElasticsearch net472 2.49μs 1.12ns 4.33ns 0.152 0 0 955 B
master CallElasticsearchAsync net6.0 1.34μs 0.529ns 2.05ns 0.0127 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.63μs 0.673ns 2.61ns 0.0128 0 0 984 B
master CallElasticsearchAsync net472 2.7μs 1.09ns 4.2ns 0.16 0 0 1.01 KB
#4932 CallElasticsearch net6.0 1.2μs 0.461ns 1.73ns 0.0133 0 0 936 B
#4932 CallElasticsearch netcoreapp3.1 1.55μs 0.678ns 2.54ns 0.0125 0 0 936 B
#4932 CallElasticsearch net472 2.53μs 0.89ns 3.45ns 0.151 0.00127 0 955 B
#4932 CallElasticsearchAsync net6.0 1.32μs 0.795ns 2.98ns 0.0125 0 0 912 B
#4932 CallElasticsearchAsync netcoreapp3.1 1.64μs 1.33ns 5.15ns 0.0132 0 0 984 B
#4932 CallElasticsearchAsync net472 2.64μs 1.03ns 3.99ns 0.161 0 0 1.01 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.31μs 1.02ns 3.96ns 0.0125 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.65μs 2.55ns 9.89ns 0.0116 0 0 912 B
master ExecuteAsync net472 1.8μs 0.606ns 2.27ns 0.138 0 0 875 B
#4932 ExecuteAsync net6.0 1.28μs 0.849ns 3.29ns 0.0128 0 0 912 B
#4932 ExecuteAsync netcoreapp3.1 1.69μs 0.885ns 3.43ns 0.012 0 0 912 B
#4932 ExecuteAsync net472 1.77μs 3.26ns 12.6ns 0.138 0.000881 0 875 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 4.16μs 2.85ns 10.7ns 0.029 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.91μs 1.56ns 6.05ns 0.0339 0 0 2.63 KB
master SendAsync net472 7.81μs 2.37ns 9.18ns 0.523 0 0 3.31 KB
#4932 SendAsync net6.0 4.2μs 1.33ns 4.96ns 0.0289 0 0 2.1 KB
#4932 SendAsync netcoreapp3.1 4.93μs 2.06ns 7.13ns 0.0346 0 0 2.63 KB
#4932 SendAsync net472 7.98μs 11.2ns 43.3ns 0.521 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #4932

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 1.250 50,150.00 62,700.00

Faster 🎉 in #4932

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net6.0 1.197 61,900.00 51,700.00 bimodal

More allocations ⚠️ in #4932

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 57.34 KB 90.11 KB 32.77 KB 57.14%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 62.3μs 746ns 7.46μs 0 0 0 43.44 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 53μs 261ns 1.08μs 0 0 0 42.64 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 37.6μs 103ns 370ns 0 0 0 59.98 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 90.3μs 2.87μs 28.7μs 0 0 0 43.29 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 106μs 3.74μs 37.3μs 0 0 0 42.64 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 50.1μs 210ns 840ns 0 0 0 57.34 KB
#4932 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 52.1μs 268ns 1.86μs 0 0 0 43.44 KB
#4932 StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 53.1μs 246ns 1.23μs 0 0 0 42.64 KB
#4932 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 38.1μs 119ns 447ns 0 0 0 59.7 KB
#4932 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 67μs 341ns 1.52μs 0 0 0 43.29 KB
#4932 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 111μs 3.12μs 30.9μs 0 0 0 42.64 KB
#4932 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 62.2μs 408ns 3.8μs 0 0 0 90.11 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 1.62μs 1.08ns 4.18ns 0.0219 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 2.2μs 1.01ns 3.91ns 0.0209 0 0 1.57 KB
master EnrichedLog net472 2.55μs 2.32ns 8.7ns 0.238 0 0 1.5 KB
#4932 EnrichedLog net6.0 1.5μs 0.849ns 3.18ns 0.0219 0 0 1.57 KB
#4932 EnrichedLog netcoreapp3.1 2.15μs 1.29ns 4.84ns 0.0214 0 0 1.57 KB
#4932 EnrichedLog net472 2.5μs 2.26ns 8.75ns 0.237 0 0 1.5 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 113μs 203ns 787ns 0.0567 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 118μs 224ns 869ns 0.0589 0 0 4.21 KB
master EnrichedLog net472 149μs 107ns 413ns 0.67 0.223 0 4.39 KB
#4932 EnrichedLog net6.0 112μs 88.3ns 342ns 0.0559 0 0 4.21 KB
#4932 EnrichedLog netcoreapp3.1 117μs 86.2ns 334ns 0.0586 0 0 4.21 KB
#4932 EnrichedLog net472 147μs 76.5ns 296ns 0.66 0.22 0 4.39 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 2.89μs 0.841ns 3.26ns 0.0289 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 4.38μs 2.83ns 10.9ns 0.029 0 0 2.13 KB
master EnrichedLog net472 4.93μs 4.23ns 16.4ns 0.307 0 0 1.95 KB
#4932 EnrichedLog net6.0 3.02μs 0.886ns 3.2ns 0.0303 0 0 2.13 KB
#4932 EnrichedLog netcoreapp3.1 4.23μs 1.99ns 7.72ns 0.0278 0 0 2.13 KB
#4932 EnrichedLog net472 4.91μs 2.68ns 10.4ns 0.309 0 0 1.95 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.3μs 0.998ns 3.6ns 0.0155 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.72μs 0.663ns 2.48ns 0.0145 0 0 1.1 KB
master SendReceive net472 2.14μs 1.99ns 7.7ns 0.177 0 0 1.12 KB
#4932 SendReceive net6.0 1.41μs 1.13ns 4.36ns 0.0153 0 0 1.1 KB
#4932 SendReceive netcoreapp3.1 1.74μs 0.702ns 2.72ns 0.0148 0 0 1.1 KB
#4932 SendReceive net472 2.31μs 1.59ns 6.16ns 0.177 0 0 1.12 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 2.71μs 0.524ns 1.89ns 0.0217 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.87μs 0.762ns 2.85ns 0.0212 0 0 1.58 KB
master EnrichedLog net472 4.5μs 2ns 7.74ns 0.311 0 0 1.97 KB
#4932 EnrichedLog net6.0 2.82μs 1.18ns 4.41ns 0.0211 0 0 1.53 KB
#4932 EnrichedLog netcoreapp3.1 3.84μs 1.97ns 7.61ns 0.0214 0 0 1.58 KB
#4932 EnrichedLog net472 4.13μs 0.936ns 3.5ns 0.311 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4932

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.133 546.16 618.88

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 508ns 0.162ns 0.627ns 0.00736 0 0 536 B
master StartFinishSpan netcoreapp3.1 687ns 0.192ns 0.691ns 0.00736 0 0 536 B
master StartFinishSpan net472 761ns 0.589ns 2.28ns 0.0853 0 0 538 B
master StartFinishScope net6.0 546ns 0.195ns 0.755ns 0.00929 0 0 656 B
master StartFinishScope netcoreapp3.1 894ns 0.287ns 1.11ns 0.00886 0 0 656 B
master StartFinishScope net472 974ns 0.585ns 2.26ns 0.098 0 0 618 B
#4932 StartFinishSpan net6.0 467ns 0.126ns 0.489ns 0.00749 0 0 536 B
#4932 StartFinishSpan netcoreapp3.1 676ns 0.208ns 0.752ns 0.00714 0 0 536 B
#4932 StartFinishSpan net472 764ns 0.36ns 1.39ns 0.0854 0 0 538 B
#4932 StartFinishScope net6.0 619ns 0.368ns 1.43ns 0.00928 0 0 656 B
#4932 StartFinishScope netcoreapp3.1 844ns 0.41ns 1.59ns 0.00873 0 0 656 B
#4932 StartFinishScope net472 954ns 1.19ns 4.59ns 0.0978 0 0 618 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 710ns 0.26ns 0.972ns 0.00917 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 960ns 0.311ns 1.21ns 0.00899 0 0 656 B
master RunOnMethodBegin net472 1.04μs 0.519ns 2.01ns 0.098 0 0 618 B
#4932 RunOnMethodBegin net6.0 717ns 0.241ns 0.932ns 0.00895 0 0 656 B
#4932 RunOnMethodBegin netcoreapp3.1 952ns 0.475ns 1.78ns 0.00903 0 0 656 B
#4932 RunOnMethodBegin net472 1.1μs 0.982ns 3.8ns 0.0979 0 0 618 B

@anna-git anna-git merged commit 1086804 into master Nov 28, 2023
56 checks passed
@anna-git anna-git deleted the anna/asm/downgrade-log-middleware branch November 28, 2023 14:57
@github-actions github-actions bot added this to the vNext milestone Nov 28, 2023
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.

3 participants