-
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
Add Support for GraphQL HotChocolate v14 #6248
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 2 occurrences of : - Error: 1,
[...]
- error.msg: The HTTP response has status code 500.,
[...]
- http.status_code: 500,
+ http.status_code: 200,
6 occurrences of : - Resource: Uncompleted operation,
+ Resource: Query ErrorQuery,
6 occurrences of : - graphql.operation.type: Uncompleted,
+ graphql.operation.name: ErrorQuery,
+ graphql.operation.type: Query,
[...]
- throwNotImplementedException {
- name
- }
[...]
+ throwException
2 occurrences of : - http.status_code: 400,
+ http.status_code: 200,
|
Datadog ReportBranch report: ✅ 0 Failed, 461810 Passed, 3615 Skipped, 32h 32m 54.8s Total Time |
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 (6248) - mean (69ms) : 66, 71
. : milestone, 69,
master - mean (69ms) : 66, 71
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (977ms) : 952, 1002
. : milestone, 977,
master - mean (981ms) : 959, 1003
. : milestone, 981,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6248) - mean (108ms) : 107, 110
. : milestone, 108,
master - mean (108ms) : 106, 111
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (679ms) : 665, 693
. : milestone, 679,
master - mean (681ms) : 663, 700
. : milestone, 681,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6248) - mean (92ms) : 87, 96
. : milestone, 92,
master - mean (91ms) : 90, 93
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (628ms) : 613, 644
. : milestone, 628,
master - mean (633ms) : 620, 646
. : milestone, 633,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6248) - mean (190ms) : 186, 194
. : milestone, 190,
master - mean (191ms) : 187, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (1,094ms) : 1070, 1119
. : milestone, 1094,
master - mean (1,095ms) : 1066, 1123
. : milestone, 1095,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6248) - mean (276ms) : 271, 280
. : milestone, 276,
master - mean (277ms) : 272, 282
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (872ms) : 841, 903
. : milestone, 872,
master - mean (867ms) : 842, 893
. : milestone, 867,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6248) - mean (265ms) : 262, 269
. : milestone, 265,
master - mean (265ms) : 260, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6248) - mean (846ms) : 814, 878
. : milestone, 846,
master - mean (853ms) : 822, 884
. : milestone, 853,
|
Benchmarks Report for tracer 🐌Benchmarks for #6248 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 - 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‑net6.0 | 1.117 | 503.56 | 562.49 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 1.128 | 636.21 | 563.85 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 396ns | 0.253ns | 0.979ns | 0.00807 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 636ns | 0.527ns | 2.04ns | 0.00747 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 609ns | 0.368ns | 1.43ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 503ns | 0.279ns | 1.08ns | 0.00961 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 768ns | 0.609ns | 2.36ns | 0.00953 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 831ns | 1.18ns | 4.59ns | 0.104 | 0 | 0 | 658 B |
#6248 | StartFinishSpan |
net6.0 | 428ns | 0.222ns | 0.859ns | 0.00803 | 0 | 0 | 576 B |
#6248 | StartFinishSpan |
netcoreapp3.1 | 563ns | 0.466ns | 1.8ns | 0.00787 | 0 | 0 | 576 B |
#6248 | StartFinishSpan |
net472 | 678ns | 1.15ns | 4.46ns | 0.0915 | 0 | 0 | 578 B |
#6248 | StartFinishScope |
net6.0 | 564ns | 0.574ns | 2.15ns | 0.00988 | 0 | 0 | 696 B |
#6248 | StartFinishScope |
netcoreapp3.1 | 697ns | 0.471ns | 1.82ns | 0.0094 | 0 | 0 | 696 B |
#6248 | StartFinishScope |
net472 | 846ns | 0.844ns | 3.27ns | 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 | 641ns | 0.381ns | 1.47ns | 0.00968 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 881ns | 0.657ns | 2.54ns | 0.00925 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.07μs | 0.673ns | 2.61ns | 0.104 | 0 | 0 | 658 B |
#6248 | RunOnMethodBegin |
net6.0 | 605ns | 1.73ns | 6.7ns | 0.0098 | 0 | 0 | 696 B |
#6248 | RunOnMethodBegin |
netcoreapp3.1 | 890ns | 0.713ns | 2.76ns | 0.00905 | 0 | 0 | 696 B |
#6248 | RunOnMethodBegin |
net472 | 1.13μs | 0.817ns | 3.16ns | 0.104 | 0 | 0 | 658 B |
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 (6248) (11.275M) : 0, 11275487
master (11.142M) : 0, 11142160
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6248) (7.349M) : 0, 7349440
master (7.363M) : 0, 7363424
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.607M) : 0, 7607008
section Manual
master (11.275M) : 0, 11275455
section Manual + Automatic
This PR (6248) (6.826M) : 0, 6826433
master (6.792M) : 0, 6792352
section DD_TRACE_ENABLED=0
master (10.439M) : 0, 10439037
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6248) (9.712M) : 0, 9712096
master (9.654M) : 0, 9653591
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6248) (6.405M) : 0, 6405365
master (6.390M) : 0, 6389835
section Trace stats
master (6.750M) : 0, 6750226
section Manual
master (9.569M) : 0, 9568710
section Manual + Automatic
This PR (6248) (6.051M) : 0, 6051417
master (6.103M) : 0, 6103364
section DD_TRACE_ENABLED=0
master (8.654M) : 0, 8654106
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6248) (10.099M) : 0, 10098659
master (10.012M) : 0, 10011511
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6248) (6.413M) : 0, 6413081
master (6.299M) : 0, 6298610
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (7.028M) : 0, 7027938
section Manual
master (9.897M) : 0, 9896735
section Manual + Automatic
This PR (6248) (6.134M) : 0, 6133640
master (5.876M) : 0, 5876361
section DD_TRACE_ENABLED=0
master (9.276M) : 0, 9275838
|
the current issue with this PR is around the subscription step of the integration tests. |
@vandonr As you just want to test what happens if an error is thrown during the execution step and not subscriptions per se, you can simply create a new field that throws upon execution. You can apply the below diff via
|
@vandonr Could you apply the patch from above and verify if it fixes the issue? Would be awesome to have support for Hot Chocolate v14 soon :) |
oops sorry I'm out of office at the moment, so I missed your last message. Thanks looking for a fix ! |
Ah I see what the problem with this PR is. We also need to update the snapshots of the other versions. Here's another diff you can apply: Diff
Sorry to disturb you while you're out of office 😅 |
Update Hot Chocolate Auto Instrumentation Bump versions Manually check in snapshots Cleanup Update test Rename current snapshots to .Pre_14_0_0 Check in new snapshots
47fc6a3
to
46ed942
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.
LGTM! Just a couple of nitpics about partially adding #nullable enable
IMO doing it piecemeal potentially does more harm than good, so I'd rather not add them to existing, and tackle the whole hotchocolate surface area in a subsequent PR, but not a blocker 🙂
I also rebased, updated the generated files, and applied your diff for the snapshots @tobias-tengler, thanks!
#nullable enable | ||
|
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.
nit: I'm generally opposed to just putting #nullable enable in without doing the full nullable analysis. e.g. operationContext.Operation
could throw a null ref exception, so adding #nullable enable
adds a false sense of security. Better to be "honest" and just not add it unless you're going to do the full nullable "fixing" (and that should be a separate PR anyway 🙂 )
#nullable enable | ||
|
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.
Same goes here, technically there are null ref possibilities (e.g. we're not checking request.Instance
for null) so I'd rather we did the full analysis in a separate PR if possible
Mhmm the tests are still failing in CI, but it doesn't make much sense to me. The snapshot difference summary comment has been updated, but it still complains about the snapshots differing, but the mentioned |
Hmmm, it looks like this is due to a difference in how an exceptions are handled and how that bubbles up to the aspnetcore/HTTP side 🤔 The difference in the snapshot shows in the "root" aspnetcore span (Verified on the left, received on the right) This is probably a benign change, but it shows the changing from the non-existent error subscription to the explicit exception throw are fundamentally different - essentially the former triggers an exception in the "core" of the HotChocolate library, whereas the latter is handled by the library and returns a 200 🤔 It would probably be a good idea to test both paths in reality... |
😌 |
I actually don't know how to purposely trigger a 500 error in HotChocolate, and tbf it seems normal, there shouldn't be a way for clients to reliably trigger 500 errors in a working system, they should get 400 errors at best. |
Thanks for merging this @vandonr! ❤️ |
I don't want to make any promises, but we're not releasing this week, and I know we're not releasing around end of year celebrations either, so we'll probably do a release inbetween :p |
## Summary of changes Hot Chocolate v14 was released recently: [NuGet](https://www.nuget.org/packages/HotChocolate.AspNetCore/14.0.0) This new version doesn't work with the existing integration ## Reason for change ## Implementation details picked up work from an external contributor (@tobias-tengler in #6180) tried to reduce a bit the amount of diff by reusing more existing code ## Test coverage integration test runs on new version ## 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. --> --------- Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com> Co-authored-by: Tobias Tengler <45513122+tobias-tengler@users.noreply.github.com>
Summary of changes
Hot Chocolate v14 was released recently: NuGet
This new version doesn't work with the existing integration
Reason for change
Implementation details
picked up work from an external contributor (@tobias-tengler in #6180)
tried to reduce a bit the amount of diff by reusing more existing code
Test coverage
integration test runs on new version
Other details