Skip to content

[AppSec] Move AppSec config keys to their own file#2700

Merged
robertpi merged 1 commit into
masterfrom
appsec/robert/config-key-refectoring
Apr 20, 2022
Merged

[AppSec] Move AppSec config keys to their own file#2700
robertpi merged 1 commit into
masterfrom
appsec/robert/config-key-refectoring

Conversation

@robertpi

Copy link
Copy Markdown
Member

Summary of changes

Regroups app sec config keys in their own file, for improved readability.

Reason for change

Request from @andrewlock

@robertpi
robertpi requested a review from a team as a code owner April 19, 2022 13:01
@robertpi robertpi changed the title Move AppSec config keys to their own file [AppSec] Move AppSec config keys to their own file Apr 19, 2022
@andrewlock

Copy link
Copy Markdown
Member

Code Coverage Report 📊

⚠️ Merging #2700 into master will will decrease line coverage by 1%
⚠️ Merging #2700 into master will will decrease branch coverage by 1%
⛔ Merging #2700 into master will will increase complexity by 113

master #2700 Change
Lines 13550 / 18651 13557 / 18814
Lines % 73% 72% -1% ⚠️
Branches 7822 / 11131 7823 / 11237
Branches % 70% 70% -1% ⚠️
Complexity 12416 12529 113

View the full report for further details:

Datadog.Trace Breakdown ⚠️

master #2700 Change
Lines % 73% 72% -1% ⚠️
Branches % 70% 70% -1% ⚠️
Complexity 12416 12529 113

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.TracerManager -29% -32% 88
Datadog.Trace.Telemetry.JsonHttpClientTelemetryTransport -26% -38% 0 ✔️
Datadog.Trace.AppSec.Transports.Http.HttpTransport -20% 0% ✔️ 3
Datadog.Trace.AppSec.Waf.Context -18% -38% 7
Datadog.Trace.AppSec.Security -6% -11% 12
Datadog.Trace.DiagnosticListeners.AspNetCoreDiagnosticObserver -4% ⚠️ -6% 0 ✔️
Datadog.Trace.Ci.GitInfo 5% ✔️ 7% ✔️ 0 ✔️
Datadog.Trace.Ci.CIVisibility 7% ✔️ 7% ✔️ 0 ✔️

The following classes were added in #2700:

File Line coverage Branch coverage Complexity
Datadog.Trace.SpanContextExtractor 100% 100% 1

View the full reports for further details:

@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report 🐌

Benchmarks for #2700 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.128
  • 4 benchmarks are slower, with geometric mean 1.214
  • 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 1.03ms 5.33μs 24.4μs 0 0 0 3.16 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 718μs 3.5μs 18.5μs 0 0 0 2.57 KB
#2700 WriteAndFlushEnrichedTraces net472 1.01ms 5.39μs 29.5μs 0 0 0 3.16 KB
#2700 WriteAndFlushEnrichedTraces netcoreapp3.1 764μs 4.33μs 31.2μs 0 0 0 2.57 KB
Benchmarks.Trace.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 313ns 1.59ns 6.93ns 0.066 0 0 417 B
master AllCycleSimpleBody netcoreapp3.1 415ns 1.55ns 6.01ns 0.0058 0 0 416 B
master AllCycleMoreComplexBody net472 307ns 1.38ns 5.18ns 0.0622 0 0 393 B
master AllCycleMoreComplexBody netcoreapp3.1 396ns 1.29ns 4.84ns 0.00535 0 0 392 B
master BodyExtractorSimpleBody net472 454ns 2.31ns 11.1ns 0.0569 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 447ns 1.97ns 7.62ns 0.00375 0 0 272 B
master BodyExtractorMoreComplexBody net472 24μs 87.5ns 316ns 1.18 0.0122 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 21μs 75ns 291ns 0.0952 0 0 6.75 KB
#2700 AllCycleSimpleBody net472 334ns 1.71ns 8.21ns 0.066 0 0 417 B
#2700 AllCycleSimpleBody netcoreapp3.1 411ns 2.01ns 8.98ns 0.00583 0 0 416 B
#2700 AllCycleMoreComplexBody net472 318ns 1.75ns 10.1ns 0.0622 0 0 393 B
#2700 AllCycleMoreComplexBody netcoreapp3.1 412ns 2.26ns 13.7ns 0.00531 0 0 392 B
#2700 BodyExtractorSimpleBody net472 435ns 2.17ns 9.7ns 0.057 0 0 361 B
#2700 BodyExtractorSimpleBody netcoreapp3.1 484ns 2.51ns 12.8ns 0.0037 0 0 272 B
#2700 BodyExtractorMoreComplexBody net472 24.7μs 131ns 729ns 1.19 0.012 0 7.62 KB
#2700 BodyExtractorMoreComplexBody netcoreapp3.1 21.1μs 108ns 493ns 0.097 0 0 6.75 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 net472 0ns 0ns 0ns 0 0 0 0 b
master SendRequest netcoreapp3.1 295μs 1.4μs 5.44μs 0.293 0 0 19.74 KB
#2700 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#2700 SendRequest netcoreapp3.1 296μs 1.19μs 4.28μs 0.193 0 0 19.74 KB
Benchmarks.Trace.DbCommandBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2700

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net472 1.172 1,693.28 1,984.35 bimodal

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net472 1.7μs 8.34ns 33.4ns 0.0941 0 0 594 B
master ExecuteNonQuery netcoreapp3.1 1.6μs 9.29ns 73.7ns 0.00849 0 0 632 B
#2700 ExecuteNonQuery net472 2μs 11.5ns 92.6ns 0.0943 0.000924 0 594 B
#2700 ExecuteNonQuery netcoreapp3.1 1.49μs 6.99ns 27.1ns 0.00852 0 0 632 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2700

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 1.128 2,092.93 1,855.33

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net472 2.51μs 12.2ns 48.8ns 0.127 0 0 803 B
master CallElasticsearch netcoreapp3.1 1.68μs 6.15ns 23ns 0.0109 0 0 792 B
master CallElasticsearchAsync net472 2.76μs 11.8ns 45.7ns 0.148 0.00135 0 939 B
master CallElasticsearchAsync netcoreapp3.1 2.11μs 10.9ns 50ns 0.0124 0 0 912 B
#2700 CallElasticsearch net472 2.63μs 7.4ns 27.7ns 0.127 0 0 803 B
#2700 CallElasticsearch netcoreapp3.1 1.72μs 8.32ns 35.3ns 0.0109 0 0 792 B
#2700 CallElasticsearchAsync net472 3.06μs 13.1ns 47.3ns 0.148 0.00148 0 939 B
#2700 CallElasticsearchAsync netcoreapp3.1 1.87μs 10.1ns 53.3ns 0.0129 0 0 912 B
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2700

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 1.345 1,999.26 2,689.11 several?

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net472 3μs 14.2ns 60.3ns 0.168 0.00147 0 1.06 KB
master ExecuteAsync netcoreapp3.1 2μs 11.3ns 75.1ns 0.0143 0 0 1.03 KB
#2700 ExecuteAsync net472 3.14μs 15.5ns 65.8ns 0.167 0.00159 0 1.06 KB
#2700 ExecuteAsync netcoreapp3.1 2.67μs 20.5ns 204ns 0.0151 0 0 1.03 KB
Benchmarks.Trace.HttpClientBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2700

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑netcoreapp3.1 1.164 4,690.39 5,458.72

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 6.79μs 33.6ns 138ns 0.361 0 0 2.28 KB
master SendAsync netcoreapp3.1 4.68μs 16.8ns 65.2ns 0.0301 0 0 2.21 KB
#2700 SendAsync net472 7.34μs 38.8ns 190ns 0.359 0 0 2.28 KB
#2700 SendAsync netcoreapp3.1 5.46μs 30ns 173ns 0.0303 0 0 2.21 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 net472 3.59μs 19.8ns 121ns 0.227 0 0 1.45 KB
master EnrichedLog netcoreapp3.1 3.15μs 17.4ns 99.9ns 0.0213 0 0 1.53 KB
#2700 EnrichedLog net472 3.39μs 17.1ns 103ns 0.227 0 0 1.45 KB
#2700 EnrichedLog netcoreapp3.1 3.3μs 15.3ns 59.3ns 0.0208 0 0 1.53 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 net472 284μs 1.33μs 4.97μs 0.441 0.147 0 4.33 KB
master EnrichedLog netcoreapp3.1 227μs 745ns 2.79μs 0 0 0 4.21 KB
#2700 EnrichedLog net472 287μs 1.07μs 4μs 0.42 0.14 0 4.33 KB
#2700 EnrichedLog netcoreapp3.1 233μs 1.25μs 6.36μs 0 0 0 4.21 KB
Benchmarks.Trace.NLogBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2700

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 1.184 7,306.12 8,651.17

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 7.32μs 30.3ns 109ns 0.506 0 0 3.23 KB
master EnrichedLog netcoreapp3.1 6.4μs 30.2ns 117ns 0.0507 0 0 3.6 KB
#2700 EnrichedLog net472 8.68μs 44.6ns 218ns 0.505 0 0 3.23 KB
#2700 EnrichedLog netcoreapp3.1 6.53μs 35ns 188ns 0.0511 0 0 3.6 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 net472 2.42μs 9.33ns 37.3ns 0.16 0.00118 0 1.01 KB
master SendReceive netcoreapp3.1 1.96μs 6.33ns 24.5ns 0.0136 0 0 1.01 KB
#2700 SendReceive net472 2.46μs 13.7ns 80.8ns 0.16 0.00121 0 1.01 KB
#2700 SendReceive netcoreapp3.1 2.08μs 9.4ns 35.2ns 0.0136 0 0 1.01 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 net472 6.61μs 37.2ns 244ns 0.292 0 0 1.87 KB
master EnrichedLog netcoreapp3.1 5.19μs 22.7ns 84.8ns 0.0207 0 0 1.49 KB
#2700 EnrichedLog net472 6.75μs 38.9ns 304ns 0.29 0 0 1.87 KB
#2700 EnrichedLog netcoreapp3.1 5.57μs 32.3ns 285ns 0.0203 0 0 1.49 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 net472 924ns 4.42ns 18.7ns 0.0719 0 0 457 B
master StartFinishSpan netcoreapp3.1 932ns 5.31ns 39.1ns 0.00618 0 0 456 B
master StartFinishScope net472 1.06μs 5.42ns 24.8ns 0.0845 0 0 538 B
master StartFinishScope netcoreapp3.1 1.08μs 6.26ns 53.5ns 0.00805 0 0 576 B
#2700 StartFinishSpan net472 999ns 4.23ns 16.4ns 0.0715 0 0 457 B
#2700 StartFinishSpan netcoreapp3.1 912ns 4.3ns 17.7ns 0.00629 0 0 456 B
#2700 StartFinishScope net472 1.11μs 6.03ns 36.2ns 0.0844 0 0 538 B
#2700 StartFinishScope netcoreapp3.1 1.08μs 5.77ns 28.9ns 0.00819 0 0 576 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 net472 1.36μs 7.31ns 42ns 0.0843 0 0 538 B
master RunOnMethodBegin netcoreapp3.1 1.26μs 6.62ns 31.7ns 0.0075 0 0 576 B
#2700 RunOnMethodBegin net472 1.31μs 4.48ns 16.7ns 0.0839 0 0 538 B
#2700 RunOnMethodBegin netcoreapp3.1 1.17μs 5.54ns 21.4ns 0.00777 0 0 576 B

@robertpi
robertpi merged commit fe8df8e into master Apr 20, 2022
@robertpi
robertpi deleted the appsec/robert/config-key-refectoring branch April 20, 2022 06:55
@github-actions github-actions Bot added this to the vNext milestone Apr 20, 2022
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