Skip to content

[IAST] Taint db minor fixes#5926

Merged
dromanol merged 3 commits into
masterfrom
dani/iast/taint_db_fixes
Aug 22, 2024
Merged

[IAST] Taint db minor fixes#5926
dromanol merged 3 commits into
masterfrom
dani/iast/taint_db_fixes

Conversation

@dromanol

Copy link
Copy Markdown
Contributor

Summary of changes

Implement cosmetic and QOL suggestions-

Reason for change

Some comments regarding QOL and cosmetic issues were late after original PR merge.

Implementation details

Remove unnecessary OnMethodBegin and scope dispose calls.

Test coverage

Other details

@dromanol
dromanol requested review from a team as code owners August 22, 2024 10:25

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! 🙂

@datadog-ddstaging

datadog-ddstaging Bot commented Aug 22, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: dani/iast/taint_db_fixes
Commit report: 0a0f98d
Test service: dd-trace-dotnet

✅ 0 Failed, 301797 Passed, 1588 Skipped, 12h 29m 57.93s Total Time

@andrewlock

andrewlock commented Aug 22, 2024

Copy link
Copy Markdown
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).

}
}

state.Scope.DisposeWithException(exception);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't we want to record the exception here and below ? Is it done automatically ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We are not generating spans so there's no need for that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh ok right

@vandonr vandonr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

go, once tests pass

@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report for tracer 🐌

Benchmarks for #5926 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.132
  • 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 40.5ns 199ns 0.0153 0.00764 0 5.42 KB
master StartStopWithChild netcoreapp3.1 9.78μs 53.2ns 315ns 0.0203 0.0101 0 5.61 KB
master StartStopWithChild net472 16μs 57.7ns 223ns 1.01 0.292 0.0948 6.07 KB
#5926 StartStopWithChild net6.0 7.6μs 42.8ns 306ns 0.0149 0.00373 0 5.43 KB
#5926 StartStopWithChild netcoreapp3.1 9.66μs 53.9ns 370ns 0.0145 0.00482 0 5.61 KB
#5926 StartStopWithChild net472 16.1μs 53.5ns 207ns 1.02 0.301 0.0976 6.07 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 462μs 231ns 866ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 228ns 882ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 836μs 390ns 1.51μs 0.417 0 0 3.3 KB
#5926 WriteAndFlushEnrichedTraces net6.0 452μs 346ns 1.3μs 0 0 0 2.7 KB
#5926 WriteAndFlushEnrichedTraces netcoreapp3.1 631μs 263ns 984ns 0 0 0 2.7 KB
#5926 WriteAndFlushEnrichedTraces net472 837μs 744ns 2.78μs 0.417 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 193μs 1.07μs 6.68μs 0.182 0 0 18.45 KB
master SendRequest netcoreapp3.1 213μs 1.18μs 9.12μs 0.22 0 0 20.61 KB
master SendRequest net472 0.00227ns 0.000957ns 0.00371ns 0 0 0 0 b
#5926 SendRequest net6.0 185μs 1μs 5.94μs 0.184 0 0 18.45 KB
#5926 SendRequest netcoreapp3.1 212μs 1.2μs 8.33μs 0.208 0 0 20.61 KB
#5926 SendRequest net472 6.86E‑05ns 5.03E‑05ns 0.000188ns 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 566μs 3μs 15μs 0.548 0 0 41.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 676μs 2.01μs 7.52μs 0.334 0 0 41.91 KB
master WriteAndFlushEnrichedTraces net472 860μs 1.87μs 6.73μs 8.45 2.53 0.422 53.28 KB
#5926 WriteAndFlushEnrichedTraces net6.0 570μs 2.11μs 7.89μs 0.563 0 0 41.65 KB
#5926 WriteAndFlushEnrichedTraces netcoreapp3.1 676μs 3.5μs 16.4μs 0.34 0 0 41.79 KB
#5926 WriteAndFlushEnrichedTraces net472 852μs 3.93μs 15.2μs 8.39 2.52 0.419 53.28 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.3μs 2.11ns 8.17ns 0.0143 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.71μs 1.78ns 6.66ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 1.96μs 2.16ns 8.07ns 0.157 0 0 987 B
#5926 ExecuteNonQuery net6.0 1.21μs 1.11ns 4.14ns 0.0145 0 0 1.02 KB
#5926 ExecuteNonQuery netcoreapp3.1 1.79μs 0.999ns 3.74ns 0.0134 0 0 1.02 KB
#5926 ExecuteNonQuery net472 2μs 1.41ns 5.09ns 0.156 0 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.17μs 2.3ns 8.92ns 0.0134 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.61μs 1.77ns 6.86ns 0.0136 0 0 976 B
master CallElasticsearch net472 2.35μs 2.23ns 8.63ns 0.157 0.00118 0 995 B
master CallElasticsearchAsync net6.0 1.29μs 0.852ns 3.19ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.66μs 2.31ns 8.95ns 0.0142 0 0 1.02 KB
master CallElasticsearchAsync net472 2.64μs 2.21ns 8.55ns 0.167 0 0 1.05 KB
#5926 CallElasticsearch net6.0 1.17μs 0.931ns 3.61ns 0.0134 0 0 976 B
#5926 CallElasticsearch netcoreapp3.1 1.56μs 0.784ns 3.04ns 0.0133 0 0 976 B
#5926 CallElasticsearch net472 2.45μs 1.65ns 6.39ns 0.158 0 0 995 B
#5926 CallElasticsearchAsync net6.0 1.18μs 0.617ns 2.22ns 0.0131 0 0 952 B
#5926 CallElasticsearchAsync netcoreapp3.1 1.69μs 0.828ns 2.99ns 0.0135 0 0 1.02 KB
#5926 CallElasticsearchAsync net472 2.66μs 1.52ns 5.47ns 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.24μs 0.938ns 3.63ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.66μs 0.939ns 3.52ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.78μs 1.08ns 4.17ns 0.145 0 0 915 B
#5926 ExecuteAsync net6.0 1.24μs 1.48ns 5.53ns 0.0136 0 0 952 B
#5926 ExecuteAsync netcoreapp3.1 1.74μs 0.787ns 3.05ns 0.0122 0 0 952 B
#5926 ExecuteAsync net472 1.78μs 1.07ns 4.13ns 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.06μs 1.25ns 4.66ns 0.0304 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.12μs 1.7ns 6.6ns 0.0352 0 0 2.76 KB
master SendAsync net472 7.77μs 2.51ns 9.72ns 0.496 0 0 3.15 KB
#5926 SendAsync net6.0 4.3μs 2.17ns 8.42ns 0.0302 0 0 2.22 KB
#5926 SendAsync netcoreapp3.1 5.11μs 1.72ns 6.67ns 0.0357 0 0 2.76 KB
#5926 SendAsync net472 7.88μs 1.54ns 5.98ns 0.498 0 0 3.15 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.47μs 0.489ns 1.76ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.16μs 1.33ns 4.96ns 0.0217 0 0 1.64 KB
master EnrichedLog net472 2.73μs 2.01ns 7.8ns 0.249 0 0 1.57 KB
#5926 EnrichedLog net6.0 1.56μs 5.93ns 23ns 0.0231 0 0 1.64 KB
#5926 EnrichedLog netcoreapp3.1 2.29μs 0.804ns 2.9ns 0.0217 0 0 1.64 KB
#5926 EnrichedLog net472 2.66μs 1.09ns 4.23ns 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 116μs 149ns 579ns 0.0584 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 147ns 569ns 0 0 0 4.28 KB
master EnrichedLog net472 146μs 173ns 671ns 0.655 0.218 0 4.46 KB
#5926 EnrichedLog net6.0 114μs 266ns 1.03μs 0.0571 0 0 4.28 KB
#5926 EnrichedLog netcoreapp3.1 121μs 105ns 392ns 0 0 0 4.28 KB
#5926 EnrichedLog net472 152μs 243ns 941ns 0.679 0.226 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.15μs 0.813ns 3.15ns 0.0298 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.19μs 1.68ns 6.5ns 0.0294 0 0 2.2 KB
master EnrichedLog net472 4.92μs 1.19ns 4.46ns 0.32 0 0 2.02 KB
#5926 EnrichedLog net6.0 3.13μs 0.789ns 3.06ns 0.0298 0 0 2.2 KB
#5926 EnrichedLog netcoreapp3.1 4.21μs 11.7ns 45.1ns 0.0288 0 0 2.2 KB
#5926 EnrichedLog net472 4.92μs 1.66ns 6.42ns 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.37μs 1.63ns 6.31ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.77μs 1.31ns 5.09ns 0.0151 0 0 1.14 KB
master SendReceive net472 2.2μs 1.73ns 6.7ns 0.183 0.0011 0 1.16 KB
#5926 SendReceive net6.0 1.35μs 0.571ns 2.21ns 0.0163 0 0 1.14 KB
#5926 SendReceive netcoreapp3.1 1.72μs 1.61ns 6.23ns 0.0155 0 0 1.14 KB
#5926 SendReceive net472 2.2μs 6.43ns 24.9ns 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 3.05μs 4.77ns 18.5ns 0.0226 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.8μs 2.66ns 10.3ns 0.021 0 0 1.65 KB
master EnrichedLog net472 4.3μs 1.13ns 4.23ns 0.323 0 0 2.04 KB
#5926 EnrichedLog net6.0 2.83μs 0.79ns 2.74ns 0.0213 0 0 1.6 KB
#5926 EnrichedLog netcoreapp3.1 3.91μs 2.62ns 10.1ns 0.0214 0 0 1.65 KB
#5926 EnrichedLog net472 4.34μs 2.63ns 9.83ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5926

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 1.146 686.34 786.66

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 397ns 0.278ns 1.08ns 0.00803 0 0 576 B
master StartFinishSpan netcoreapp3.1 548ns 0.352ns 1.36ns 0.00768 0 0 576 B
master StartFinishSpan net472 636ns 0.837ns 3.24ns 0.0918 0 0 578 B
master StartFinishScope net6.0 474ns 0.437ns 1.64ns 0.0098 0 0 696 B
master StartFinishScope netcoreapp3.1 686ns 0.209ns 0.753ns 0.00929 0 0 696 B
master StartFinishScope net472 823ns 0.83ns 3.21ns 0.104 0 0 658 B
#5926 StartFinishSpan net6.0 398ns 0.587ns 2.27ns 0.00799 0 0 576 B
#5926 StartFinishSpan netcoreapp3.1 551ns 0.257ns 0.96ns 0.00794 0 0 576 B
#5926 StartFinishSpan net472 659ns 0.253ns 0.947ns 0.0918 0 0 578 B
#5926 StartFinishScope net6.0 483ns 0.184ns 0.711ns 0.00993 0 0 696 B
#5926 StartFinishScope netcoreapp3.1 787ns 0.538ns 2.01ns 0.00946 0 0 696 B
#5926 StartFinishScope net472 819ns 0.263ns 0.982ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5926

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.119 828.45 926.83

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 584ns 0.441ns 1.71ns 0.00971 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 828ns 0.565ns 2.11ns 0.00916 0 0 696 B
master RunOnMethodBegin net472 1.13μs 1.22ns 4.72ns 0.104 0 0 658 B
#5926 RunOnMethodBegin net6.0 610ns 0.323ns 1.25ns 0.00979 0 0 696 B
#5926 RunOnMethodBegin netcoreapp3.1 927ns 0.335ns 1.3ns 0.00962 0 0 696 B
#5926 RunOnMethodBegin net472 1.11μs 0.231ns 0.895ns 0.104 0 0 658 B

@dromanol
dromanol merged commit 066e2ef into master Aug 22, 2024
@dromanol
dromanol deleted the dani/iast/taint_db_fixes branch August 22, 2024 15:58
@github-actions github-actions Bot added this to the vNext-v3 milestone Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants