DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
456 stars 142 forks source link

[ASM] Add new capabilities for RC #6008

Closed NachoEchevarria closed 2 months ago

NachoEchevarria commented 2 months ago

Summary of changes

This PR adds a capabilities helper to manage the ASM RC capabilities. The capabilities for suspicious attacker blocking and RASP have been added.

In a next PR, the required WAF versions for other capabilities will be added.

Reason for change

We should report that we support these capabilities.

Implementation details

Test coverage

Unit tests have been added.

Other details

datadog-ddstaging[bot] commented 2 months ago

Datadog Report

Branch report: nacho/RCMCapabilitiesReporting Commit report: 69bcdd3 Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 360874 Passed, 2058 Skipped, 16h 12m 27.79s Total Time

andrewlock commented 2 months ago

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:

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 (6008) - mean (69ms)  : 67, 72
     .   : milestone, 69,
    master - mean (71ms)  : 67, 75
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (1,094ms)  : 1059, 1129
     .   : milestone, 1094,
    master - mean (1,085ms)  : 1060, 1110
     .   : milestone, 1085,
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6008) - mean (109ms)  : 105, 114
     .   : milestone, 109,
    master - mean (110ms)  : 106, 114
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (758ms)  : 737, 780
     .   : milestone, 758,
    master - mean (759ms)  : 741, 778
     .   : milestone, 759,
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6008) - mean (92ms)  : 89, 95
     .   : milestone, 92,
    master - mean (93ms)  : 89, 97
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (710ms)  : 686, 733
     .   : milestone, 710,
    master - mean (712ms)  : 692, 732
     .   : milestone, 712,
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6008) - mean (191ms)  : 187, 196
     .   : milestone, 191,
    master - mean (190ms)  : 186, 194
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (1,163ms)  : 1138, 1189
     .   : milestone, 1163,
    master - mean (1,165ms)  : 1135, 1194
     .   : milestone, 1165,
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6008) - mean (274ms)  : 270, 279
     .   : milestone, 274,
    master - mean (276ms)  : 272, 280
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (918ms)  : 898, 938
     .   : milestone, 918,
    master - mean (927ms)  : 906, 947
     .   : milestone, 927,
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6008) - mean (265ms)  : 260, 271
     .   : milestone, 265,
    master - mean (265ms)  : 261, 268
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (6008) - mean (905ms)  : 888, 922
     .   : milestone, 905,
    master - mean (905ms)  : 876, 934
     .   : milestone, 905,
andrewlock commented 2 months ago

Benchmarks Report for appsec :snail:

Benchmarks for #6008 compared to master:

The following thresholds were used for comparing the benchmark speeds:

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.Asm.AppSecBodyBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleSimpleBody`|net6.0|73.8μs|92.6ns|359ns|0.0766| 0|0|6.01 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleSimpleBody`|netcoreapp3.1|62.8μs|41.2ns|159ns|0.0944| 0|0|6.95 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleSimpleBody`|net472|49μs|59.9ns|224ns|1.32| 0|0|8.34 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleMoreComplexBody`|net6.0|79.7μs|76.2ns|285ns|0.119| 0|0|9.51 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleMoreComplexBody`|netcoreapp3.1|68.1μs|95.7ns|358ns|0.136| 0|0|10.37 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`AllCycleMoreComplexBody`|net472|56.4μs|79.8ns|309ns|1.86| 0.0282|0|11.85 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorSimpleBody`|net6.0|139ns|0.087ns|0.326ns|0.00392| 0|0|280 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorSimpleBody`|netcoreapp3.1|223ns|0.259ns|1ns|0.00371| 0|0|272 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorSimpleBody`|net472|166ns|0.184ns|0.712ns|0.0446| 0|0|281 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorMoreComplexBody`|net6.0|3.12μs|1.79ns|6.91ns|0.0531| 0|0|3.78 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorMoreComplexBody`|netcoreapp3.1|4.04μs|1.58ns|5.92ns|0.0504| 0|0|3.69 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`ObjectExtractorMoreComplexBody`|net472|4.46μs|1.15ns|4.14ns|0.603| 0.0067|0|3.8 KB| |#6008|`AllCycleSimpleBody`|net6.0|71.9μs|102ns|397ns|0.0716| 0|0|6.01 KB| |#6008|`AllCycleSimpleBody`|netcoreapp3.1|61.3μs|109ns|423ns|0.092| 0|0|6.95 KB| |#6008|`AllCycleSimpleBody`|net472|48.3μs|24.8ns|92.6ns|1.32| 0|0|8.34 KB| |#6008|`AllCycleMoreComplexBody`|net6.0|77.4μs|131ns|509ns|0.116| 0|0|9.51 KB| |#6008|`AllCycleMoreComplexBody`|netcoreapp3.1|70.2μs|50.5ns|189ns|0.141| 0|0|10.37 KB| |#6008|`AllCycleMoreComplexBody`|net472|56.7μs|39.1ns|152ns|1.86| 0.0282|0|11.85 KB| |#6008|`ObjectExtractorSimpleBody`|net6.0|147ns|0.0997ns|0.373ns|0.00398| 0|0|280 B| |#6008|`ObjectExtractorSimpleBody`|netcoreapp3.1|203ns|0.143ns|0.516ns|0.00373| 0|0|272 B| |#6008|`ObjectExtractorSimpleBody`|net472|174ns|0.328ns|1.27ns|0.0446| 0|0|281 B| |#6008|`ObjectExtractorMoreComplexBody`|net6.0|3.06μs|3.41ns|13.2ns|0.0522| 0|0|3.78 KB| |#6008|`ObjectExtractorMoreComplexBody`|netcoreapp3.1|3.89μs|4.69ns|18.2ns|0.0485| 0|0|3.69 KB| |#6008|`ObjectExtractorMoreComplexBody`|net472|4.52μs|2.85ns|11ns|0.603| 0.00451|0|3.8 KB|
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeArgs`|net6.0|35.7μs|14ns|54.3ns|0.449| 0|0|32.4 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeArgs`|netcoreapp3.1|53.4μs|26.9ns|104ns|0.425| 0|0|32.4 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeArgs`|net472|66.8μs|29.6ns|115ns|5.15| 0.0665|0|32.5 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeLegacyArgs`|net6.0|74μs|400ns|2.3μs|0| 0|0|2.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeLegacyArgs`|netcoreapp3.1|106μs|432ns|1.67μs|0| 0|0|2.15 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`EncodeLegacyArgs`|net472|152μs|57.3ns|222ns|0.307| 0|0|2.15 KB| |#6008|`EncodeArgs`|net6.0|37.3μs|24.8ns|92.8ns|0.446| 0|0|32.4 KB| |#6008|`EncodeArgs`|netcoreapp3.1|54.6μs|33.1ns|128ns|0.436| 0|0|32.4 KB| |#6008|`EncodeArgs`|net472|66.8μs|87.8ns|340ns|5.16| 0.0665|0|32.5 KB| |#6008|`EncodeLegacyArgs`|net6.0|76.5μs|390ns|1.83μs|0.037| 0|0|2.14 KB| |#6008|`EncodeLegacyArgs`|netcoreapp3.1|105μs|376ns|1.46μs|0| 0|0|2.14 KB| |#6008|`EncodeLegacyArgs`|net472|152μs|88.4ns|342ns|0.304| 0|0|2.15 KB|
Benchmarks.Trace.Asm.AppSecWafBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmark`|net6.0|184μs|63.7ns|221ns|0| 0|0|2.42 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmark`|netcoreapp3.1|196μs|65.2ns|252ns|0| 0|0|2.37 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmark`|net472|210μs|58.4ns|226ns|0.312| 0|0|2.43 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmarkWithAttack`|net6.0|123μs|81.8ns|317ns|0| 0|0|1.46 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmarkWithAttack`|netcoreapp3.1|129μs|113ns|438ns|0| 0|0|1.45 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`RunWafRealisticBenchmarkWithAttack`|net472|140μs|81.6ns|316ns|0.209| 0|0|1.48 KB| |#6008|`RunWafRealisticBenchmark`|net6.0|183μs|70.9ns|265ns|0| 0|0|2.42 KB| |#6008|`RunWafRealisticBenchmark`|netcoreapp3.1|197μs|205ns|795ns|0| 0|0|2.37 KB| |#6008|`RunWafRealisticBenchmark`|net472|210μs|114ns|411ns|0.315| 0|0|2.43 KB| |#6008|`RunWafRealisticBenchmarkWithAttack`|net6.0|123μs|118ns|455ns|0| 0|0|1.46 KB| |#6008|`RunWafRealisticBenchmarkWithAttack`|netcoreapp3.1|132μs|182ns|703ns|0| 0|0|1.45 KB| |#6008|`RunWafRealisticBenchmarkWithAttack`|net472|140μs|118ns|458ns|0.209| 0|0|1.48 KB|
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed :heavy_check_mark: More allocations :warning: #### More allocations :warning: in #6008 | Benchmark | Base Allocated | Diff Allocated | Change | Change % | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.04 KB | 59.36 KB | 320 B | 0.54% #### Fewer allocations :tada: in #6008 | Benchmark | Base Allocated | Diff Allocated | Change | Change % | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 264.7 KB | 254.67 KB | -10.03 KB | -3.79% ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatBenchmark`|net6.0|58.9μs|719ns|7.15μs|0| 0|0|43.44 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatBenchmark`|netcoreapp3.1|62.8μs|919ns|9.14μs|0| 0|0|42.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatBenchmark`|net472|37μs|85.6ns|320ns|0| 0|0|59.04 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatAspectBenchmark`|net6.0|308μs|1.59μs|7.29μs|0| 0|0|264.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatAspectBenchmark`|netcoreapp3.1|330μs|1.41μs|5.1μs|0| 0|0|253.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/cfbbeb2608dc08045d9b4f20ad545c381ec1a0b9)|`StringConcatAspectBenchmark`|net472|278μs|6.19μs|60.7μs|0| 0|0|278.53 KB| |#6008|`StringConcatBenchmark`|net6.0|60.1μs|813ns|8.01μs|0| 0|0|43.44 KB| |#6008|`StringConcatBenchmark`|netcoreapp3.1|67.3μs|923ns|9.04μs|0| 0|0|42.64 KB| |#6008|`StringConcatBenchmark`|net472|37μs|82.3ns|297ns|0| 0|0|59.36 KB| |#6008|`StringConcatAspectBenchmark`|net6.0|300μs|5.01μs|49.6μs|0| 0|0|254.67 KB| |#6008|`StringConcatAspectBenchmark`|netcoreapp3.1|331μs|4.81μs|46.9μs|0| 0|0|253.13 KB| |#6008|`StringConcatAspectBenchmark`|net472|291μs|5.94μs|57.9μs|0| 0|0|278.53 KB|
andrewlock commented 2 months ago

Benchmarks Report for tracer :snail:

Benchmarks for #6008 compared to master:

The following thresholds were used for comparing the benchmark speeds:

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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartStopWithChild`|net6.0|7.74μs|43.7ns|324ns|0.0157| 0.00785|0|5.42 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartStopWithChild`|netcoreapp3.1|9.63μs|53.7ns|335ns|0.0191| 0.00955|0|5.62 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartStopWithChild`|net472|16μs|51.9ns|201ns|1.02| 0.311|0.0956|6.06 KB| |#6008|`StartStopWithChild`|net6.0|7.93μs|39.1ns|196ns|0.0117| 0.0039|0|5.43 KB| |#6008|`StartStopWithChild`|netcoreapp3.1|9.87μs|53.3ns|282ns|0.0242| 0.00969|0|5.62 KB| |#6008|`StartStopWithChild`|net472|16.1μs|42.2ns|164ns|1.02| 0.299|0.0946|6.07 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|net6.0|486μs|394ns|1.47μs|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|634μs|261ns|977ns|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|net472|837μs|615ns|2.3μs|0.417| 0|0|3.3 KB| |#6008|`WriteAndFlushEnrichedTraces`|net6.0|469μs|228ns|884ns|0| 0|0|2.7 KB| |#6008|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|636μs|172ns|620ns|0| 0|0|2.7 KB| |#6008|`WriteAndFlushEnrichedTraces`|net472|828μs|727ns|2.72μs|0.414| 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendRequest`|net6.0|199μs|1.16μs|10.1μs|0.152| 0|0|18.45 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendRequest`|netcoreapp3.1|228μs|1.29μs|9.63μs|0.212| 0|0|20.61 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendRequest`|net472|0.00172ns|0.000831ns|0.00322ns|0| 0|0|0 b| |#6008|`SendRequest`|net6.0|201μs|1.21μs|12μs|0.193| 0|0|18.45 KB| |#6008|`SendRequest`|netcoreapp3.1|220μs|1.27μs|10.1μs|0.213| 0|0|20.61 KB| |#6008|`SendRequest`|net472|0.00264ns|0.000759ns|0.00294ns|0| 0|0|0 b|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: Fewer allocations :tada: #### Fewer allocations :tada: in #6008 | Benchmark | Base Allocated | Diff Allocated | Change | Change % | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.72 KB | 41.39 KB | -331 B | -0.79% ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|net6.0|580μs|3.1μs|17.5μs|0.546| 0|0|41.72 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|698μs|3.73μs|21.1μs|0.353| 0|0|41.73 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`WriteAndFlushEnrichedTraces`|net472|882μs|3.99μs|15.4μs|8.13| 2.57|0.428|53.32 KB| |#6008|`WriteAndFlushEnrichedTraces`|net6.0|548μs|1.6μs|6.2μs|0.551| 0|0|41.39 KB| |#6008|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|677μs|3.58μs|21.8μs|0.326| 0|0|41.75 KB| |#6008|`WriteAndFlushEnrichedTraces`|net472|877μs|4.38μs|20.6μs|8.48| 2.23|0.446|53.32 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteNonQuery`|net6.0|1.23μs|1.07ns|4.15ns|0.0147| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteNonQuery`|netcoreapp3.1|1.76μs|1.94ns|7.25ns|0.0133| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteNonQuery`|net472|2.12μs|2.75ns|10.3ns|0.157| 0|0|987 B| |#6008|`ExecuteNonQuery`|net6.0|1.32μs|1.03ns|3.84ns|0.0147| 0|0|1.02 KB| |#6008|`ExecuteNonQuery`|netcoreapp3.1|1.74μs|1.1ns|3.95ns|0.0138| 0|0|1.02 KB| |#6008|`ExecuteNonQuery`|net472|2.04μs|2.14ns|8.29ns|0.157| 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearch`|net6.0|1.34μs|1.03ns|3.99ns|0.0134| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearch`|netcoreapp3.1|1.52μs|1.03ns|3.99ns|0.013| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearch`|net472|2.33μs|2.22ns|8.58ns|0.157| 0|0|995 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearchAsync`|net6.0|1.19μs|0.827ns|3.2ns|0.0131| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearchAsync`|netcoreapp3.1|1.66μs|0.507ns|1.9ns|0.0141| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`CallElasticsearchAsync`|net472|2.46μs|0.969ns|3.5ns|0.166| 0|0|1.05 KB| |#6008|`CallElasticsearch`|net6.0|1.32μs|0.769ns|2.88ns|0.0134| 0|0|976 B| |#6008|`CallElasticsearch`|netcoreapp3.1|1.57μs|1.08ns|4.02ns|0.0134| 0|0|976 B| |#6008|`CallElasticsearch`|net472|2.41μs|1.41ns|5.47ns|0.158| 0|0|995 B| |#6008|`CallElasticsearchAsync`|net6.0|1.19μs|0.573ns|2.22ns|0.0131| 0|0|952 B| |#6008|`CallElasticsearchAsync`|netcoreapp3.1|1.74μs|0.985ns|3.55ns|0.014| 0|0|1.02 KB| |#6008|`CallElasticsearchAsync`|net472|2.52μs|1.35ns|5.22ns|0.166| 0|0|1.05 KB|
Benchmarks.Trace.GraphQLBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteAsync`|net6.0|1.32μs|0.833ns|3.22ns|0.0132| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteAsync`|netcoreapp3.1|1.61μs|0.542ns|2.03ns|0.0129| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`ExecuteAsync`|net472|1.77μs|0.895ns|3.47ns|0.145| 0|0|915 B| |#6008|`ExecuteAsync`|net6.0|1.38μs|0.984ns|3.81ns|0.0131| 0|0|952 B| |#6008|`ExecuteAsync`|netcoreapp3.1|1.69μs|0.723ns|2.71ns|0.0128| 0|0|952 B| |#6008|`ExecuteAsync`|net472|1.73μs|0.826ns|3.2ns|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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendAsync`|net6.0|4.18μs|1.51ns|5.66ns|0.0314| 0|0|2.22 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendAsync`|netcoreapp3.1|5.25μs|10.4ns|37.4ns|0.036| 0|0|2.76 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendAsync`|net472|7.69μs|1.72ns|6.45ns|0.499| 0|0|3.15 KB| |#6008|`SendAsync`|net6.0|4.25μs|1.57ns|5.86ns|0.0297| 0|0|2.22 KB| |#6008|`SendAsync`|netcoreapp3.1|5.16μs|2.97ns|11.5ns|0.0363| 0|0|2.76 KB| |#6008|`SendAsync`|net472|7.78μs|2.94ns|11ns|0.498| 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net6.0|1.47μs|0.436ns|1.63ns|0.0229| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|netcoreapp3.1|2.19μs|1.38ns|5.35ns|0.022| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net472|2.7μs|1.46ns|5.65ns|0.249| 0|0|1.57 KB| |#6008|`EnrichedLog`|net6.0|1.45μs|4.17ns|15ns|0.0232| 0|0|1.64 KB| |#6008|`EnrichedLog`|netcoreapp3.1|2.05μs|1.18ns|4.57ns|0.0225| 0|0|1.64 KB| |#6008|`EnrichedLog`|net472|2.7μs|1.37ns|5.3ns|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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net6.0|114μs|121ns|470ns|0.057| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|netcoreapp3.1|120μs|184ns|711ns|0| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net472|150μs|245ns|949ns|0.669| 0.223|0|4.46 KB| |#6008|`EnrichedLog`|net6.0|114μs|162ns|608ns|0.0573| 0|0|4.28 KB| |#6008|`EnrichedLog`|netcoreapp3.1|120μs|282ns|1.09μs|0.0598| 0|0|4.28 KB| |#6008|`EnrichedLog`|net472|148μs|371ns|1.44μs|0.667| 0.222|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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net6.0|3.09μs|1.44ns|5.56ns|0.031| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|netcoreapp3.1|4.09μs|1.24ns|4.79ns|0.0288| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net472|4.82μs|1.04ns|4.04ns|0.32| 0|0|2.02 KB| |#6008|`EnrichedLog`|net6.0|3.16μs|1.71ns|6.62ns|0.0315| 0|0|2.2 KB| |#6008|`EnrichedLog`|netcoreapp3.1|4.24μs|6.54ns|25.3ns|0.0296| 0|0|2.2 KB| |#6008|`EnrichedLog`|net472|4.87μs|1.89ns|7.34ns|0.319| 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendReceive`|net6.0|1.36μs|1.33ns|4.98ns|0.0163| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendReceive`|netcoreapp3.1|1.74μs|0.9ns|3.48ns|0.0156| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`SendReceive`|net472|2.06μs|1.25ns|4.51ns|0.183| 0|0|1.16 KB| |#6008|`SendReceive`|net6.0|1.36μs|1.99ns|7.69ns|0.0162| 0|0|1.14 KB| |#6008|`SendReceive`|netcoreapp3.1|1.79μs|4.8ns|17.3ns|0.0159| 0|0|1.14 KB| |#6008|`SendReceive`|net472|2.19μs|4.19ns|16.2ns|0.183| 0.0011|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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net6.0|2.75μs|0.835ns|3.13ns|0.022| 0|0|1.6 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|netcoreapp3.1|3.97μs|1.39ns|5.01ns|0.022| 0|0|1.65 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`EnrichedLog`|net472|4.4μs|2.54ns|9.84ns|0.324| 0|0|2.04 KB| |#6008|`EnrichedLog`|net6.0|2.62μs|0.819ns|3.17ns|0.0223| 0|0|1.6 KB| |#6008|`EnrichedLog`|netcoreapp3.1|3.77μs|2.45ns|9.16ns|0.0207| 0|0|1.65 KB| |#6008|`EnrichedLog`|net472|4.38μs|3.17ns|12.3ns|0.324| 0|0|2.04 KB|
Benchmarks.Trace.SpanBenchmark - Faster :tada: Same allocations :heavy_check_mark: #### Faster :tada: in #6008 | Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.140 | 454.94 | 399.08 | ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishSpan`|net6.0|455ns|0.254ns|0.984ns|0.0081| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishSpan`|netcoreapp3.1|609ns|0.561ns|2.17ns|0.00758| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishSpan`|net472|609ns|1.13ns|4.4ns|0.0917| 0|0|578 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishScope`|net6.0|534ns|0.599ns|2.32ns|0.0097| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishScope`|netcoreapp3.1|744ns|1.54ns|5.96ns|0.00952| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`StartFinishScope`|net472|914ns|1.46ns|5.66ns|0.104| 0|0|658 B| |#6008|`StartFinishSpan`|net6.0|399ns|0.145ns|0.543ns|0.008| 0|0|576 B| |#6008|`StartFinishSpan`|netcoreapp3.1|669ns|0.236ns|0.914ns|0.00766| 0|0|576 B| |#6008|`StartFinishSpan`|net472|612ns|0.105ns|0.407ns|0.0918| 0|0|578 B| |#6008|`StartFinishScope`|net6.0|482ns|0.306ns|1.18ns|0.0097| 0|0|696 B| |#6008|`StartFinishScope`|netcoreapp3.1|810ns|0.31ns|1.12ns|0.00944| 0|0|696 B| |#6008|`StartFinishScope`|net472|824ns|2.32ns|8.98ns|0.105| 0|0|658 B|
Benchmarks.Trace.TraceAnnotationsBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`RunOnMethodBegin`|net6.0|651ns|0.175ns|0.629ns|0.00972| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`RunOnMethodBegin`|netcoreapp3.1|868ns|0.819ns|3.17ns|0.00948| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/08820b8b1d5c3d3eeafc62196c9c6853adde25d8)|`RunOnMethodBegin`|net472|1.1μs|0.901ns|3.49ns|0.104| 0|0|658 B| |#6008|`RunOnMethodBegin`|net6.0|651ns|0.632ns|2.45ns|0.00985| 0|0|696 B| |#6008|`RunOnMethodBegin`|netcoreapp3.1|931ns|1.02ns|3.96ns|0.00954| 0|0|696 B| |#6008|`RunOnMethodBegin`|net472|1.13μs|0.595ns|2.31ns|0.104| 0|0|658 B|
andrewlock commented 2 months ago

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 (6008) (11.138M)   : 0, 11138359
    master (11.202M)   : 0, 11202155
    benchmarks/2.9.0 (11.142M)   : 0, 11142344

    section Automatic
    This PR (6008) (7.444M)   : 0, 7444052
    master (7.437M)   : 0, 7437019
    benchmarks/2.9.0 (7.893M)   : 0, 7893301

    section Trace stats
    master (7.824M)   : 0, 7824309

    section Manual
    master (11.306M)   : 0, 11305639

    section Manual + Automatic
    This PR (6008) (6.896M)   : 0, 6896031
    master (6.918M)   : 0, 6917708

    section DD_TRACE_ENABLED=0
    master (10.325M)   : 0, 10325290
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6008) (9.303M)   : 0, 9302813
    master (9.731M)   : 0, 9730961
    benchmarks/2.9.0 (9.585M)   : 0, 9584514

    section Automatic
    This PR (6008) (6.567M)   : 0, 6567068
    master (6.575M)   : 0, 6574988

    section Trace stats
    master (7.001M)   : 0, 7000523

    section Manual
    master (9.504M)   : 0, 9504255

    section Manual + Automatic
    This PR (6008) (5.994M)   : 0, 5994167
    master (6.217M)   : 0, 6216600

    section DD_TRACE_ENABLED=0
    master (9.049M)   : 0, 9048961
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6008) (10.145M)   : 0, 10144854
    master (10.040M)   : 0, 10040090
    benchmarks/2.9.0 (10.094M)   : 0, 10093850

    section Automatic
    This PR (6008) (6.805M)   : 0, 6804831
    master (6.783M)   : 0, 6782944
    benchmarks/2.9.0 (7.257M)   : 0, 7257483

    section Trace stats
    master (7.323M)   : 0, 7323194

    section Manual
    master (10.061M)   : 0, 10060796

    section Manual + Automatic
    This PR (6008) (6.486M)   : 0, 6486305
    master (6.342M)   : 0, 6342001

    section DD_TRACE_ENABLED=0
    master (9.357M)   : 0, 9357055
NachoEchevarria commented 2 months ago

Thanks for the reviews!!!