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

[ASM][ATO] user id from sdk overwrite user login tags #6603

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Jan 29, 2025

Summary of changes

Copy user id from sdk to login field , for span and waf
Add collection_mode on the set user api
change snapshots accordingly

Reason for change

Addendum in Confluence [ADDENDUM 2024-12-18] In both login success and failure, the field usr.login must be passed to root span metadata tags (appsec.events.users.login.(success|failure).usr.login), and to the WAF. The value of this field must be sourced from either the user object when available, or copied from the value of the mandatory user ID.

Implementation details

Test coverage

Other details

@andrewlock
Copy link
Member

andrewlock commented Jan 29, 2025

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 (6603) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (69ms)  : 65, 74
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (981ms)  : 955, 1007
     .   : milestone, 981,
    master - mean (981ms)  : 959, 1003
     .   : milestone, 981,

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

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (672ms)  : 658, 687
     .   : milestone, 672,
    master - mean (676ms)  : 660, 691
     .   : milestone, 676,

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

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (628ms)  : 608, 647
     .   : milestone, 628,
    master - mean (637ms)  : 614, 660
     .   : milestone, 637,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6603) - mean (189ms)  : 185, 193
     .   : milestone, 189,
    master - mean (190ms)  : 185, 195
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (1,082ms)  : 1051, 1112
     .   : milestone, 1082,
    master - mean (1,087ms)  : 1064, 1110
     .   : milestone, 1087,

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

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (857ms)  : 829, 885
     .   : milestone, 857,
    master - mean (865ms)  : 832, 897
     .   : milestone, 865,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6603) - mean (263ms)  : 260, 266
     .   : milestone, 263,
    master - mean (264ms)  : 260, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (6603) - mean (839ms)  : 814, 864
     .   : milestone, 839,
    master - mean (846ms)  : 807, 885
     .   : milestone, 846,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jan 29, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6603 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.145
  • 3 benchmarks are slower, with geometric mean 1.174
  • 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.98μs 45.1ns 296ns 0.0152 0.0076 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.5ns 314ns 0.0207 0.0103 0 5.8 KB
master StartStopWithChild net472 16.1μs 50.1ns 194ns 1.05 0.326 0.0953 6.21 KB
#6603 StartStopWithChild net6.0 8.13μs 46.2ns 320ns 0.0117 0.00389 0 5.61 KB
#6603 StartStopWithChild netcoreapp3.1 9.97μs 55ns 325ns 0.021 0.00526 0 5.81 KB
#6603 StartStopWithChild net472 16.8μs 91.7ns 535ns 1.06 0.324 0.108 6.21 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 485μs 285ns 1.11μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 413ns 1.6μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 857μs 620ns 2.15μs 0.425 0 0 3.3 KB
#6603 WriteAndFlushEnrichedTraces net6.0 505μs 268ns 966ns 0 0 0 2.7 KB
#6603 WriteAndFlushEnrichedTraces netcoreapp3.1 659μs 284ns 1.02μs 0 0 0 2.7 KB
#6603 WriteAndFlushEnrichedTraces net472 840μs 435ns 1.57μs 0.419 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 127μs 595ns 2.38μs 0.194 0 0 14.47 KB
master SendRequest netcoreapp3.1 144μs 637ns 2.47μs 0.217 0 0 17.27 KB
master SendRequest net472 0.00201ns 0.000798ns 0.00299ns 0 0 0 0 b
#6603 SendRequest net6.0 128μs 557ns 2.16μs 0.128 0 0 14.47 KB
#6603 SendRequest netcoreapp3.1 142μs 716ns 3.04μs 0.217 0 0 17.27 KB
#6603 SendRequest net472 0.00215ns 0.00134ns 0.00519ns 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 571μs 2.95μs 13.5μs 0.541 0 0 41.73 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 663μs 3.6μs 21μs 0.334 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 837μs 2.99μs 11.2μs 8.08 2.55 0.425 53.29 KB
#6603 WriteAndFlushEnrichedTraces net6.0 551μs 2.41μs 9.65μs 0.573 0 0 41.7 KB
#6603 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 3.37μs 16.9μs 0.324 0 0 41.62 KB
#6603 WriteAndFlushEnrichedTraces net472 855μs 4.21μs 17.9μs 8.39 2.52 0.419 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.41μs 1.25ns 4.67ns 0.0147 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.82μs 2ns 7.76ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 2.01μs 1.01ns 3.64ns 0.156 0.00101 0 987 B
#6603 ExecuteNonQuery net6.0 1.28μs 1.52ns 5.7ns 0.0141 0 0 1.02 KB
#6603 ExecuteNonQuery netcoreapp3.1 1.82μs 0.978ns 3.53ns 0.0138 0 0 1.02 KB
#6603 ExecuteNonQuery net472 2.01μs 3.42ns 12.8ns 0.156 0.001 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6603

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.162 1,354.66 1,165.61

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.35μs 0.54ns 2.09ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.64μs 0.932ns 3.36ns 0.0132 0 0 976 B
master CallElasticsearch net472 2.57μs 1.65ns 6.37ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.26μs 0.981ns 3.54ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.59μs 0.944ns 3.4ns 0.0142 0 0 1.02 KB
master CallElasticsearchAsync net472 2.66μs 1.12ns 4.04ns 0.166 0 0 1.05 KB
#6603 CallElasticsearch net6.0 1.17μs 0.658ns 2.46ns 0.0139 0 0 976 B
#6603 CallElasticsearch netcoreapp3.1 1.51μs 0.688ns 2.57ns 0.013 0 0 976 B
#6603 CallElasticsearch net472 2.53μs 1.16ns 4.51ns 0.157 0 0 995 B
#6603 CallElasticsearchAsync net6.0 1.26μs 0.429ns 1.66ns 0.0134 0 0 952 B
#6603 CallElasticsearchAsync netcoreapp3.1 1.73μs 0.579ns 2.24ns 0.0138 0 0 1.02 KB
#6603 CallElasticsearchAsync net472 2.66μs 1.71ns 6.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.35μs 0.872ns 3.26ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.72μs 2.08ns 7.8ns 0.012 0 0 952 B
master ExecuteAsync net472 1.85μs 0.467ns 1.81ns 0.145 0 0 915 B
#6603 ExecuteAsync net6.0 1.26μs 0.553ns 2.14ns 0.0133 0 0 952 B
#6603 ExecuteAsync netcoreapp3.1 1.67μs 0.517ns 2ns 0.0125 0 0 952 B
#6603 ExecuteAsync net472 1.89μs 0.469ns 1.82ns 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.43μs 1.39ns 5.01ns 0.031 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.17μs 2.98ns 11.5ns 0.0386 0 0 2.85 KB
master SendAsync net472 7.36μs 1.09ns 4.07ns 0.494 0 0 3.12 KB
#6603 SendAsync net6.0 4.43μs 2.04ns 7.89ns 0.0312 0 0 2.31 KB
#6603 SendAsync netcoreapp3.1 5.26μs 14.1ns 54.6ns 0.0391 0 0 2.85 KB
#6603 SendAsync net472 7.41μs 1.6ns 6.2ns 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.45μs 0.879ns 3.41ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.06μs 0.847ns 3.05ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.65μs 0.735ns 2.65ns 0.249 0 0 1.57 KB
#6603 EnrichedLog net6.0 1.46μs 0.523ns 1.96ns 0.0233 0 0 1.64 KB
#6603 EnrichedLog netcoreapp3.1 2.08μs 0.729ns 2.73ns 0.0219 0 0 1.64 KB
#6603 EnrichedLog net472 2.6μs 2.09ns 8.1ns 0.25 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 76.3ns 285ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 109ns 379ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 94.2ns 365ns 0.679 0.226 0 4.46 KB
#6603 EnrichedLog net6.0 116μs 111ns 429ns 0.0582 0 0 4.28 KB
#6603 EnrichedLog netcoreapp3.1 120μs 140ns 524ns 0 0 0 4.28 KB
#6603 EnrichedLog net472 149μs 73.3ns 264ns 0.676 0.225 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.05μs 2.17ns 8.13ns 0.0306 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.26μs 0.929ns 3.35ns 0.0297 0 0 2.2 KB
master EnrichedLog net472 4.85μs 1.77ns 6.86ns 0.319 0 0 2.02 KB
#6603 EnrichedLog net6.0 2.89μs 1.33ns 5.16ns 0.0304 0 0 2.2 KB
#6603 EnrichedLog netcoreapp3.1 4.23μs 3.16ns 12.2ns 0.0295 0 0 2.2 KB
#6603 EnrichedLog net472 4.82μs 0.785ns 2.94ns 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.34μs 0.537ns 1.94ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.74μs 1.94ns 7.49ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.14μs 1.04ns 4.03ns 0.183 0 0 1.16 KB
#6603 SendReceive net6.0 1.42μs 1.47ns 5.69ns 0.0164 0 0 1.14 KB
#6603 SendReceive netcoreapp3.1 1.79μs 1.75ns 6.78ns 0.0153 0 0 1.14 KB
#6603 SendReceive net472 2.08μs 0.616ns 2.39ns 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.81μs 1.08ns 4.19ns 0.0225 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.85μs 1.39ns 5.38ns 0.0231 0 0 1.65 KB
master EnrichedLog net472 4.47μs 2.69ns 10.4ns 0.323 0 0 2.04 KB
#6603 EnrichedLog net6.0 2.76μs 1.01ns 3.63ns 0.0223 0 0 1.6 KB
#6603 EnrichedLog netcoreapp3.1 3.84μs 1.15ns 4.46ns 0.0211 0 0 1.65 KB
#6603 EnrichedLog net472 4.58μs 3.24ns 12.5ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6603

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.248 393.90 491.58
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.157 486.69 563.15
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.122 547.93 614.57

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 394ns 0.68ns 2.63ns 0.00797 0 0 576 B
master StartFinishSpan netcoreapp3.1 549ns 0.822ns 3.18ns 0.00775 0 0 576 B
master StartFinishSpan net472 633ns 1.31ns 5.09ns 0.0915 0 0 578 B
master StartFinishScope net6.0 487ns 1.12ns 4.35ns 0.00976 0 0 696 B
master StartFinishScope netcoreapp3.1 698ns 1.82ns 6.8ns 0.00952 0 0 696 B
master StartFinishScope net472 827ns 1.31ns 5.08ns 0.104 0 0 658 B
#6603 StartFinishSpan net6.0 492ns 0.417ns 1.5ns 0.00806 0 0 576 B
#6603 StartFinishSpan netcoreapp3.1 614ns 0.607ns 2.19ns 0.00773 0 0 576 B
#6603 StartFinishSpan net472 599ns 0.994ns 3.72ns 0.0918 0 0 578 B
#6603 StartFinishScope net6.0 563ns 0.436ns 1.69ns 0.00978 0 0 696 B
#6603 StartFinishScope netcoreapp3.1 717ns 0.707ns 2.74ns 0.00929 0 0 696 B
#6603 StartFinishScope net472 900ns 2.7ns 10.4ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6603

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.129 695.26 615.91

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 694ns 0.825ns 3.2ns 0.00981 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 903ns 1.37ns 5.29ns 0.00918 0 0 696 B
master RunOnMethodBegin net472 1.04μs 1.37ns 5.3ns 0.104 0 0 658 B
#6603 RunOnMethodBegin net6.0 617ns 0.48ns 1.86ns 0.00996 0 0 696 B
#6603 RunOnMethodBegin netcoreapp3.1 975ns 1.97ns 7.63ns 0.00923 0 0 696 B
#6603 RunOnMethodBegin net472 1.08μs 0.512ns 1.92ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Jan 29, 2025

Benchmarks Report for appsec 🐌

Benchmarks for #6603 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.177
  • 1 benchmarks have fewer allocations
  • 1 benchmarks have more 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.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6603

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑net472 1.177 3,648.16 4,292.66

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 204μs 112ns 420ns 2.65 0 0 188.69 KB
master AllCycleSimpleBody netcoreapp3.1 307μs 294ns 1.1μs 2.61 0 0 196.02 KB
master AllCycleSimpleBody net472 269μs 117ns 452ns 35.8 2.04 0 225.76 KB
master AllCycleMoreComplexBody net6.0 207μs 163ns 611ns 2.67 0 0 192.19 KB
master AllCycleMoreComplexBody netcoreapp3.1 311μs 78.5ns 294ns 2.64 0 0 199.43 KB
master AllCycleMoreComplexBody net472 281μs 170ns 657ns 36.4 2.11 0 229.27 KB
master ObjectExtractorSimpleBody net6.0 140ns 0.105ns 0.395ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 197ns 0.0731ns 0.274ns 0.00378 0 0 272 B
master ObjectExtractorSimpleBody net472 175ns 0.735ns 2.85ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.91μs 7.76ns 30.1ns 0.0539 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.81μs 2.65ns 9.92ns 0.0496 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.65μs 3.14ns 12.2ns 0.603 0.0055 0 3.8 KB
#6603 AllCycleSimpleBody net6.0 199μs 97.1ns 363ns 2.69 0.0997 0 188.69 KB
#6603 AllCycleSimpleBody netcoreapp3.1 303μs 69.7ns 251ns 2.57 0 0 196.02 KB
#6603 AllCycleSimpleBody net472 268μs 131ns 490ns 35.8 2.01 0 225.75 KB
#6603 AllCycleMoreComplexBody net6.0 205μs 123ns 460ns 2.67 0 0 192.19 KB
#6603 AllCycleMoreComplexBody netcoreapp3.1 314μs 237ns 919ns 2.66 0 0 199.43 KB
#6603 AllCycleMoreComplexBody net472 275μs 207ns 774ns 36.3 2.08 0 229.27 KB
#6603 ObjectExtractorSimpleBody net6.0 140ns 0.139ns 0.518ns 0.00396 0 0 280 B
#6603 ObjectExtractorSimpleBody netcoreapp3.1 191ns 0.267ns 1ns 0.00366 0 0 272 B
#6603 ObjectExtractorSimpleBody net472 163ns 0.141ns 0.527ns 0.0446 0 0 281 B
#6603 ObjectExtractorMoreComplexBody net6.0 2.84μs 1.19ns 4.44ns 0.0524 0 0 3.78 KB
#6603 ObjectExtractorMoreComplexBody netcoreapp3.1 3.76μs 1.46ns 5.66ns 0.0507 0 0 3.69 KB
#6603 ObjectExtractorMoreComplexBody net472 4.29μs 0.936ns 3.24ns 0.602 0.00645 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 37.8μs 18.3ns 68.4ns 0.456 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 55.6μs 12.7ns 49ns 0.442 0 0 32.4 KB
master EncodeArgs net472 67μs 38.6ns 144ns 5.16 0.0675 0 32.5 KB
master EncodeLegacyArgs net6.0 72.8μs 34.1ns 123ns 0.0403 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 103μs 96.9ns 375ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 152μs 35.2ns 136ns 0.304 0 0 2.15 KB
#6603 EncodeArgs net6.0 36.7μs 12.9ns 49.8ns 0.459 0 0 32.4 KB
#6603 EncodeArgs netcoreapp3.1 54μs 22.5ns 81.1ns 0.428 0 0 32.4 KB
#6603 EncodeArgs net472 66μs 70.5ns 273ns 5.14 0.0659 0 32.5 KB
#6603 EncodeLegacyArgs net6.0 78.5μs 425ns 2.55μs 0 0 0 2.14 KB
#6603 EncodeLegacyArgs netcoreapp3.1 106μs 81.9ns 317ns 0 0 0 2.14 KB
#6603 EncodeLegacyArgs net472 153μs 53.4ns 200ns 0.305 0 0 2.15 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 176μs 292ns 1.13μs 0 0 0 2.54 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 332ns 1.24μs 0 0 0 2.49 KB
master RunWafRealisticBenchmark net472 202μs 141ns 545ns 0.397 0 0 2.55 KB
master RunWafRealisticBenchmarkWithAttack net6.0 120μs 32.7ns 127ns 0 0 0 1.57 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 175ns 677ns 0 0 0 1.55 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 41.3ns 155ns 0.198 0 0 1.58 KB
#6603 RunWafRealisticBenchmark net6.0 175μs 96.3ns 373ns 0 0 0 2.54 KB
#6603 RunWafRealisticBenchmark netcoreapp3.1 188μs 266ns 1.03μs 0 0 0 2.49 KB
#6603 RunWafRealisticBenchmark net472 201μs 104ns 376ns 0.401 0 0 2.55 KB
#6603 RunWafRealisticBenchmarkWithAttack net6.0 117μs 72.4ns 271ns 0 0 0 1.57 KB
#6603 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 73.3ns 274ns 0 0 0 1.55 KB
#6603 RunWafRealisticBenchmarkWithAttack net472 132μs 68.8ns 257ns 0.198 0 0 1.58 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6603

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 262.55 KB 264.89 KB 2.34 KB 0.89%

Fewer allocations 🎉 in #6603

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 61.9 KB 59.39 KB -2.51 KB -4.06%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.9μs 248ns 1.24μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 59.5μs 754ns 7.31μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 152ns 527ns 0 0 0 61.9 KB
master StringConcatAspectBenchmark net6.0 302μs 5.51μs 54.8μs 0 0 0 254.7 KB
master StringConcatAspectBenchmark netcoreapp3.1 348μs 1.95μs 12.3μs 0 0 0 262.55 KB
master StringConcatAspectBenchmark net472 293μs 5.78μs 56.6μs 0 0 0 278.53 KB
#6603 StringConcatBenchmark net6.0 52.3μs 189ns 705ns 0 0 0 43.44 KB
#6603 StringConcatBenchmark netcoreapp3.1 61.2μs 742ns 7.12μs 0 0 0 42.64 KB
#6603 StringConcatBenchmark net472 37.3μs 102ns 382ns 0 0 0 59.39 KB
#6603 StringConcatAspectBenchmark net6.0 317μs 1.7μs 12.3μs 0 0 0 253.63 KB
#6603 StringConcatAspectBenchmark netcoreapp3.1 354μs 1.95μs 13.8μs 0 0 0 264.89 KB
#6603 StringConcatAspectBenchmark net472 300μs 7.96μs 77.6μs 0 0 0 278.53 KB

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 29, 2025

Datadog Report

Branch report: anna/asm/userid-sdk-overwrite-login
Commit report: 2c812ab
Test service: dd-trace-dotnet

✅ 0 Failed, 546158 Passed, 3940 Skipped, 33h 38m 24.57s Total Time

Copy link
Contributor

github-actions bot commented Jan 29, 2025

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

15 occurrences of :

+      _dd.appsec.user.collection_mode: sdk

1 occurrences of :

+      appsec.events.users.login.success.usr.login: my-id,

1 occurrences of :

+      appsec.events.users.login.failure.usr.login: my-id,

14 occurrences of :

+      _dd.appsec.user.collection_mode: sdk,

1 occurrences of :

+      appsec.events.users.login.success.usr.login: blocked-user,

1 occurrences of :

+      appsec.events.users.login.success.usr.login: not-blocked-user,

1 occurrences of :

-      appsec.events.users.login.success.usr.login: anon_eb97d409396a3e5392936dad92b909da,
+      appsec.events.users.login.success.usr.login: blocked-user,

1 occurrences of :

-      appsec.events.users.login.success.usr.login: anon_eb97d409396a3e5392936dad92b909da,
+      appsec.events.users.login.success.usr.login: not-blocked-user,

3 occurrences of :

-      appsec.events.users.login.success.usr.login: TestUser,
+      appsec.events.users.login.success.usr.login: blocked-user,

3 occurrences of :

-      appsec.events.users.login.success.usr.login: TestUser,
+      appsec.events.users.login.success.usr.login: not-blocked-user,

@anna-git anna-git force-pushed the anna/asm/userid-sdk-overwrite-login branch 2 times, most recently from f98e1a7 to a290953 Compare January 30, 2025 09:41
@anna-git anna-git force-pushed the anna/asm/userid-sdk-overwrite-login branch from a290953 to 2c812ab Compare January 30, 2025 10:43
@anna-git anna-git marked this pull request as ready for review January 30, 2025 13:36
@anna-git anna-git requested review from a team as code owners January 30, 2025 13:36
@anna-git anna-git changed the title [ASM][ATO] user id from sdk overwrite user login tafs [ASM][ATO] user id from sdk overwrite user login tagx Jan 30, 2025
@anna-git anna-git changed the title [ASM][ATO] user id from sdk overwrite user login tagx [ASM][ATO] user id from sdk overwrite user login tagd Jan 30, 2025
@anna-git anna-git changed the title [ASM][ATO] user id from sdk overwrite user login tagd [ASM][ATO] user id from sdk overwrite user login tags Jan 30, 2025
@anna-git anna-git merged commit fd3dc65 into master Jan 30, 2025
137 of 140 checks passed
@anna-git anna-git deleted the anna/asm/userid-sdk-overwrite-login branch January 30, 2025 16:12
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 30, 2025
nhulston pushed a commit that referenced this pull request Jan 30, 2025
## Summary of changes

Copy user id from sdk to login field , for span and waf
Add collection_mode on the set user api 
change snapshots accordingly

## Reason for change

Addendum in Confluence [ADDENDUM 2024-12-18] In both login success and
failure, the field usr.login must be passed to root span metadata tags
(appsec.events.users.login.(success|failure).usr.login), and to the WAF.
The value of this field must be sourced from either the user object when
available, or copied from the value of the mandatory user ID.

## 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants