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

[IAST] Minor cleanup in IAST aspects #6293

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

andrewlock
Copy link
Member

Summary of changes

  • Make all aspects use the IastModule.Log object instead of their own
  • Use Error for cases where we know we're only going to get one log, and we really wouldn't expect to see it

Reason for change

Just noticed the differences/issues while working on something else

Implementation details

  • Log -> IastModule.Log
  • Warning -> Error (in NewtonsoftJsonAspects only)

Test coverage

Covered by existing

Other details

The aspects are very inconsistent in that sometimes they call Warning and sometimes they call Error. We should consider unifying these one way or the other (or, in some cases where they will be called a lot if there's an issue, use Debug to avoid many logs)

@andrewlock andrewlock requested a review from a team as a code owner November 15, 2024 10:48
@andrewlock andrewlock added the type:cleanup Minor code clean up label Nov 15, 2024
@andrewlock andrewlock changed the title Minor cleanup in IAST aspects [IAST] Minor cleanup in IAST aspects Nov 15, 2024
@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Nov 15, 2024
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

Thanks a lot

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 15, 2024

Datadog Report

Branch report: andrew/report-errors-in-iast
Commit report: 463d36e
Test service: dd-trace-dotnet

❌ 6 Failed (0 Known Flaky), 448626 Passed, 2728 Skipped, 19h 49m 9.39s Total Time
⌛ 2 Performance Regressions

❌ Failed Tests (6)

This report shows up to 5 failed tests.

  • AllCycleMoreComplexBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark - Details

  • AllCycleMoreComplexBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark - Details

  • AllCycleMoreComplexBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark - Details

  • AllCycleSimpleBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark - Details

  • AllCycleSimpleBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark - Details

⌛ Performance Regressions vs Default Branch (2)

  • StringConcatAspectBenchmark - Benchmarks.Trace.Iast.StringAspectsBenchmark 355.97µs (+43.37µs, +14%) - Details
  • ObjectExtractorMoreComplexBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark 4.48µs (+533ns, +14%) - Details

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.

Thank you!

@andrewlock
Copy link
Member Author

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 (6293) - mean (71ms)  : 64, 79
     .   : milestone, 71,
    master - mean (72ms)  : 64, 80
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (1,109ms)  : 1085, 1132
     .   : milestone, 1109,
    master - mean (1,106ms)  : 1085, 1127
     .   : milestone, 1106,

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

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (768ms)  : 753, 783
     .   : milestone, 768,
    master - mean (771ms)  : 736, 805
     .   : milestone, 771,

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

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (724ms)  : 703, 746
     .   : milestone, 724,
    master - mean (725ms)  : 709, 741
     .   : milestone, 725,

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

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (1,213ms)  : 1192, 1234
     .   : milestone, 1213,
    master - mean (1,211ms)  : 1187, 1235
     .   : milestone, 1211,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6293) - mean (276ms)  : 272, 281
     .   : milestone, 276,
    master - mean (276ms)  : 272, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (948ms)  : 931, 964
     .   : milestone, 948,
    master - mean (943ms)  : 927, 959
     .   : milestone, 943,

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

    section CallTarget+Inlining+NGEN
    This PR (6293) - mean (931ms)  : 907, 954
     .   : milestone, 931,
    master - mean (929ms)  : 911, 947
     .   : milestone, 929,

Loading

@andrewlock
Copy link
Member Author

Throughput/Crank Report ⚡

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 (6293) (11.189M)   : 0, 11188671
    master (11.120M)   : 0, 11120201
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6293) (7.240M)   : 0, 7239895
    master (7.143M)   : 0, 7143247
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.563M)   : 0, 7562834

    section Manual
    master (11.052M)   : 0, 11051540

    section Manual + Automatic
    This PR (6293) (6.662M)   : 0, 6662218
    master (6.532M)   : 0, 6532471

    section DD_TRACE_ENABLED=0
    master (10.176M)   : 0, 10176174

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6293) (9.615M)   : 0, 9615493
    master (9.435M)   : 0, 9435139
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6293) (6.452M)   : 0, 6451979
    master (6.301M)   : 0, 6300608

    section Trace stats
    master (6.646M)   : 0, 6646045

    section Manual
    master (9.564M)   : 0, 9563833

    section Manual + Automatic
    This PR (6293) (5.968M)   : 0, 5967556
    master (5.897M)   : 0, 5897193

    section DD_TRACE_ENABLED=0
    master (8.862M)   : 0, 8862065

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6293) (9.592M)   : 0, 9591713
    master (9.832M)   : 0, 9832351
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6293) (6.362M)   : 0, 6362484
    master (6.258M)   : 0, 6258447
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (6.950M)   : 0, 6950057

    section Manual
    master (9.945M)   : 0, 9945109

    section Manual + Automatic
    This PR (6293) (5.833M)   : 0, 5833471
    master (5.742M)   : 0, 5742033

    section DD_TRACE_ENABLED=0
    master (9.091M)   : 0, 9091089

Loading

@andrewlock andrewlock merged commit fa63a0a into master Nov 15, 2024
76 of 78 checks passed
@andrewlock andrewlock deleted the andrew/report-errors-in-iast branch November 15, 2024 15:24
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm-iast area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:cleanup Minor code clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants