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] Update Iast Log Warning to Error #6492

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

e-n-0
Copy link
Member

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

Summary of changes

Change Iast.Log.Warning(..) to .Error(..) in try catch blocks of Aspects.

Reason for change

Improve error logging. These errors could be shown in the Error Tracking telemetry.

@e-n-0 e-n-0 requested a review from a team as a code owner December 31, 2024 17:11
@github-actions github-actions bot added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:asm labels Dec 31, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 31, 2024

Datadog Report

Branch report: flavien/update-aspects-log-error
Commit report: 1c35fa8
Test service: dd-trace-dotnet

✅ 0 Failed, 229704 Passed, 2078 Skipped, 18h 52m 19.21s Total 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 (6492) - mean (68ms)  : 65, 71
     .   : milestone, 68,
    master - mean (68ms)  : 66, 71
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (981ms)  : 958, 1004
     .   : milestone, 981,
    master - mean (980ms)  : 955, 1006
     .   : milestone, 980,

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

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (674ms)  : 662, 687
     .   : milestone, 674,
    master - mean (677ms)  : 664, 689
     .   : milestone, 677,

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

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (627ms)  : 613, 642
     .   : milestone, 627,
    master - mean (630ms)  : 611, 649
     .   : milestone, 630,

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

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (1,097ms)  : 1072, 1122
     .   : milestone, 1097,
    master - mean (1,100ms)  : 1078, 1122
     .   : milestone, 1100,

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

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (868ms)  : 849, 887
     .   : milestone, 868,
    master - mean (872ms)  : 843, 900
     .   : milestone, 872,

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

    section CallTarget+Inlining+NGEN
    This PR (6492) - mean (843ms)  : 811, 875
     .   : milestone, 843,
    master - mean (850ms)  : 823, 878
     .   : milestone, 850,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6492 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.863
  • 1 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 - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 201μs 136ns 510ns 2.55 0 0 188.76 KB
master AllCycleSimpleBody netcoreapp3.1 297μs 83.2ns 311ns 2.69 0 0 196.09 KB
master AllCycleSimpleBody net472 274μs 279ns 1.08μs 35.8 2.05 0 225.78 KB
master AllCycleMoreComplexBody net6.0 212μs 793ns 3.07μs 2.73 0 0 192.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 310μs 117ns 436ns 2.64 0 0 199.5 KB
master AllCycleMoreComplexBody net472 278μs 242ns 939ns 36.4 2.08 0 229.3 KB
master ObjectExtractorSimpleBody net6.0 139ns 0.0852ns 0.33ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 189ns 0.0791ns 0.285ns 0.00372 0 0 272 B
master ObjectExtractorSimpleBody net472 169ns 0.249ns 0.966ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.83μs 1.27ns 4.74ns 0.053 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.75μs 2.78ns 10.4ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.6μs 3.71ns 14.4ns 0.602 0.00541 0 3.8 KB
#6492 AllCycleSimpleBody net6.0 205μs 123ns 475ns 2.65 0 0 188.76 KB
#6492 AllCycleSimpleBody netcoreapp3.1 305μs 123ns 460ns 2.72 0 0 196.09 KB
#6492 AllCycleSimpleBody net472 278μs 143ns 537ns 35.8 1.97 0 225.79 KB
#6492 AllCycleMoreComplexBody net6.0 211μs 157ns 609ns 2.73 0 0 192.26 KB
#6492 AllCycleMoreComplexBody netcoreapp3.1 318μs 167ns 603ns 2.7 0 0 199.51 KB
#6492 AllCycleMoreComplexBody net472 280μs 521ns 2.02μs 36.3 2.08 0 229.3 KB
#6492 ObjectExtractorSimpleBody net6.0 140ns 0.0958ns 0.371ns 0.00394 0 0 280 B
#6492 ObjectExtractorSimpleBody netcoreapp3.1 192ns 0.181ns 0.701ns 0.00366 0 0 272 B
#6492 ObjectExtractorSimpleBody net472 168ns 0.313ns 1.21ns 0.0446 0 0 281 B
#6492 ObjectExtractorMoreComplexBody net6.0 2.86μs 1.33ns 4.98ns 0.053 0 0 3.78 KB
#6492 ObjectExtractorMoreComplexBody netcoreapp3.1 3.79μs 3.71ns 13.9ns 0.051 0 0 3.69 KB
#6492 ObjectExtractorMoreComplexBody net472 3.65μs 3.5ns 13.5ns 0.602 0.00546 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 35.7μs 14.9ns 55.7ns 0.449 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.5μs 29ns 112ns 0.431 0 0 32.4 KB
master EncodeArgs net472 66.2μs 33.9ns 127ns 5.15 0.0661 0 32.5 KB
master EncodeLegacyArgs net6.0 76.8μs 409ns 2.08μs 0.0357 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 108μs 57.6ns 208ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 68.3ns 265ns 0.312 0 0 2.15 KB
#6492 EncodeArgs net6.0 36.7μs 20.8ns 74.9ns 0.444 0 0 32.4 KB
#6492 EncodeArgs netcoreapp3.1 54.1μs 38.2ns 143ns 0.43 0 0 32.4 KB
#6492 EncodeArgs net472 67.7μs 42.6ns 159ns 5.15 0.0674 0 32.5 KB
#6492 EncodeLegacyArgs net6.0 73.9μs 36.4ns 131ns 0 0 0 2.14 KB
#6492 EncodeLegacyArgs netcoreapp3.1 107μs 304ns 1.18μs 0 0 0 2.14 KB
#6492 EncodeLegacyArgs net472 155μs 83.8ns 325ns 0.311 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 66.8ns 250ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 189μs 299ns 1.16μs 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 202μs 98.5ns 381ns 0.301 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 115μs 142ns 552ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 229ns 887ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 47.9ns 186ns 0.197 0 0 1.49 KB
#6492 RunWafRealisticBenchmark net6.0 175μs 161ns 622ns 0 0 0 2.44 KB
#6492 RunWafRealisticBenchmark netcoreapp3.1 185μs 280ns 1.08μs 0 0 0 2.39 KB
#6492 RunWafRealisticBenchmark net472 200μs 96.8ns 375ns 0.3 0 0 2.46 KB
#6492 RunWafRealisticBenchmarkWithAttack net6.0 119μs 256ns 992ns 0 0 0 1.47 KB
#6492 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 122μs 156ns 602ns 0 0 0 1.46 KB
#6492 RunWafRealisticBenchmarkWithAttack net472 132μs 49.2ns 191ns 0.198 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #6492

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 1.863 312,300.00 581,900.00

More allocations ⚠️ in #6492

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 255.54 KB 326.51 KB 70.97 KB 27.77%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 61μs 721ns 7.21μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 62.1μs 1.01μs 10.1μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.1μs 141ns 528ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 313μs 1.37μs 6.45μs 0 0 0 255.54 KB
master StringConcatAspectBenchmark netcoreapp3.1 340μs 1.74μs 9.99μs 0 0 0 254.06 KB
master StringConcatAspectBenchmark net472 291μs 6.87μs 68μs 0 0 0 278.53 KB
#6492 StringConcatBenchmark net6.0 60.7μs 749ns 7.41μs 0 0 0 43.44 KB
#6492 StringConcatBenchmark netcoreapp3.1 62.8μs 892ns 8.79μs 0 0 0 42.64 KB
#6492 StringConcatBenchmark net472 37.5μs 90.3ns 326ns 0 0 0 59.12 KB
#6492 StringConcatAspectBenchmark net6.0 594μs 3.3μs 21.9μs 0 0 0 326.51 KB
#6492 StringConcatAspectBenchmark netcoreapp3.1 341μs 1.52μs 8.73μs 0 0 0 253.23 KB
#6492 StringConcatAspectBenchmark net472 289μs 6.84μs 66.3μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6492 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.160
  • 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.79μs 39.7ns 190ns 0.012 0.00398 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.2μs 55.1ns 357ns 0.0252 0.0101 0 5.8 KB
master StartStopWithChild net472 16.5μs 70.2ns 272ns 1.04 0.304 0.0904 6.21 KB
#6492 StartStopWithChild net6.0 8.27μs 45.4ns 265ns 0.0186 0.00931 0 5.61 KB
#6492 StartStopWithChild netcoreapp3.1 10.2μs 55.6ns 310ns 0.0196 0.00982 0 5.8 KB
#6492 StartStopWithChild net472 16.4μs 55.3ns 214ns 1.04 0.31 0.0896 6.2 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 478μs 193ns 721ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 637μs 302ns 1.09μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 852μs 886ns 3.32μs 0.422 0 0 3.3 KB
#6492 WriteAndFlushEnrichedTraces net6.0 470μs 166ns 645ns 0 0 0 2.7 KB
#6492 WriteAndFlushEnrichedTraces netcoreapp3.1 642μs 547ns 2.04μs 0 0 0 2.7 KB
#6492 WriteAndFlushEnrichedTraces net472 844μs 705ns 2.64μs 0.422 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 157μs 1.2μs 11.9μs 0.164 0 0 14.47 KB
master SendRequest netcoreapp3.1 170μs 988ns 8.89μs 0.191 0 0 17.27 KB
master SendRequest net472 0.0011ns 0.000602ns 0.00217ns 0 0 0 0 b
#6492 SendRequest net6.0 151μs 887ns 8.27μs 0.15 0 0 14.47 KB
#6492 SendRequest netcoreapp3.1 178μs 1.08μs 10.6μs 0.17 0 0 17.27 KB
#6492 SendRequest net472 0.000538ns 0.000514ns 0.00192ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 559μs 2.59μs 10.4μs 0.561 0 0 41.6 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 684μs 3.93μs 30.4μs 0.322 0 0 41.83 KB
master WriteAndFlushEnrichedTraces net472 863μs 4.48μs 22.8μs 8.3 2.62 0.437 53.28 KB
#6492 WriteAndFlushEnrichedTraces net6.0 545μs 1.55μs 5.58μs 0.571 0 0 41.68 KB
#6492 WriteAndFlushEnrichedTraces netcoreapp3.1 657μs 3.54μs 18.4μs 0.334 0 0 41.69 KB
#6492 WriteAndFlushEnrichedTraces net472 828μs 2.85μs 11μs 8.39 2.52 0.419 53.26 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.24μs 1.32ns 4.95ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.81μs 2.28ns 8.82ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.01μs 1.73ns 6.69ns 0.156 0.00101 0 987 B
#6492 ExecuteNonQuery net6.0 1.36μs 2.33ns 9.01ns 0.0142 0 0 1.02 KB
#6492 ExecuteNonQuery netcoreapp3.1 1.8μs 1.65ns 6.18ns 0.0137 0 0 1.02 KB
#6492 ExecuteNonQuery net472 2.11μs 1.89ns 7.32ns 0.156 0.00106 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.25μs 0.415ns 1.61ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.6μs 0.82ns 2.96ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.52μs 1.14ns 3.96ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.32μs 0.286ns 0.99ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.72μs 0.778ns 3.01ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.7μs 1.77ns 6.37ns 0.166 0 0 1.05 KB
#6492 CallElasticsearch net6.0 1.24μs 0.629ns 2.44ns 0.0136 0 0 976 B
#6492 CallElasticsearch netcoreapp3.1 1.55μs 0.377ns 1.31ns 0.0132 0 0 976 B
#6492 CallElasticsearch net472 2.57μs 1.73ns 6.47ns 0.158 0 0 995 B
#6492 CallElasticsearchAsync net6.0 1.44μs 0.764ns 2.86ns 0.013 0 0 952 B
#6492 CallElasticsearchAsync netcoreapp3.1 1.67μs 0.702ns 2.72ns 0.014 0 0 1.02 KB
#6492 CallElasticsearchAsync net472 2.52μs 1.04ns 3.9ns 0.166 0 0 1.05 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.32μs 0.378ns 1.41ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.69μs 2.89ns 11.2ns 0.0126 0 0 952 B
master ExecuteAsync net472 1.85μs 0.561ns 2.17ns 0.145 0 0 915 B
#6492 ExecuteAsync net6.0 1.27μs 0.715ns 2.67ns 0.0134 0 0 952 B
#6492 ExecuteAsync netcoreapp3.1 1.7μs 2.22ns 8.61ns 0.0127 0 0 952 B
#6492 ExecuteAsync net472 1.77μs 0.339ns 1.31ns 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.49μs 1.47ns 5.51ns 0.0312 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.32μs 1.62ns 6.05ns 0.0369 0 0 2.85 KB
master SendAsync net472 7.31μs 2.41ns 9.33ns 0.496 0 0 3.12 KB
#6492 SendAsync net6.0 4.36μs 2.4ns 9.29ns 0.0327 0 0 2.31 KB
#6492 SendAsync netcoreapp3.1 5.29μs 2.48ns 9.61ns 0.0371 0 0 2.85 KB
#6492 SendAsync net472 7.32μs 2.48ns 9.6ns 0.494 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6492

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.147 1,644.01 1,433.61

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.64μs 0.686ns 2.57ns 0.0227 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.17μs 1.9ns 7.1ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.78μs 2.18ns 8.16ns 0.249 0 0 1.57 KB
#6492 EnrichedLog net6.0 1.43μs 0.683ns 2.56ns 0.0232 0 0 1.64 KB
#6492 EnrichedLog netcoreapp3.1 2.27μs 1.68ns 6.49ns 0.0222 0 0 1.64 KB
#6492 EnrichedLog net472 2.68μs 1.39ns 5.39ns 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 118μs 153ns 591ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 122μs 207ns 801ns 0 0 0 4.28 KB
master EnrichedLog net472 151μs 206ns 772ns 0.673 0.224 0 4.46 KB
#6492 EnrichedLog net6.0 119μs 110ns 425ns 0.0604 0 0 4.28 KB
#6492 EnrichedLog netcoreapp3.1 121μs 162ns 605ns 0 0 0 4.28 KB
#6492 EnrichedLog net472 154μs 135ns 523ns 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 3.04μs 1.09ns 4.21ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.26μs 1.1ns 4.25ns 0.0298 0 0 2.2 KB
master EnrichedLog net472 4.85μs 1.37ns 5.31ns 0.321 0 0 2.02 KB
#6492 EnrichedLog net6.0 3.07μs 1.25ns 4.7ns 0.0315 0 0 2.2 KB
#6492 EnrichedLog netcoreapp3.1 4.17μs 1.11ns 4.02ns 0.0294 0 0 2.2 KB
#6492 EnrichedLog net472 4.77μs 0.734ns 2.84ns 0.321 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.44μs 0.712ns 2.76ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.83μs 0.892ns 3.34ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.11μs 1.34ns 5.17ns 0.183 0 0 1.16 KB
#6492 SendReceive net6.0 1.41μs 0.435ns 1.63ns 0.0163 0 0 1.14 KB
#6492 SendReceive netcoreapp3.1 1.8μs 0.58ns 2.25ns 0.0154 0 0 1.14 KB
#6492 SendReceive net472 2.19μs 1.41ns 5.27ns 0.183 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.72μs 0.53ns 2.05ns 0.0218 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.93μs 2.1ns 7.27ns 0.0216 0 0 1.65 KB
master EnrichedLog net472 4.28μs 4.16ns 16.1ns 0.322 0 0 2.04 KB
#6492 EnrichedLog net6.0 2.63μs 1.75ns 6.79ns 0.0223 0 0 1.6 KB
#6492 EnrichedLog netcoreapp3.1 3.76μs 10.9ns 42.3ns 0.0224 0 0 1.65 KB
#6492 EnrichedLog net472 4.39μs 2.53ns 9.47ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6492

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.174 654.22 557.11

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 406ns 0.224ns 0.838ns 0.00795 0 0 576 B
master StartFinishSpan netcoreapp3.1 654ns 0.336ns 1.3ns 0.0075 0 0 576 B
master StartFinishSpan net472 689ns 0.494ns 1.91ns 0.0917 0 0 578 B
master StartFinishScope net6.0 566ns 0.376ns 1.46ns 0.00984 0 0 696 B
master StartFinishScope netcoreapp3.1 723ns 0.611ns 2.37ns 0.00911 0 0 696 B
master StartFinishScope net472 884ns 0.963ns 3.73ns 0.105 0 0 658 B
#6492 StartFinishSpan net6.0 401ns 0.306ns 1.18ns 0.00803 0 0 576 B
#6492 StartFinishSpan netcoreapp3.1 557ns 0.478ns 1.79ns 0.00784 0 0 576 B
#6492 StartFinishSpan net472 690ns 0.332ns 1.28ns 0.0916 0 0 578 B
#6492 StartFinishScope net6.0 562ns 0.357ns 1.38ns 0.00982 0 0 696 B
#6492 StartFinishScope netcoreapp3.1 698ns 2.01ns 7.79ns 0.0095 0 0 696 B
#6492 StartFinishScope net472 858ns 0.632ns 2.45ns 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 672ns 0.465ns 1.8ns 0.00975 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 902ns 0.54ns 2.02ns 0.00961 0 0 696 B
master RunOnMethodBegin net472 1.14μs 0.507ns 1.96ns 0.104 0 0 658 B
#6492 RunOnMethodBegin net6.0 700ns 0.431ns 1.61ns 0.00954 0 0 696 B
#6492 RunOnMethodBegin netcoreapp3.1 903ns 0.698ns 2.7ns 0.0095 0 0 696 B
#6492 RunOnMethodBegin net472 1.05μs 0.456ns 1.71ns 0.104 0 0 658 B

@@ -53,7 +53,7 @@ public class MongoDatabaseAspect
}
catch (global::System.Exception ex)
{
IastModule.Log.Warning(ex, $"Error invoking {nameof(MongoDatabaseAspect)}.{nameof(AnalyzeCommand)}");
IastModule.Log.Error(ex, $"Error invoking {nameof(MongoDatabaseAspect)}.{nameof(AnalyzeCommand)}");
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather add a LogAspectException function in the IastModule and call it, so if we want to change the functionality in the future we will only have to touch that function instead of all call sites

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, it can ensure no Error flooding happens, sending only one of each

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll do it in another PR 😄

@e-n-0 e-n-0 merged commit 1720e01 into master Jan 2, 2025
101 of 103 checks passed
@e-n-0 e-n-0 deleted the flavien/update-aspects-log-error branch January 2, 2025 12:50
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants