-
Notifications
You must be signed in to change notification settings - Fork 144
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
[Tracer] Elasticsearch Refactor Part 1 (AIT-8764) #4767
Conversation
Datadog ReportBranch report: ❄️ ❌ Failed Tests (132)
New Flaky Tests (2)
|
Benchmarks Report 🐌Benchmarks for #4767 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.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 1.148 | 671.38 | 770.67 | |
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 | 1.139 | 774.32 | 881.75 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 1.310 | 652.11 | 497.77 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 476ns | 0.23ns | 0.86ns | 0.00747 | 0 | 0 | 536 B |
master | StartFinishSpan |
netcoreapp3.1 | 652ns | 0.221ns | 0.826ns | 0.00717 | 0 | 0 | 536 B |
master | StartFinishSpan |
net472 | 699ns | 0.137ns | 0.529ns | 0.0853 | 0 | 0 | 538 B |
master | StartFinishScope |
net6.0 | 486ns | 0.276ns | 1.07ns | 0.00929 | 0 | 0 | 656 B |
master | StartFinishScope |
netcoreapp3.1 | 672ns | 0.24ns | 0.866ns | 0.00877 | 0 | 0 | 656 B |
master | StartFinishScope |
net472 | 775ns | 0.236ns | 0.915ns | 0.0982 | 0 | 0 | 618 B |
#4767 | StartFinishSpan |
net6.0 | 459ns | 0.321ns | 1.2ns | 0.00737 | 0 | 0 | 536 B |
#4767 | StartFinishSpan |
netcoreapp3.1 | 498ns | 0.15ns | 0.56ns | 0.00727 | 0 | 0 | 536 B |
#4767 | StartFinishSpan |
net472 | 707ns | 0.178ns | 0.667ns | 0.0852 | 0 | 0 | 538 B |
#4767 | StartFinishScope |
net6.0 | 471ns | 0.118ns | 0.442ns | 0.00912 | 0 | 0 | 656 B |
#4767 | StartFinishScope |
netcoreapp3.1 | 770ns | 0.265ns | 1.02ns | 0.00886 | 0 | 0 | 656 B |
#4767 | StartFinishScope |
net472 | 881ns | 0.417ns | 1.61ns | 0.098 | 0 | 0 | 618 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #4767
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
1.130
963.34
1,088.33
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 1.130 | 963.34 | 1,088.33 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 560ns | 0.165ns | 0.639ns | 0.00922 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 859ns | 0.26ns | 1.01ns | 0.00895 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
net472 | 963ns | 0.32ns | 1.24ns | 0.0982 | 0 | 0 | 618 B |
#4767 | RunOnMethodBegin |
net6.0 | 533ns | 0.541ns | 2.1ns | 0.00931 | 0 | 0 | 656 B |
#4767 | RunOnMethodBegin |
netcoreapp3.1 | 804ns | 0.167ns | 0.624ns | 0.00891 | 0 | 0 | 656 B |
#4767 | RunOnMethodBegin |
net472 | 1.09μs | 0.261ns | 1.01ns | 0.0978 | 0 | 0 | 618 B |
fca6399
to
e4845ee
Compare
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 (4767) - mean (71ms) : 62, 80
. : milestone, 71,
master - mean (72ms) : 62, 82
. : milestone, 72,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (993ms) : 971, 1015
. : milestone, 993,
master - mean (1,000ms) : 982, 1018
. : milestone, 1000,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4767) - mean (106ms) : 102, 109
. : milestone, 106,
master - mean (106ms) : 103, 109
. : milestone, 106,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (685ms) : 666, 704
. : milestone, 685,
master - mean (691ms) : 670, 713
. : milestone, 691,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4767) - mean (89ms) : 86, 93
. : milestone, 89,
master - mean (90ms) : 88, 92
. : milestone, 90,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (654ms) : 626, 683
. : milestone, 654,
master - mean (655ms) : 634, 677
. : milestone, 655,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4767) - mean (188ms) : 185, 191
. : milestone, 188,
master - mean (189ms) : 186, 191
. : milestone, 189,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (1,140ms) : 1118, 1162
. : milestone, 1140,
master - mean (1,153ms) : 1132, 1175
. : milestone, 1153,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4767) - mean (272ms) : 268, 276
. : milestone, 272,
master - mean (273ms) : 269, 277
. : milestone, 273,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (1,097ms) : 1072, 1121
. : milestone, 1097,
master - mean (1,103ms) : 1077, 1129
. : milestone, 1103,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4767) - mean (262ms) : 259, 265
. : milestone, 262,
master - mean (263ms) : 260, 267
. : milestone, 263,
section CallTarget+Inlining+NGEN
This PR (4767) - mean (1,064ms) : 1037, 1090
. : milestone, 1064,
master - mean (1,072ms) : 1044, 1100
. : milestone, 1072,
|
Throughput/Crank Report:zap: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 (4767) (10.624M) : 0, 10623596
master (10.858M) : 0, 10858226
benchmarks/2.38.0 (11.867M) : 0, 11866956
benchmarks/2.9.0 (11.240M) : 0, 11240287
section Automatic
This PR (4767) (7.356M) : 0, 7356191
master (7.460M) : 0, 7460403
benchmarks/2.38.0 (8.176M) : 0, 8175636
benchmarks/2.9.0 (7.993M) : 0, 7992575
section Trace stats
This PR (4767) (7.650M) : 0, 7650447
master (7.731M) : 0, 7731452
benchmarks/2.38.0 (8.450M) : 0, 8450370
section Manual
This PR (4767) (9.419M) : 0, 9418778
master (9.543M) : 0, 9542867
benchmarks/2.38.0 (10.334M) : 0, 10334368
section Manual + Automatic
This PR (4767) (7.073M) : 0, 7073127
master (6.981M) : 0, 6981252
benchmarks/2.38.0 (7.750M) : 0, 7750484
section Version Conflict
This PR (4767) (6.510M) : 0, 6510046
master (6.546M) : 0, 6546236
benchmarks/2.38.0 (7.137M) : 0, 7136691
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4767) (9.804M) : 0, 9804346
master (9.578M) : 0, 9578480
benchmarks/2.38.0 (9.548M) : 0, 9548121
benchmarks/2.9.0 (9.726M) : 0, 9725615
section Automatic
This PR (4767) (6.663M) : 0, 6662658
master (6.752M) : 0, 6752023
benchmarks/2.38.0 (6.747M) : 0, 6747227
section Trace stats
This PR (4767) (6.848M) : 0, 6847774
master (7.056M) : 0, 7055624
benchmarks/2.38.0 (6.815M) : 0, 6814846
section Manual
This PR (4767) (8.388M) : 0, 8388174
master (8.307M) : 0, 8306680
benchmarks/2.38.0 (8.263M) : 0, 8263131
section Manual + Automatic
This PR (4767) (6.395M) : 0, 6394821
master (6.217M) : 0, 6216711
benchmarks/2.38.0 (6.275M) : 0, 6275411
section Version Conflict
This PR (4767) (5.720M) : 0, 5719789
master (5.921M) : 0, 5921235
benchmarks/2.38.0 (5.670M) : 0, 5669744
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4767) (9.523M) : 0, 9523407
master (9.485M) : 0, 9485335
benchmarks/2.38.0 (9.007M) : 0, 9007066
benchmarks/2.9.0 (9.713M) : 0, 9713176
section Automatic
This PR (4767) (6.727M) : 0, 6726896
master (6.717M) : 0, 6716658
benchmarks/2.38.0 (6.423M) : 0, 6422756
benchmarks/2.9.0 (6.972M) : 0, 6971870
section Trace stats
This PR (4767) (7.027M) : 0, 7026789
master (6.967M) : 0, 6966783
benchmarks/2.38.0 (6.721M) : 0, 6720838
section Manual
This PR (4767) (8.419M) : 0, 8418633
master (8.322M) : 0, 8321923
benchmarks/2.38.0 (7.977M) : 0, 7977494
section Manual + Automatic
This PR (4767) (6.484M) : 0, 6483998
master (6.475M) : 0, 6474564
benchmarks/2.38.0 (6.349M) : 0, 6349066
section Version Conflict
This PR (4767) (5.974M) : 0, 5974203
master (5.862M) : 0, 5862141
benchmarks/2.38.0 (5.682M) : 0, 5681654
gantt
title Throughput Linux x64 (ASM) (Total requests)
dateFormat X
axisFormat %s
section Baseline
master (7.688M) : 0, 7687660
benchmarks/2.38.0 (7.578M) : 0, 7577544
benchmarks/2.9.0 (8.065M) : 0, 8064881
section No attack
master (2.239M) : 0, 2239244
benchmarks/2.38.0 (2.184M) : 0, 2184279
benchmarks/2.9.0 (3.354M) : 0, 3354146
section Attack
master (1.779M) : 0, 1778952
benchmarks/2.38.0 (1.711M) : 0, 1710542
benchmarks/2.9.0 (2.662M) : 0, 2661593
section Blocking
master (3.553M) : 0, 3553184
benchmarks/2.38.0 (3.486M) : 0, 3486124
section IAST default
master (6.995M) : 0, 6995161
section IAST full
master (6.364M) : 0, 6363731
section Base vuln
master (0.982M) : 0, 982038
section IAST vuln
master (0.930M) : 0, 929607
|
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.
Awesome, thanks! I didn't scrutinize the snapshots too closely, but they LGTM. The only potential issue may be flakiness around sort-order. I think we'll need to update the span order to sort by resource name and elasticsearch.url tag
tracer/test/snapshots/Elasticsearch5Tests.SubmitsTraces_SchemaV0.verified.txt
Outdated
Show resolved
Hide resolved
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!
… and refactor the RequestData proxies now that they are consistent between major versions of the Elasticsearch.Net library
7eed1be
to
5c045df
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.
🚫 🤖
Quick thought - did you a do a "full package versions" run for these?
I ran a separate "full package versions" job for each of the Elasticsearch test applications and the linux integration tests passed 👍🏼 |
Summary of changes
Sets up snapshot testing for Elasticsearch and removes the use of Elasticsearch path as a fallback value for the resource name
Reason for change
The main motivation was to see if we could remove the Elasticsearch path as a fallback since the RequestParameters should always be present, and the snapshot tests were added to validate the before/after.
Implementation details
Test coverage
Added snapshot testing
Other details
Part 1 implies a Part 2 😆 With snapshot testing, I want to try a refactor to guarantee that we always have the command name. This can be done in a follow-up PR in case it is unsuccessful