-
Notifications
You must be signed in to change notification settings - Fork 140
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] Add rules version to all root spans when ASM enabled #6188
[ASM] Add rules version to all root spans when ASM enabled #6188
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 1 occurrences of : + "_dd.appsec.event_rules.version": "1.13.1",
15 occurrences of : + _dd.appsec.event_rules.version: 1.13.1,
|
Datadog ReportBranch report: ✅ 0 Failed, 371928 Passed, 2089 Skipped, 15h 24m 54.2s Total Time |
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:
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 (6188) - mean (71ms) : 68, 74
. : milestone, 71,
master - mean (70ms) : 68, 72
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (1,118ms) : 1098, 1139
. : milestone, 1118,
master - mean (1,112ms) : 1086, 1139
. : milestone, 1112,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6188) - mean (110ms) : 106, 114
. : milestone, 110,
master - mean (109ms) : 106, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (778ms) : 765, 791
. : milestone, 778,
master - mean (773ms) : 760, 787
. : milestone, 773,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6188) - mean (93ms) : 90, 96
. : milestone, 93,
master - mean (93ms) : 89, 96
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (730ms) : 715, 745
. : milestone, 730,
master - mean (727ms) : 714, 740
. : milestone, 727,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6188) - mean (193ms) : 179, 207
. : milestone, 193,
master - mean (190ms) : 188, 192
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (1,203ms) : 1179, 1228
. : milestone, 1203,
master - mean (1,202ms) : 1176, 1227
. : milestone, 1202,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6188) - mean (275ms) : 272, 279
. : milestone, 275,
master - mean (276ms) : 270, 282
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (945ms) : 924, 966
. : milestone, 945,
master - mean (945ms) : 925, 965
. : milestone, 945,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6188) - mean (264ms) : 260, 268
. : milestone, 264,
master - mean (265ms) : 261, 270
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6188) - mean (930ms) : 912, 949
. : milestone, 930,
master - mean (926ms) : 909, 944
. : milestone, 926,
|
Benchmarks Report for appsec 🐌Benchmarks for #6188 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.36 KB | 59.04 KB | -320 B | -0.54% |
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 255.63 KB | 254.03 KB | -1.6 KB | -0.63% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 61.3μs | 829ns | 8.29μs | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 59.5μs | 742ns | 7.39μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 37.8μs | 105ns | 380ns | 0 | 0 | 0 | 59.36 KB |
master | StringConcatAspectBenchmark |
net6.0 | 314μs | 1.43μs | 5.36μs | 0 | 0 | 0 | 255.63 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 321μs | 3.06μs | 28.4μs | 0 | 0 | 0 | 252.93 KB |
master | StringConcatAspectBenchmark |
net472 | 275μs | 6.31μs | 60.9μs | 0 | 0 | 0 | 278.53 KB |
#6188 | StringConcatBenchmark |
net6.0 | 60.7μs | 595ns | 5.89μs | 0 | 0 | 0 | 43.44 KB |
#6188 | StringConcatBenchmark |
netcoreapp3.1 | 53.9μs | 256ns | 958ns | 0 | 0 | 0 | 42.64 KB |
#6188 | StringConcatBenchmark |
net472 | 37.3μs | 102ns | 383ns | 0 | 0 | 0 | 59.04 KB |
#6188 | StringConcatAspectBenchmark |
net6.0 | 308μs | 1.67μs | 8.84μs | 0 | 0 | 0 | 254.03 KB |
#6188 | StringConcatAspectBenchmark |
netcoreapp3.1 | 339μs | 1.83μs | 14.2μs | 0 | 0 | 0 | 253.9 KB |
#6188 | StringConcatAspectBenchmark |
net472 | 281μs | 6.7μs | 64.6μs | 0 | 0 | 0 | 278.53 KB |
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 (6188) (11.165M) : 0, 11164838
master (11.173M) : 0, 11173055
benchmarks/2.9.0 (11.081M) : 0, 11080577
section Automatic
This PR (6188) (7.363M) : 0, 7363031
master (7.413M) : 0, 7412704
benchmarks/2.9.0 (7.732M) : 0, 7732233
section Trace stats
master (7.618M) : 0, 7617811
section Manual
master (11.131M) : 0, 11131145
section Manual + Automatic
This PR (6188) (6.829M) : 0, 6829105
master (6.777M) : 0, 6776931
section DD_TRACE_ENABLED=0
master (10.230M) : 0, 10230054
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6188) (9.621M) : 0, 9621343
master (9.535M) : 0, 9534894
benchmarks/2.9.0 (9.798M) : 0, 9798067
section Automatic
This PR (6188) (6.758M) : 0, 6758156
master (6.561M) : 0, 6560760
section Trace stats
master (6.754M) : 0, 6753895
section Manual
master (9.505M) : 0, 9505267
section Manual + Automatic
This PR (6188) (6.204M) : 0, 6204125
master (5.982M) : 0, 5982216
section DD_TRACE_ENABLED=0
master (8.781M) : 0, 8780682
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6188) (9.967M) : 0, 9966818
master (9.831M) : 0, 9831311
benchmarks/2.9.0 (10.067M) : 0, 10067315
section Automatic
This PR (6188) (6.688M) : 0, 6688222
master (6.589M) : 0, 6589279
benchmarks/2.9.0 (7.552M) : 0, 7552193
section Trace stats
master (7.327M) : 0, 7327356
section Manual
master (10.014M) : 0, 10014131
section Manual + Automatic
This PR (6188) (6.109M) : 0, 6108548
master (6.181M) : 0, 6181145
section DD_TRACE_ENABLED=0
master (9.100M) : 0, 9100382
|
Benchmarks Report for tracer 🐌Benchmarks for #6188 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 | 1.147 | 1,645.10 | 1,434.70 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 1.65μs | 1.65ns | 6.4ns | 0.0227 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.11μs | 0.716ns | 2.68ns | 0.0221 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.68μs | 1.33ns | 5.17ns | 0.249 | 0 | 0 | 1.57 KB |
#6188 | EnrichedLog |
net6.0 | 1.43μs | 0.675ns | 2.43ns | 0.0228 | 0 | 0 | 1.64 KB |
#6188 | EnrichedLog |
netcoreapp3.1 | 2.28μs | 1.24ns | 4.62ns | 0.0225 | 0 | 0 | 1.64 KB |
#6188 | EnrichedLog |
net472 | 2.6μs | 1.39ns | 5.2ns | 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 | 153ns | 594ns | 0.0579 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 122μs | 191ns | 741ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 149μs | 120ns | 466ns | 0.674 | 0.225 | 0 | 4.46 KB |
#6188 | EnrichedLog |
net6.0 | 117μs | 257ns | 997ns | 0.0582 | 0 | 0 | 4.28 KB |
#6188 | EnrichedLog |
netcoreapp3.1 | 122μs | 99.7ns | 360ns | 0 | 0 | 0 | 4.28 KB |
#6188 | EnrichedLog |
net472 | 152μs | 161ns | 624ns | 0.687 | 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.08μs | 0.781ns | 3.03ns | 0.031 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.16μs | 1.1ns | 4.25ns | 0.0291 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.75μs | 2.05ns | 7.95ns | 0.321 | 0 | 0 | 2.02 KB |
#6188 | EnrichedLog |
net6.0 | 3.12μs | 1.38ns | 5.35ns | 0.0297 | 0 | 0 | 2.2 KB |
#6188 | EnrichedLog |
netcoreapp3.1 | 4.26μs | 0.826ns | 3.2ns | 0.0298 | 0 | 0 | 2.2 KB |
#6188 | EnrichedLog |
net472 | 4.95μs | 1.46ns | 5.67ns | 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.34μs | 1.24ns | 4.82ns | 0.0161 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.7μs | 0.574ns | 2.15ns | 0.0146 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.29μs | 0.971ns | 3.63ns | 0.183 | 0.00115 | 0 | 1.16 KB |
#6188 | SendReceive |
net6.0 | 1.48μs | 1.64ns | 6.35ns | 0.0162 | 0 | 0 | 1.14 KB |
#6188 | SendReceive |
netcoreapp3.1 | 1.78μs | 0.718ns | 2.69ns | 0.0151 | 0 | 0 | 1.14 KB |
#6188 | SendReceive |
net472 | 2.22μs | 1.83ns | 7.09ns | 0.183 | 0.0011 | 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.77μs | 1ns | 3.88ns | 0.0223 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.99μs | 1.67ns | 6.47ns | 0.0219 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.47μs | 1.07ns | 4.14ns | 0.322 | 0 | 0 | 2.04 KB |
#6188 | EnrichedLog |
net6.0 | 2.74μs | 8.79ns | 34ns | 0.0216 | 0 | 0 | 1.6 KB |
#6188 | EnrichedLog |
netcoreapp3.1 | 3.84μs | 2.16ns | 8.36ns | 0.021 | 0 | 0 | 1.65 KB |
#6188 | EnrichedLog |
net472 | 4.42μs | 4ns | 15.5ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6188
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0
1.147
476.13
546.26
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.147 | 476.13 | 546.26 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 420ns | 0.237ns | 0.917ns | 0.00806 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 612ns | 0.556ns | 2.08ns | 0.00786 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 706ns | 0.537ns | 2.08ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 476ns | 0.391ns | 1.52ns | 0.00976 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 700ns | 0.817ns | 3.16ns | 0.00963 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 846ns | 0.938ns | 3.63ns | 0.104 | 0 | 0 | 658 B |
#6188 | StartFinishSpan |
net6.0 | 394ns | 0.108ns | 0.417ns | 0.00814 | 0 | 0 | 576 B |
#6188 | StartFinishSpan |
netcoreapp3.1 | 587ns | 0.736ns | 2.85ns | 0.0076 | 0 | 0 | 576 B |
#6188 | StartFinishSpan |
net472 | 664ns | 0.524ns | 2.03ns | 0.0916 | 0 | 0 | 578 B |
#6188 | StartFinishScope |
net6.0 | 549ns | 1.46ns | 5.66ns | 0.00971 | 0 | 0 | 696 B |
#6188 | StartFinishScope |
netcoreapp3.1 | 713ns | 0.471ns | 1.82ns | 0.00921 | 0 | 0 | 696 B |
#6188 | StartFinishScope |
net472 | 857ns | 0.515ns | 1.99ns | 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 | 587ns | 0.62ns | 2.4ns | 0.00967 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 880ns | 0.765ns | 2.86ns | 0.0092 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.17μs | 1.09ns | 4.21ns | 0.105 | 0 | 0 | 658 B |
#6188 | RunOnMethodBegin |
net6.0 | 592ns | 0.336ns | 1.3ns | 0.0096 | 0 | 0 | 696 B |
#6188 | RunOnMethodBegin |
netcoreapp3.1 | 887ns | 1.18ns | 4.42ns | 0.00923 | 0 | 0 | 696 B |
#6188 | RunOnMethodBegin |
net472 | 1.12μs | 1.1ns | 4.27ns | 0.105 | 0 | 0 | 658 B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but just an FYI, for fixed things like this you might want to consider switching to doing this in the span serializer. We do this for the tracer for performance reasons, and given that you always are using the slow path (the Tags
dictionary) you could see some significant improvements 🤔
Thanks for the reviews! |
|
Summary of changes
This PR adds the _dd.appsec.event_rules.version tag to all the spans when ASM is enabled. This has been requested by the RASP WG and is consistent with the behavior of other libraries.
Reason for change
Implementation details
Test coverage
Other details