-
Notifications
You must be signed in to change notification settings - Fork 143
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] Log FormatException
from get_Uri
as debug
#6489
Conversation
FormatException
from get_Uri
FormatException
from get_Uri
as debug
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 (6489) - mean (68ms) : 66, 71
. : milestone, 68,
master - mean (69ms) : 64, 73
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (977ms) : 957, 998
. : milestone, 977,
master - mean (976ms) : 946, 1006
. : milestone, 976,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6489) - mean (107ms) : 105, 109
. : milestone, 107,
master - mean (107ms) : 105, 109
. : milestone, 107,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (674ms) : 658, 690
. : milestone, 674,
master - mean (677ms) : 659, 694
. : milestone, 677,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6489) - mean (91ms) : 89, 93
. : milestone, 91,
master - mean (91ms) : 89, 93
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (629ms) : 614, 644
. : milestone, 629,
master - mean (629ms) : 614, 643
. : milestone, 629,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6489) - mean (194ms) : 189, 199
. : milestone, 194,
master - mean (193ms) : 188, 199
. : milestone, 193,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (1,103ms) : 1064, 1142
. : milestone, 1103,
master - mean (1,099ms) : 1070, 1129
. : milestone, 1099,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6489) - mean (278ms) : 273, 282
. : milestone, 278,
master - mean (279ms) : 273, 284
. : milestone, 279,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (874ms) : 838, 910
. : milestone, 874,
master - mean (874ms) : 844, 903
. : milestone, 874,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6489) - mean (267ms) : 263, 272
. : milestone, 267,
master - mean (267ms) : 261, 273
. : milestone, 267,
section CallTarget+Inlining+NGEN
This PR (6489) - mean (845ms) : 819, 872
. : milestone, 845,
master - mean (846ms) : 819, 873
. : milestone, 846,
|
Datadog ReportBranch report: ✅ 0 Failed, 228053 Passed, 2100 Skipped, 19h 3m 7.11s Total Time |
Benchmarks Report for appsec 🐌Benchmarks for #6489 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 - Faster 🎉 Fewer allocations 🎉
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 1.191 | 61,300.00 | 51,450.00 | multimodal |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.07 KB | 57.26 KB | -1.82 KB | -3.07% |
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 |
#6489 | StringConcatBenchmark |
net6.0 | 51.7μs | 251ns | 1μs | 0 | 0 | 0 | 43.44 KB |
#6489 | StringConcatBenchmark |
netcoreapp3.1 | 54.3μs | 283ns | 1.33μs | 0 | 0 | 0 | 42.64 KB |
#6489 | StringConcatBenchmark |
net472 | 38.6μs | 199ns | 931ns | 0 | 0 | 0 | 57.26 KB |
#6489 | StringConcatAspectBenchmark |
net6.0 | 318μs | 1.79μs | 13.6μs | 0 | 0 | 0 | 255.86 KB |
#6489 | StringConcatAspectBenchmark |
netcoreapp3.1 | 379μs | 2.2μs | 18μs | 0 | 0 | 0 | 253.88 KB |
#6489 | StringConcatAspectBenchmark |
net472 | 299μs | 6.38μs | 61.5μs | 0 | 0 | 0 | 278.53 KB |
Benchmarks Report for tracer 🐌Benchmarks for #6489 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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.178 | 1,142.14 | 1,345.26 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.14μs | 1.34ns | 4.84ns | 0.0138 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.55μs | 0.946ns | 3.66ns | 0.0133 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.5μs | 1.13ns | 4.24ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.37μs | 0.793ns | 2.97ns | 0.0131 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.68μs | 0.874ns | 3.27ns | 0.0142 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.59μs | 0.859ns | 3.22ns | 0.167 | 0 | 0 | 1.05 KB |
#6489 | CallElasticsearch |
net6.0 | 1.34μs | 0.481ns | 1.8ns | 0.0135 | 0 | 0 | 976 B |
#6489 | CallElasticsearch |
netcoreapp3.1 | 1.57μs | 3.39ns | 12.7ns | 0.0134 | 0 | 0 | 976 B |
#6489 | CallElasticsearch |
net472 | 2.43μs | 2.31ns | 8.93ns | 0.158 | 0 | 0 | 995 B |
#6489 | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.627ns | 2.26ns | 0.0129 | 0 | 0 | 952 B |
#6489 | CallElasticsearchAsync |
netcoreapp3.1 | 1.69μs | 0.683ns | 2.56ns | 0.0135 | 0 | 0 | 1.02 KB |
#6489 | CallElasticsearchAsync |
net472 | 2.69μs | 2.98ns | 11.5ns | 0.167 | 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.36μs | 0.501ns | 1.87ns | 0.0129 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.68μs | 0.905ns | 3.39ns | 0.0127 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.86μs | 0.506ns | 1.89ns | 0.145 | 0 | 0 | 915 B |
#6489 | ExecuteAsync |
net6.0 | 1.43μs | 0.52ns | 2.01ns | 0.0136 | 0 | 0 | 952 B |
#6489 | ExecuteAsync |
netcoreapp3.1 | 1.63μs | 1.16ns | 4.48ns | 0.0129 | 0 | 0 | 952 B |
#6489 | ExecuteAsync |
net472 | 1.82μs | 0.483ns | 1.81ns | 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.42μs | 2.52ns | 9.43ns | 0.0309 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.26μs | 1.66ns | 6.44ns | 0.0368 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.37μs | 2.91ns | 11.3ns | 0.493 | 0 | 0 | 3.12 KB |
#6489 | SendAsync |
net6.0 | 4.53μs | 4.77ns | 18.5ns | 0.0317 | 0 | 0 | 2.31 KB |
#6489 | SendAsync |
netcoreapp3.1 | 5.17μs | 2.09ns | 8.1ns | 0.0362 | 0 | 0 | 2.85 KB |
#6489 | SendAsync |
net472 | 7.36μs | 1.29ns | 5ns | 0.493 | 0 | 0 | 3.12 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.56μs | 1.39ns | 5.19ns | 0.0227 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.17μs | 1.18ns | 4.57ns | 0.0218 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.71μs | 1.86ns | 6.94ns | 0.249 | 0 | 0 | 1.57 KB |
#6489 | EnrichedLog |
net6.0 | 1.59μs | 1.27ns | 4.74ns | 0.0231 | 0 | 0 | 1.64 KB |
#6489 | EnrichedLog |
netcoreapp3.1 | 2.26μs | 2.3ns | 8.59ns | 0.0224 | 0 | 0 | 1.64 KB |
#6489 | EnrichedLog |
net472 | 2.7μs | 1.43ns | 5.53ns | 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 | 152ns | 590ns | 0.0583 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 123μs | 286ns | 1.11μs | 0.0612 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 152μs | 207ns | 800ns | 0.68 | 0.227 | 0 | 4.46 KB |
#6489 | EnrichedLog |
net6.0 | 118μs | 155ns | 602ns | 0.0586 | 0 | 0 | 4.28 KB |
#6489 | EnrichedLog |
netcoreapp3.1 | 121μs | 189ns | 733ns | 0 | 0 | 0 | 4.28 KB |
#6489 | EnrichedLog |
net472 | 154μs | 127ns | 493ns | 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 | 1.1ns | 4.27ns | 0.0308 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.17μs | 1.49ns | 5.76ns | 0.0292 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.91μs | 1.02ns | 3.69ns | 0.32 | 0 | 0 | 2.02 KB |
#6489 | EnrichedLog |
net6.0 | 2.87μs | 4.94ns | 19.1ns | 0.0306 | 0 | 0 | 2.2 KB |
#6489 | EnrichedLog |
netcoreapp3.1 | 4.29μs | 2.19ns | 8.5ns | 0.0303 | 0 | 0 | 2.2 KB |
#6489 | EnrichedLog |
net472 | 4.94μs | 0.625ns | 2.26ns | 0.319 | 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.3μs | 0.713ns | 2.67ns | 0.0163 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.88μs | 1.17ns | 4.52ns | 0.015 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.05μs | 0.852ns | 3.19ns | 0.184 | 0 | 0 | 1.16 KB |
#6489 | SendReceive |
net6.0 | 1.35μs | 0.952ns | 3.69ns | 0.0162 | 0 | 0 | 1.14 KB |
#6489 | SendReceive |
netcoreapp3.1 | 1.8μs | 1.58ns | 6.12ns | 0.0154 | 0 | 0 | 1.14 KB |
#6489 | SendReceive |
net472 | 2.2μs | 1.25ns | 4.82ns | 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.71μs | 0.928ns | 3.47ns | 0.0222 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.11μs | 1.8ns | 6.97ns | 0.0226 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.29μs | 1.81ns | 6.79ns | 0.322 | 0 | 0 | 2.04 KB |
#6489 | EnrichedLog |
net6.0 | 2.71μs | 0.883ns | 3.42ns | 0.0218 | 0 | 0 | 1.6 KB |
#6489 | EnrichedLog |
netcoreapp3.1 | 3.88μs | 2.69ns | 10.1ns | 0.0214 | 0 | 0 | 1.65 KB |
#6489 | EnrichedLog |
net472 | 4.37μs | 5.35ns | 20.7ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 400ns | 0.368ns | 1.43ns | 0.00805 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 611ns | 0.632ns | 2.45ns | 0.00762 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 647ns | 0.237ns | 0.918ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 484ns | 0.273ns | 1.02ns | 0.00979 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 726ns | 0.342ns | 1.28ns | 0.00942 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 910ns | 0.508ns | 1.97ns | 0.104 | 0 | 0 | 658 B |
#6489 | StartFinishSpan |
net6.0 | 391ns | 0.305ns | 1.18ns | 0.00806 | 0 | 0 | 576 B |
#6489 | StartFinishSpan |
netcoreapp3.1 | 583ns | 0.789ns | 3.05ns | 0.00793 | 0 | 0 | 576 B |
#6489 | StartFinishSpan |
net472 | 691ns | 0.719ns | 2.79ns | 0.0915 | 0 | 0 | 578 B |
#6489 | StartFinishScope |
net6.0 | 495ns | 0.14ns | 0.505ns | 0.00972 | 0 | 0 | 696 B |
#6489 | StartFinishScope |
netcoreapp3.1 | 735ns | 4.09ns | 24.5ns | 0.00923 | 0 | 0 | 696 B |
#6489 | StartFinishScope |
net472 | 868ns | 1.87ns | 7.24ns | 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 | 581ns | 0.282ns | 1.09ns | 0.00986 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 1.02μs | 0.813ns | 3.15ns | 0.0097 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 998ns | 0.442ns | 1.71ns | 0.104 | 0 | 0 | 658 B |
#6489 | RunOnMethodBegin |
net6.0 | 610ns | 0.396ns | 1.53ns | 0.00982 | 0 | 0 | 696 B |
#6489 | RunOnMethodBegin |
netcoreapp3.1 | 934ns | 0.466ns | 1.8ns | 0.00927 | 0 | 0 | 696 B |
#6489 | RunOnMethodBegin |
net472 | 1.11μs | 0.66ns | 2.56ns | 0.104 | 0 | 0 | 658 B |
42915cf
to
e6eceee
Compare
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.
Looks good, thanks!
Summary of changes
Add catch blocks for the
FormatException
in all aspect where theUri
is get from the instance.Reason for change
Error identified on Error Tracking.
The instrumentation fails because of an invalid string during the creation of the
Uri
. The tainting would not happen because it requires theOriginalString
from theUri
to keep tracks of its usage.Implementation details
From the Microsoft Docs:
I did choose FormatException because from the docs, they say:
Note: In .NET for Windows Store apps or the Portable Class Library, catch the base class exception, FormatException, instead.