[ASM][ATO] Adapt v3 new login tags and fix signup tags#6302
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 5 occurrences of : + appsec.events.users.login.success.usr.login: TestUser,
5 occurrences of : + _dd.appsec.usr.id: Guid_2,
+ _dd.appsec.usr.login: TestUser,
1 occurrences of : + appsec.events.users.login.failure.usr.login: anon_eb97d409396a3e5392936dad92b909da,
2 occurrences of : + _dd.appsec.usr.id: anon_7bcd1c9fc4f6e4c2460e0ad38d6ad0d9,
+ _dd.appsec.usr.login: anon_eb97d409396a3e5392936dad92b909da,
1 occurrences of : - appsec.events.users.login.failure.usr.id: anon_c34de12d00b78a9977da847b7e55202e,
+ appsec.events.users.login.failure.usr.login: anon_c34de12d00b78a9977da847b7e55202e,
1 occurrences of : + _dd.appsec.usr.login: anon_c34de12d00b78a9977da847b7e55202e,
1 occurrences of : + appsec.events.users.login.success.usr.login: anon_eb97d409396a3e5392936dad92b909da,
3 occurrences of : + appsec.events.users.login.failure.usr.login: TestUser,
3 occurrences of : + _dd.appsec.usr.id: Guid_1,
+ _dd.appsec.usr.login: TestUser,
3 occurrences of : - appsec.events.users.login.failure.usr.id: NoSuchUser,
+ appsec.events.users.login.failure.usr.login: NoSuchUser,
3 occurrences of : + _dd.appsec.usr.login: NoSuchUser,
|
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 (6302) - mean (68ms) : 66, 71
. : milestone, 68,
master - mean (69ms) : 65, 72
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (980ms) : 954, 1005
. : milestone, 980,
master - mean (978ms) : 952, 1004
. : milestone, 978,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6302) - mean (107ms) : 105, 109
. : milestone, 107,
master - mean (108ms) : 105, 110
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (675ms) : 660, 691
. : milestone, 675,
master - mean (680ms) : 663, 697
. : milestone, 680,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6302) - mean (91ms) : 89, 93
. : milestone, 91,
master - mean (91ms) : 89, 93
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (635ms) : 616, 654
. : milestone, 635,
master - mean (639ms) : 624, 653
. : milestone, 639,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6302) - mean (194ms) : 190, 198
. : milestone, 194,
master - mean (194ms) : 190, 199
. : milestone, 194,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (1,106ms) : 1068, 1144
. : milestone, 1106,
master - mean (1,104ms) : 1076, 1132
. : milestone, 1104,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6302) - mean (278ms) : 273, 283
. : milestone, 278,
master - mean (277ms) : 272, 281
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (871ms) : 845, 897
. : milestone, 871,
master - mean (874ms) : 847, 901
. : milestone, 874,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6302) - mean (267ms) : 262, 271
. : milestone, 267,
master - mean (267ms) : 263, 271
. : milestone, 267,
section CallTarget+Inlining+NGEN
This PR (6302) - mean (852ms) : 816, 887
. : milestone, 852,
master - mean (856ms) : 823, 888
. : milestone, 856,
|
Datadog ReportBranch report: ✅ 0 Failed, 458777 Passed, 2833 Skipped, 19h 47m 9.09s Total Time |
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 (6302) (11.152M) : 0, 11151575
master (11.199M) : 0, 11199251
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6302) (7.104M) : 0, 7104324
master (7.234M) : 0, 7234132
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.559M) : 0, 7558761
section Manual
master (11.028M) : 0, 11028498
section Manual + Automatic
This PR (6302) (6.580M) : 0, 6580439
master (6.711M) : 0, 6710751
section DD_TRACE_ENABLED=0
master (10.230M) : 0, 10230285
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6302) (9.584M) : 0, 9584071
master (9.417M) : 0, 9416704
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6302) (6.366M) : 0, 6366278
master (6.437M) : 0, 6437027
section Trace stats
master (6.619M) : 0, 6618620
section Manual
master (9.205M) : 0, 9205053
section Manual + Automatic
This PR (6302) (6.007M) : 0, 6007195
master (5.852M) : 0, 5852490
section DD_TRACE_ENABLED=0
master (8.872M) : 0, 8871934
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6302) (9.780M) : 0, 9780199
master (9.905M) : 0, 9904680
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6302) (6.291M) : 0, 6290574
master (6.337M) : 0, 6337163
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.938M) : 0, 6938182
section Manual
master (9.708M) : 0, 9708036
section Manual + Automatic
This PR (6302) (5.956M) : 0, 5956098
master (5.665M) : 0, 5664554
section DD_TRACE_ENABLED=0
master (9.111M) : 0, 9111450
|
Benchmarks Report for tracer 🐌Benchmarks for #6302 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 ✔️ Fewer allocations 🎉
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.82 KB | 41.44 KB | -376 B | -0.90% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 582μs | 2.68μs | 9.66μs | 0.556 | 0 | 0 | 41.82 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 661μs | 3.29μs | 15.1μs | 0.331 | 0 | 0 | 41.79 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 860μs | 4.24μs | 18μs | 8.19 | 2.59 | 0.431 | 53.27 KB |
| #6302 | WriteAndFlushEnrichedTraces |
net6.0 | 533μs | 2.63μs | 12.1μs | 0.539 | 0 | 0 | 41.44 KB |
| #6302 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 648μs | 3.52μs | 19.6μs | 0.336 | 0 | 0 | 41.77 KB |
| #6302 | WriteAndFlushEnrichedTraces |
net472 | 815μs | 3.67μs | 16μs | 8.22 | 2.47 | 0.411 | 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.52ns | 5.89ns | 0.0142 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 1.68μs | 0.676ns | 2.53ns | 0.0135 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.11μs | 2.33ns | 9.01ns | 0.157 | 0.00106 | 0 | 987 B |
| #6302 | ExecuteNonQuery |
net6.0 | 1.23μs | 1.2ns | 4.64ns | 0.014 | 0 | 0 | 1.02 KB |
| #6302 | ExecuteNonQuery |
netcoreapp3.1 | 1.73μs | 0.573ns | 2.14ns | 0.0139 | 0 | 0 | 1.02 KB |
| #6302 | ExecuteNonQuery |
net472 | 2.08μs | 1.15ns | 4.3ns | 0.156 | 0.00103 | 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.13μs | 0.771ns | 2.89ns | 0.0136 | 0 | 0 | 976 B |
| master | CallElasticsearch |
netcoreapp3.1 | 1.56μs | 2.7ns | 10.1ns | 0.0132 | 0 | 0 | 976 B |
| master | CallElasticsearch |
net472 | 2.56μs | 1.88ns | 7.05ns | 0.157 | 0 | 0 | 995 B |
| master | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.535ns | 2.07ns | 0.0134 | 0 | 0 | 952 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 1.61μs | 1.3ns | 5.02ns | 0.0137 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 2.65μs | 1.85ns | 6.91ns | 0.166 | 0 | 0 | 1.05 KB |
| #6302 | CallElasticsearch |
net6.0 | 1.24μs | 0.679ns | 2.54ns | 0.0137 | 0 | 0 | 976 B |
| #6302 | CallElasticsearch |
netcoreapp3.1 | 1.62μs | 0.504ns | 1.82ns | 0.013 | 0 | 0 | 976 B |
| #6302 | CallElasticsearch |
net472 | 2.48μs | 1.78ns | 6.91ns | 0.157 | 0 | 0 | 995 B |
| #6302 | CallElasticsearchAsync |
net6.0 | 1.29μs | 0.411ns | 1.59ns | 0.013 | 0 | 0 | 952 B |
| #6302 | CallElasticsearchAsync |
netcoreapp3.1 | 1.67μs | 0.635ns | 2.38ns | 0.0134 | 0 | 0 | 1.02 KB |
| #6302 | CallElasticsearchAsync |
net472 | 2.71μs | 1.56ns | 5.62ns | 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.562ns | 2.18ns | 0.0129 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 1.65μs | 0.696ns | 2.51ns | 0.0124 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 1.82μs | 0.398ns | 1.43ns | 0.145 | 0 | 0 | 915 B |
| #6302 | ExecuteAsync |
net6.0 | 1.25μs | 0.608ns | 2.36ns | 0.013 | 0 | 0 | 952 B |
| #6302 | ExecuteAsync |
netcoreapp3.1 | 1.57μs | 1.17ns | 4.52ns | 0.0125 | 0 | 0 | 952 B |
| #6302 | ExecuteAsync |
net472 | 1.82μs | 0.409ns | 1.59ns | 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.48μs | 1.58ns | 5.9ns | 0.0315 | 0 | 0 | 2.31 KB |
| master | SendAsync |
netcoreapp3.1 | 5.33μs | 2.31ns | 8.63ns | 0.0374 | 0 | 0 | 2.85 KB |
| master | SendAsync |
net472 | 7.31μs | 3.7ns | 14.3ns | 0.493 | 0 | 0 | 3.12 KB |
| #6302 | SendAsync |
net6.0 | 4.35μs | 1.58ns | 6.11ns | 0.0327 | 0 | 0 | 2.31 KB |
| #6302 | SendAsync |
netcoreapp3.1 | 5.46μs | 28.5ns | 140ns | 0.0373 | 0 | 0 | 2.85 KB |
| #6302 | SendAsync |
net472 | 7.34μs | 2.78ns | 10.8ns | 0.496 | 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.52μs | 2.22ns | 8.6ns | 0.0227 | 0 | 0 | 1.64 KB |
| master | EnrichedLog |
netcoreapp3.1 | 2.27μs | 0.632ns | 2.28ns | 0.0216 | 0 | 0 | 1.64 KB |
| master | EnrichedLog |
net472 | 2.73μs | 1.34ns | 5.19ns | 0.249 | 0 | 0 | 1.57 KB |
| #6302 | EnrichedLog |
net6.0 | 1.61μs | 1.87ns | 6.75ns | 0.0234 | 0 | 0 | 1.64 KB |
| #6302 | EnrichedLog |
netcoreapp3.1 | 2.21μs | 1.19ns | 4.45ns | 0.0222 | 0 | 0 | 1.64 KB |
| #6302 | EnrichedLog |
net472 | 2.71μs | 0.815ns | 2.94ns | 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 | 121μs | 163ns | 633ns | 0 | 0 | 0 | 4.28 KB |
| master | EnrichedLog |
netcoreapp3.1 | 124μs | 157ns | 586ns | 0.0621 | 0 | 0 | 4.28 KB |
| master | EnrichedLog |
net472 | 152μs | 107ns | 387ns | 0.675 | 0.225 | 0 | 4.46 KB |
| #6302 | EnrichedLog |
net6.0 | 121μs | 187ns | 724ns | 0.0605 | 0 | 0 | 4.28 KB |
| #6302 | EnrichedLog |
netcoreapp3.1 | 124μs | 216ns | 838ns | 0 | 0 | 0 | 4.28 KB |
| #6302 | EnrichedLog |
net472 | 152μs | 89.1ns | 321ns | 0.684 | 0.228 | 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.07μs | 1.18ns | 4.56ns | 0.0305 | 0 | 0 | 2.2 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.22μs | 2.64ns | 10.2ns | 0.0296 | 0 | 0 | 2.2 KB |
| master | EnrichedLog |
net472 | 5.01μs | 1.2ns | 4.64ns | 0.319 | 0 | 0 | 2.02 KB |
| #6302 | EnrichedLog |
net6.0 | 3.05μs | 1.13ns | 4.39ns | 0.0306 | 0 | 0 | 2.2 KB |
| #6302 | EnrichedLog |
netcoreapp3.1 | 4.15μs | 5.28ns | 19.7ns | 0.0289 | 0 | 0 | 2.2 KB |
| #6302 | EnrichedLog |
net472 | 4.86μs | 1.39ns | 5.36ns | 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.39μs | 0.707ns | 2.74ns | 0.016 | 0 | 0 | 1.14 KB |
| master | SendReceive |
netcoreapp3.1 | 1.73μs | 5.03ns | 19.5ns | 0.0154 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.16μs | 2.04ns | 7.88ns | 0.183 | 0 | 0 | 1.16 KB |
| #6302 | SendReceive |
net6.0 | 1.3μs | 0.352ns | 1.27ns | 0.0163 | 0 | 0 | 1.14 KB |
| #6302 | SendReceive |
netcoreapp3.1 | 1.73μs | 0.745ns | 2.88ns | 0.0152 | 0 | 0 | 1.14 KB |
| #6302 | SendReceive |
net472 | 2.04μs | 2.09ns | 8.08ns | 0.184 | 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.67μs | 0.985ns | 3.82ns | 0.0227 | 0 | 0 | 1.6 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.93μs | 2.47ns | 9.55ns | 0.0215 | 0 | 0 | 1.65 KB |
| master | EnrichedLog |
net472 | 4.35μs | 3.89ns | 14ns | 0.323 | 0 | 0 | 2.04 KB |
| #6302 | EnrichedLog |
net6.0 | 2.6μs | 0.952ns | 3.69ns | 0.022 | 0 | 0 | 1.6 KB |
| #6302 | EnrichedLog |
netcoreapp3.1 | 3.87μs | 2.51ns | 9.04ns | 0.0212 | 0 | 0 | 1.65 KB |
| #6302 | EnrichedLog |
net472 | 4.38μs | 2.88ns | 10.8ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6302
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472
1.174
939.86
800.43
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0
1.116
448.29
401.59
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1
1.115
775.76
695.81
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 | 1.174 | 939.86 | 800.43 | |
| Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.116 | 448.29 | 401.59 | |
| Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 1.115 | 775.76 | 695.81 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net6.0 | 448ns | 0.279ns | 1.08ns | 0.00801 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 560ns | 0.304ns | 1.1ns | 0.00786 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 700ns | 0.388ns | 1.5ns | 0.0915 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 488ns | 0.249ns | 0.965ns | 0.00979 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 776ns | 0.426ns | 1.65ns | 0.00933 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 940ns | 0.499ns | 1.93ns | 0.104 | 0 | 0 | 658 B |
| #6302 | StartFinishSpan |
net6.0 | 402ns | 0.299ns | 1.16ns | 0.00808 | 0 | 0 | 576 B |
| #6302 | StartFinishSpan |
netcoreapp3.1 | 582ns | 0.612ns | 2.37ns | 0.00788 | 0 | 0 | 576 B |
| #6302 | StartFinishSpan |
net472 | 656ns | 0.279ns | 1.04ns | 0.0918 | 0 | 0 | 578 B |
| #6302 | StartFinishScope |
net6.0 | 511ns | 0.241ns | 0.933ns | 0.00983 | 0 | 0 | 696 B |
| #6302 | StartFinishScope |
netcoreapp3.1 | 696ns | 0.484ns | 1.81ns | 0.00922 | 0 | 0 | 696 B |
| #6302 | StartFinishScope |
net472 | 800ns | 0.399ns | 1.44ns | 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 | 690ns | 1.36ns | 5.29ns | 0.00986 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 957ns | 0.598ns | 2.32ns | 0.0092 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.14μs | 0.616ns | 2.39ns | 0.104 | 0 | 0 | 658 B |
| #6302 | RunOnMethodBegin |
net6.0 | 664ns | 0.864ns | 3.35ns | 0.00978 | 0 | 0 | 696 B |
| #6302 | RunOnMethodBegin |
netcoreapp3.1 | 923ns | 0.644ns | 2.41ns | 0.00926 | 0 | 0 | 696 B |
| #6302 | RunOnMethodBegin |
net472 | 1.12μs | 0.482ns | 1.87ns | 0.104 | 0 | 0 | 658 B |
655c1a5 to
14f86c6
Compare
8fa918f to
4f47cce
Compare
795342c to
56b3683
Compare
Benchmarks Report for appsec 🐌Benchmarks for #6302 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 ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 253.17 KB | 264.21 KB | 11.04 KB | 4.36% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 255.67 KB | 266.14 KB | 10.46 KB | 4.09% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 61.66 KB | 59.07 KB | -2.59 KB | -4.20% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 59.1μs | 724ns | 7.06μs | 0 | 0 | 0 | 43.44 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 62.6μs | 751ns | 7.32μs | 0 | 0 | 0 | 42.64 KB |
| master | StringConcatBenchmark |
net472 | 36.9μs | 78.3ns | 293ns | 0 | 0 | 0 | 61.66 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 310μs | 4.87μs | 45.9μs | 0 | 0 | 0 | 255.67 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 335μs | 1.55μs | 9.67μs | 0 | 0 | 0 | 253.17 KB |
| master | StringConcatAspectBenchmark |
net472 | 274μs | 5.18μs | 50.2μs | 0 | 0 | 0 | 278.53 KB |
| #6302 | StringConcatBenchmark |
net6.0 | 58.5μs | 675ns | 6.68μs | 0 | 0 | 0 | 43.44 KB |
| #6302 | StringConcatBenchmark |
netcoreapp3.1 | 61.5μs | 797ns | 7.89μs | 0 | 0 | 0 | 42.64 KB |
| #6302 | StringConcatBenchmark |
net472 | 38μs | 90.7ns | 339ns | 0 | 0 | 0 | 59.07 KB |
| #6302 | StringConcatAspectBenchmark |
net6.0 | 320μs | 1.75μs | 10.1μs | 0 | 0 | 0 | 266.14 KB |
| #6302 | StringConcatAspectBenchmark |
netcoreapp3.1 | 348μs | 1.49μs | 6.84μs | 0 | 0 | 0 | 264.21 KB |
| #6302 | StringConcatAspectBenchmark |
net472 | 272μs | 4.83μs | 46.1μs | 0 | 0 | 0 | 278.53 KB |
| } | ||
|
|
||
| var loginAnon = UserEventsCommon.Anonymize(login); | ||
| tryAddTag(Tags.AppSec.EventsUsers.LoginEvent.FailureUserLogin, loginAnon!); |
There was a problem hiding this comment.
is the ! in loginAnon! required? method Anonymize returns a non nullable string
There was a problem hiding this comment.
yes, I m not sure why the compiler doesn't like it with the func tryAddTag
There was a problem hiding this comment.
I suspect you can remove this now? 🤔 GetAnonId used to return a string?, but Anonymize returns string.
5d77cfc to
712e641
Compare
andrewlock
left a comment
There was a problem hiding this comment.
LGTM in general, just some small suggestions
| } | ||
| else | ||
| { | ||
| processPii = val => val; |
There was a problem hiding this comment.
nit: rather than allocating a lambda here, I would be inclined to make processPii nullable and execute it like this:
var userId = processPii?.Invoke(claim.Value) ?? claim.Value;
There was a problem hiding this comment.
Changed in 03da607 in all files with this mechanism, thanks
| var encodedBytes = Encoding.UTF8.GetBytes(id); | ||
| #if NET6_0_OR_GREATER | ||
| var destination = new Span<byte>(new byte[32]); | ||
| var successfullyHashed = SHA256.TryHashData(new ReadOnlySpan<byte>(encodedBytes), destination, out var bytesWritten); |
There was a problem hiding this comment.
Seeing as you're going to the trouble to differentiate for .NET 6, I think you should be able to make this pretty much non-allocating. e.g. you can potentially use this overload of GetBytes (though that might be more hassle than you want).
You can definitely stackalloc the destination bytes though for example:
Span<byte> destination = stackalloc byte[32];
| } | ||
|
|
||
| return null; | ||
| Log.Warning<int>("Couldn't anonymize user information (login or id), byteArray length was {BytesWritten}", bytesWritten); |
There was a problem hiding this comment.
Is this method called at every login or for every request with identity information? If the latter, then this could be invoked a lot, so we might want to make this debug. If it's only on login, then it's probably ok, but given there's no action or anything for the user to do, I don't know if it should just be Debug anyway?
There was a problem hiding this comment.
Yes, it should never happen but.. if it ever happened indeed it would be for every authenticated request (an incoming PR should collect user info for every authenticated request) so changed in 03da607
| tryAddTag(Tags.AppSec.EventsUsers.SignUpEvent.UserId, userId!); | ||
| tryAddTag(Tags.AppSec.EventsUsers.InternalUserId, userId!); |
There was a problem hiding this comment.
The ! is because userId could be null here, right? I would suggest that either we should only add these tags if userId is non-null, or we should do a null coalesce?
| tryAddTag(Tags.AppSec.EventsUsers.SignUpEvent.UserId, userId!); | |
| tryAddTag(Tags.AppSec.EventsUsers.InternalUserId, userId!); | |
| tryAddTag(Tags.AppSec.EventsUsers.SignUpEvent.UserId, userId ?? string.Empty); | |
| tryAddTag(Tags.AppSec.EventsUsers.InternalUserId, userId ?? string.Empty); |
There was a problem hiding this comment.
Good catch thank you!! I actually removed those two lines, as they were in the if for foundUserId 03da607#diff-45833ea1519335c185aff6d47c0d0e1ce4f6188c5c8f55a4d541144abebe9963R31
|
|
||
| internal static string? GetLogin(IIdentityUser? user) => user?.UserName ?? user?.Email; | ||
|
|
||
| internal static unsafe string Anonymize(string id) |
There was a problem hiding this comment.
Does this really need to be unsafe? 🤔
There was a problem hiding this comment.
unfortunately stackalloc seems to need the unsafe keyword..
There was a problem hiding this comment.
stackalloc doesn't need the unsafe keyword as long as you explicitly set the variable type to Span<T> and don't use var 🙂 https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc
There was a problem hiding this comment.
oh cool I didnt know that thanks
although it's gotta be compatible net461... so doesnt seem like I can really declare a Span<T> here
| } | ||
|
|
||
| var loginAnon = UserEventsCommon.Anonymize(login); | ||
| tryAddTag(Tags.AppSec.EventsUsers.LoginEvent.FailureUserLogin, loginAnon!); |
There was a problem hiding this comment.
I suspect you can remove this now? 🤔 GetAnonId used to return a string?, but Anonymize returns string.
725cf8f to
484d6f8
Compare
## Summary of changes Fix signup tags that weren't correct. Add login tags on failure and other internal tagss as per [RFC](https://docs.google.com/document/d/1RT38U6dTTcB-8muiYV4-aVDCsT_XrliyakjtAPyjUpw/edit?tab=t.0#heading=h.dy0zssue7nq2) ## Reason for change ## Implementation details ## Test coverage ## Other details <!-- Fixes #{issue} --> <!--⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
Summary of changes
Fix signup tags that weren't correct.
Add login tags on failure and other internal tagss as per RFC
Reason for change
Implementation details
Test coverage
Other details