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] Fix WebApi blocking on Response #6488

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

e-n-0
Copy link
Member

@e-n-0 e-n-0 commented Dec 30, 2024

Summary of changes

Fixed the blocking on Response on WebApi.

When inside the HttpTracingModule, in the end method, if we want to block the request, the previous code would throw a BlockException, and is catch bu the tracing module and not the user code.

Tests

New tests have been added on WebApi to check if the blocking iss triggered.

Reason for change

Jira ticket.

@github-actions github-actions bot added area:tests unit tests, integration tests area:asm labels Dec 30, 2024
@andrewlock
Copy link
Member

andrewlock commented Dec 30, 2024

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 (6488) - mean (69ms)  : 66, 71
     .   : milestone, 69,
    master - mean (68ms)  : 66, 71
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (978ms)  : 957, 999
     .   : milestone, 978,
    master - mean (971ms)  : 955, 988
     .   : milestone, 971,

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

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (677ms)  : 661, 693
     .   : milestone, 677,
    master - mean (673ms)  : 654, 692
     .   : milestone, 673,

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

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (627ms)  : 612, 641
     .   : milestone, 627,
    master - mean (627ms)  : 612, 641
     .   : milestone, 627,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6488) - mean (193ms)  : 187, 200
     .   : milestone, 193,
    master - mean (194ms)  : 189, 198
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (1,097ms)  : 1068, 1126
     .   : milestone, 1097,
    master - mean (1,099ms)  : 1064, 1135
     .   : milestone, 1099,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6488) - mean (277ms)  : 273, 282
     .   : milestone, 277,
    master - mean (279ms)  : 274, 283
     .   : milestone, 279,

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (871ms)  : 838, 904
     .   : milestone, 871,
    master - mean (869ms)  : 842, 896
     .   : milestone, 869,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6488) - mean (267ms)  : 263, 272
     .   : milestone, 267,
    master - mean (267ms)  : 263, 270
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (6488) - mean (843ms)  : 812, 874
     .   : milestone, 843,
    master - mean (849ms)  : 814, 883
     .   : milestone, 849,

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 30, 2024

Datadog Report

Branch report: flavien/asm/webapi-tests
Commit report: c4c412a
Test service: dd-trace-dotnet

✅ 0 Failed, 237763 Passed, 2006 Skipped, 19h 29m 20.17s Total Time

@andrewlock
Copy link
Member

andrewlock commented Dec 30, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #6488 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.157
  • 1 benchmarks are slower, with geometric mean 1.126
  • 3 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.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6488

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 1.126 274,704.16 309,255.35

Faster 🎉 in #6488

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net6.0 1.157 159.73 138.10

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 206μs 74.1ns 277ns 2.67 0 0 188.76 KB
master AllCycleSimpleBody netcoreapp3.1 306μs 177ns 686ns 2.74 0 0 196.09 KB
master AllCycleSimpleBody net472 267μs 349ns 1.35μs 35.8 1.99 0 225.78 KB
master AllCycleMoreComplexBody net6.0 211μs 274ns 1.06μs 2.76 0 0 192.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 311μs 159ns 614ns 2.65 0 0 199.5 KB
master AllCycleMoreComplexBody net472 275μs 194ns 698ns 36.4 2.06 0 229.3 KB
master ObjectExtractorSimpleBody net6.0 160ns 0.138ns 0.533ns 0.00395 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 188ns 0.157ns 0.586ns 0.00378 0 0 272 B
master ObjectExtractorSimpleBody net472 163ns 0.178ns 0.691ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.93μs 0.763ns 2.85ns 0.0542 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.71μs 3.37ns 13.1ns 0.0503 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.63μs 4.24ns 16.4ns 0.603 0.00724 0 3.8 KB
#6488 AllCycleSimpleBody net6.0 205μs 83.7ns 313ns 2.67 0 0 188.76 KB
#6488 AllCycleSimpleBody netcoreapp3.1 304μs 167ns 647ns 2.73 0 0 196.09 KB
#6488 AllCycleSimpleBody net472 268μs 184ns 637ns 35.8 2.01 0 225.79 KB
#6488 AllCycleMoreComplexBody net6.0 211μs 147ns 550ns 2.74 0 0 192.27 KB
#6488 AllCycleMoreComplexBody netcoreapp3.1 320μs 104ns 374ns 2.72 0 0 199.51 KB
#6488 AllCycleMoreComplexBody net472 309μs 95.7ns 358ns 36.3 2.09 0 229.3 KB
#6488 ObjectExtractorSimpleBody net6.0 138ns 0.147ns 0.551ns 0.00391 0 0 280 B
#6488 ObjectExtractorSimpleBody netcoreapp3.1 189ns 0.151ns 0.586ns 0.0037 0 0 272 B
#6488 ObjectExtractorSimpleBody net472 165ns 0.134ns 0.501ns 0.0446 0 0 281 B
#6488 ObjectExtractorMoreComplexBody net6.0 2.96μs 1.65ns 6.17ns 0.0531 0 0 3.78 KB
#6488 ObjectExtractorMoreComplexBody netcoreapp3.1 3.77μs 2.09ns 7.83ns 0.049 0 0 3.69 KB
#6488 ObjectExtractorMoreComplexBody net472 3.61μs 2.62ns 10.2ns 0.603 0.0072 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 39μs 19.8ns 76.7ns 0.454 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.4μs 27.2ns 102ns 0.43 0 0 32.4 KB
master EncodeArgs net472 66.8μs 65.1ns 243ns 5.15 0.0665 0 32.5 KB
master EncodeLegacyArgs net6.0 76.2μs 23.2ns 83.7ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 106μs 339ns 1.31μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 155μs 171ns 664ns 0.308 0 0 2.15 KB
#6488 EncodeArgs net6.0 38.1μs 19.7ns 76.2ns 0.456 0 0 32.4 KB
#6488 EncodeArgs netcoreapp3.1 55.7μs 42.8ns 160ns 0.445 0 0 32.4 KB
#6488 EncodeArgs net472 66μs 32.9ns 127ns 5.16 0.0661 0 32.5 KB
#6488 EncodeLegacyArgs net6.0 80.7μs 76.2ns 295ns 0 0 0 2.14 KB
#6488 EncodeLegacyArgs netcoreapp3.1 108μs 119ns 459ns 0 0 0 2.14 KB
#6488 EncodeLegacyArgs net472 156μs 100ns 387ns 0.312 0 0 2.15 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 RunWafRealisticBenchmark net6.0 173μs 119ns 462ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 98.2ns 354ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 200μs 109ns 423ns 0.3 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 104ns 390ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 131ns 508ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 134μs 95.4ns 357ns 0.2 0 0 1.49 KB
#6488 RunWafRealisticBenchmark net6.0 174μs 127ns 490ns 0 0 0 2.44 KB
#6488 RunWafRealisticBenchmark netcoreapp3.1 189μs 272ns 1.05μs 0 0 0 2.39 KB
#6488 RunWafRealisticBenchmark net472 200μs 101ns 390ns 0.3 0 0 2.46 KB
#6488 RunWafRealisticBenchmarkWithAttack net6.0 118μs 124ns 480ns 0 0 0 1.47 KB
#6488 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 125μs 242ns 939ns 0 0 0 1.46 KB
#6488 RunWafRealisticBenchmarkWithAttack net472 134μs 81.9ns 317ns 0.2 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6488

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.22 KB 61.9 KB 2.67 KB 4.51%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 254.68 KB 264.46 KB 9.78 KB 3.84%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 271.74 KB 278.53 KB 6.78 KB 2.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 56.2μs 590ns 5.84μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.6μs 258ns 1.06μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 75.1ns 271ns 0 0 0 59.22 KB
master StringConcatAspectBenchmark net6.0 308μs 1.7μs 10.2μs 0 0 0 254.51 KB
master StringConcatAspectBenchmark netcoreapp3.1 340μs 1.88μs 12.6μs 0 0 0 254.68 KB
master StringConcatAspectBenchmark net472 282μs 5.42μs 52.5μs 0 0 0 271.74 KB
#6488 StringConcatBenchmark net6.0 60.5μs 701ns 6.9μs 0 0 0 43.44 KB
#6488 StringConcatBenchmark netcoreapp3.1 53.5μs 214ns 741ns 0 0 0 42.64 KB
#6488 StringConcatBenchmark net472 37.5μs 108ns 403ns 0 0 0 61.9 KB
#6488 StringConcatAspectBenchmark net6.0 312μs 1.79μs 13.8μs 0 0 0 254.51 KB
#6488 StringConcatAspectBenchmark netcoreapp3.1 351μs 1.65μs 6.41μs 0 0 0 264.46 KB
#6488 StringConcatAspectBenchmark net472 270μs 4.65μs 45.5μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

andrewlock commented Dec 30, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6488 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.195
  • 3 benchmarks are slower, with geometric mean 1.182
  • 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 ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.95μs 44.7ns 313ns 0.0155 0.00774 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 54.4ns 283ns 0.0214 0.0107 0 5.8 KB
master StartStopWithChild net472 16.2μs 41.8ns 157ns 1.04 0.309 0.0975 6.21 KB
#6488 StartStopWithChild net6.0 8.1μs 45.9ns 325ns 0.0154 0.00768 0 5.61 KB
#6488 StartStopWithChild netcoreapp3.1 10μs 52.9ns 265ns 0.0195 0.00977 0 5.8 KB
#6488 StartStopWithChild net472 16.3μs 54.6ns 189ns 1.03 0.31 0.0955 6.21 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 306ns 1.14μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 672μs 424ns 1.59μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 852μs 563ns 2.18μs 0.434 0 0 3.3 KB
#6488 WriteAndFlushEnrichedTraces net6.0 480μs 494ns 1.78μs 0 0 0 2.7 KB
#6488 WriteAndFlushEnrichedTraces netcoreapp3.1 661μs 392ns 1.52μs 0 0 0 2.7 KB
#6488 WriteAndFlushEnrichedTraces net472 855μs 606ns 2.27μs 0.425 0 0 3.3 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 152μs 914ns 8.81μs 0.147 0 0 14.47 KB
master SendRequest netcoreapp3.1 179μs 1.06μs 10.5μs 0.168 0 0 17.27 KB
master SendRequest net472 0.000156ns 0.000149ns 0.000559ns 0 0 0 0 b
#6488 SendRequest net6.0 153μs 982ns 9.57μs 0.142 0 0 14.47 KB
#6488 SendRequest netcoreapp3.1 175μs 1.02μs 9.9μs 0.157 0 0 17.27 KB
#6488 SendRequest net472 0.000272ns 0.000244ns 0.000881ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6488

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.217 668,084.73 812,824.39 bimodal

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 581μs 2.91μs 17.2μs 0.566 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 671μs 3.8μs 25.8μs 0.342 0 0 41.75 KB
master WriteAndFlushEnrichedTraces net472 827μs 3.23μs 12.5μs 8.12 2.44 0.406 53.26 KB
#6488 WriteAndFlushEnrichedTraces net6.0 647μs 6.14μs 60.7μs 0.595 0 0 41.73 KB
#6488 WriteAndFlushEnrichedTraces netcoreapp3.1 812μs 10μs 100μs 0.327 0 0 41.71 KB
#6488 WriteAndFlushEnrichedTraces net472 887μs 5.21μs 49.5μs 8.21 2.28 0.456 53.31 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.31μs 1.56ns 5.84ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 1.56ns 5.82ns 0.0132 0 0 1.02 KB
master ExecuteNonQuery net472 2.09μs 2.11ns 8.16ns 0.156 0.00104 0 987 B
#6488 ExecuteNonQuery net6.0 1.33μs 1.57ns 6.09ns 0.0141 0 0 1.02 KB
#6488 ExecuteNonQuery netcoreapp3.1 1.76μs 1.42ns 5.3ns 0.0132 0 0 1.02 KB
#6488 ExecuteNonQuery net472 2.08μs 1.63ns 6.09ns 0.156 0.00103 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.27μs 1.13ns 4.06ns 0.0139 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.55μs 0.854ns 3.31ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.54μs 2.07ns 8.03ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.29μs 0.916ns 3.55ns 0.0129 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.68μs 0.885ns 3.31ns 0.0142 0 0 1.02 KB
master CallElasticsearchAsync net472 2.76μs 1.14ns 4.1ns 0.167 0 0 1.05 KB
#6488 CallElasticsearch net6.0 1.2μs 0.623ns 2.33ns 0.0138 0 0 976 B
#6488 CallElasticsearch netcoreapp3.1 1.49μs 1.19ns 4.6ns 0.0134 0 0 976 B
#6488 CallElasticsearch net472 2.59μs 1.53ns 5.93ns 0.158 0 0 995 B
#6488 CallElasticsearchAsync net6.0 1.32μs 1.39ns 5.2ns 0.0132 0 0 952 B
#6488 CallElasticsearchAsync netcoreapp3.1 1.72μs 1.96ns 7.33ns 0.0138 0 0 1.02 KB
#6488 CallElasticsearchAsync net472 2.66μs 1.59ns 6.15ns 0.167 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6488

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.121 1,450.15 1,293.09

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.45μs 0.748ns 2.8ns 0.0126 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.57μs 0.935ns 3.24ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.84μs 0.41ns 1.53ns 0.145 0 0 915 B
#6488 ExecuteAsync net6.0 1.29μs 0.529ns 1.98ns 0.013 0 0 952 B
#6488 ExecuteAsync netcoreapp3.1 1.68μs 0.389ns 1.4ns 0.0126 0 0 952 B
#6488 ExecuteAsync net472 1.83μs 0.544ns 1.96ns 0.145 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 4.52μs 1.72ns 6.45ns 0.0318 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.46μs 2.07ns 7.48ns 0.0379 0 0 2.85 KB
master SendAsync net472 7.44μs 2.67ns 10.4ns 0.495 0 0 3.12 KB
#6488 SendAsync net6.0 4.46μs 9.22ns 35.7ns 0.031 0 0 2.31 KB
#6488 SendAsync netcoreapp3.1 5.23μs 0.77ns 2.78ns 0.0367 0 0 2.85 KB
#6488 SendAsync net472 7.32μs 1.82ns 7.06ns 0.493 0 0 3.12 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.54μs 0.867ns 3.24ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.19μs 1.5ns 5.21ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.68μs 2.19ns 8.21ns 0.25 0 0 1.57 KB
#6488 EnrichedLog net6.0 1.46μs 0.595ns 2.31ns 0.023 0 0 1.64 KB
#6488 EnrichedLog netcoreapp3.1 2.24μs 0.773ns 2.79ns 0.0224 0 0 1.64 KB
#6488 EnrichedLog net472 2.73μs 2.8ns 10.8ns 0.249 0 0 1.57 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 117μs 154ns 575ns 0.0585 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 122μs 92.7ns 359ns 0 0 0 4.28 KB
master EnrichedLog net472 152μs 163ns 632ns 0.682 0.227 0 4.46 KB
#6488 EnrichedLog net6.0 118μs 430ns 1.66μs 0.0594 0 0 4.28 KB
#6488 EnrichedLog netcoreapp3.1 123μs 109ns 423ns 0 0 0 4.28 KB
#6488 EnrichedLog net472 153μs 178ns 691ns 0.688 0.229 0 4.46 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.99μs 2.08ns 8.05ns 0.0299 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.22μs 1.27ns 4.93ns 0.0296 0 0 2.2 KB
master EnrichedLog net472 4.89μs 1.04ns 4.02ns 0.32 0 0 2.02 KB
#6488 EnrichedLog net6.0 3.07μs 1.14ns 4.28ns 0.0308 0 0 2.2 KB
#6488 EnrichedLog netcoreapp3.1 4.19μs 2.9ns 11.2ns 0.0293 0 0 2.2 KB
#6488 EnrichedLog net472 4.98μs 1.11ns 4.3ns 0.32 0 0 2.02 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.35μs 0.556ns 2.08ns 0.0163 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.79μs 0.545ns 1.96ns 0.0152 0 0 1.14 KB
master SendReceive net472 2.1μs 0.953ns 3.57ns 0.183 0 0 1.16 KB
#6488 SendReceive net6.0 1.39μs 0.741ns 2.87ns 0.0159 0 0 1.14 KB
#6488 SendReceive netcoreapp3.1 1.77μs 0.689ns 2.58ns 0.0149 0 0 1.14 KB
#6488 SendReceive net472 2.13μs 0.575ns 2.15ns 0.184 0 0 1.16 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.62μs 1.21ns 4.69ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.69μs 1.54ns 5.75ns 0.0221 0 0 1.65 KB
master EnrichedLog net472 4.27μs 2.98ns 11.5ns 0.322 0 0 2.04 KB
#6488 EnrichedLog net6.0 2.64μs 0.932ns 3.61ns 0.0224 0 0 1.6 KB
#6488 EnrichedLog netcoreapp3.1 3.82μs 1.67ns 6.48ns 0.0211 0 0 1.65 KB
#6488 EnrichedLog net472 4.42μs 4.55ns 17.6ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6488

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.193 548.41 654.37
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.137 403.01 458.34

Faster 🎉 in #6488

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.272 615.68 483.91

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 403ns 0.525ns 2.03ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 548ns 0.706ns 2.73ns 0.00773 0 0 576 B
master StartFinishSpan net472 703ns 1.3ns 5.03ns 0.0917 0 0 578 B
master StartFinishScope net6.0 615ns 0.705ns 2.73ns 0.00983 0 0 696 B
master StartFinishScope netcoreapp3.1 713ns 1.13ns 4.38ns 0.00925 0 0 696 B
master StartFinishScope net472 837ns 1.9ns 7.1ns 0.104 0 0 658 B
#6488 StartFinishSpan net6.0 458ns 0.714ns 2.76ns 0.00794 0 0 576 B
#6488 StartFinishSpan netcoreapp3.1 654ns 1.19ns 4.61ns 0.00767 0 0 576 B
#6488 StartFinishSpan net472 713ns 1.08ns 4.17ns 0.0915 0 0 578 B
#6488 StartFinishScope net6.0 484ns 0.761ns 2.95ns 0.00981 0 0 696 B
#6488 StartFinishScope netcoreapp3.1 765ns 0.563ns 2.18ns 0.00946 0 0 696 B
#6488 StartFinishScope net472 797ns 1.46ns 5.47ns 0.104 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 581ns 0.779ns 3.02ns 0.00973 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 886ns 1.87ns 7.23ns 0.00934 0 0 696 B
master RunOnMethodBegin net472 1.16μs 1.17ns 4.51ns 0.104 0 0 658 B
#6488 RunOnMethodBegin net6.0 607ns 0.846ns 3.28ns 0.0097 0 0 696 B
#6488 RunOnMethodBegin netcoreapp3.1 916ns 0.902ns 3.38ns 0.00931 0 0 696 B
#6488 RunOnMethodBegin net472 1.12μs 1.59ns 6.15ns 0.104 0 0 658 B

@e-n-0 e-n-0 force-pushed the flavien/asm/webapi-tests branch from d4b0f93 to 59d31cc Compare December 30, 2024 14:55
Copy link
Contributor

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

1 occurrences of :

-      _dd.appsec.fp.http.header: hdr-0100000000-3626b5f8-1-4740ae63,
+      _dd.appsec.fp.http.header: hdr-0000000000-3626b5f8-1-4740ae63,

@e-n-0 e-n-0 force-pushed the flavien/asm/webapi-tests branch from 59d31cc to 94d998d Compare December 30, 2024 15:24
@e-n-0 e-n-0 force-pushed the flavien/asm/webapi-tests branch from 94d998d to fce6751 Compare December 30, 2024 16:23
@e-n-0 e-n-0 marked this pull request as ready for review December 31, 2024 13:40
@e-n-0 e-n-0 requested a review from a team as a code owner December 31, 2024 13:40
@e-n-0 e-n-0 requested a review from a team as a code owner January 6, 2025 17:40
@e-n-0 e-n-0 changed the title [ASM] Add WebApi path param and body blocking tests [ASM] Fix WebApi blocking on Response Jan 6, 2025
@e-n-0 e-n-0 force-pushed the flavien/asm/webapi-tests branch from 2dd7ad6 to c4c412a Compare January 7, 2025 15:37
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.

Nice, simple solution to what could have been a difficult problem.

Copy link
Contributor

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants