Skip to content

[Tracer] Capturing GraphQL Errors With SpanEvents #6899

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

link04
Copy link
Contributor

@link04 link04 commented Apr 25, 2025

Summary of changes

Adds functionality for capturing GraphQL errors as SpanEvents including stacktrace and extensions as opt in with DD_TRACE_GRAPHQL_ERROR_EXTENSIONS , also added new files such as IExecutionErrorExtensions and PathStruct to support the added functionality.

Reason for change

To better showcase errors for customers since one request can lead to more than one and spans only allowed one at a time, plus now allows enriching the event with GraphQL specific error details.

Implementation details

  • Added support for capturing specified GraphQL error extensions via the new environment variable DD_TRACE_GRAPHQL_ERROR_EXTENSIONS.
  • Extended the IExecutionError and IError interfaces to include:
  • Captures attributes such as message, path, code, stacktrace, and extensions.
  • Introduced new files such as IExecutionErrorExtensions and PathStruct to support the added functionality.

Test coverage

Snapshots have been updated.

@andrewlock
Copy link
Member

andrewlock commented Apr 25, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6899 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.555
  • 1 benchmarks are slower, with geometric mean 1.119
  • 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.95μs 141ns 1.41μs 0 0 0 5.55 KB
master StartStopWithChild netcoreapp3.1 8.98μs 32.1ns 116ns 0 0 0 5.74 KB
master StartStopWithChild net472 15.1μs 78.4ns 400ns 1.08 0.432 0.144 6.11 KB
#6899 StartStopWithChild net6.0 7.14μs 36.2ns 253ns 0 0 0 5.54 KB
#6899 StartStopWithChild netcoreapp3.1 10.6μs 157ns 1.57μs 0 0 0 5.74 KB
#6899 StartStopWithChild net472 14.8μs 43.9ns 158ns 1.02 0.315 0.0787 6.13 KB
Benchmarks.Trace.AgentWriterBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6899

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 2.128 1,049,792.19 493,404.69

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 1.04ms 4.78μs 18.5μs 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 561ns 2.17μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 858μs 650ns 2.52μs 0 0 0 3.31 KB
#6899 WriteAndFlushEnrichedTraces net6.0 494μs 535ns 1.93μs 0 0 0 2.7 KB
#6899 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 394ns 1.42μs 0 0 0 2.7 KB
#6899 WriteAndFlushEnrichedTraces net472 879μs 856ns 3.2μs 0 0 0 3.31 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 135μs 784ns 6.74μs 0 0 0 14.48 KB
master SendRequest netcoreapp3.1 150μs 720ns 2.79μs 0 0 0 17.28 KB
master SendRequest net472 0.00117ns 0.000629ns 0.00244ns 0 0 0 0 b
#6899 SendRequest net6.0 134μs 763ns 5.71μs 0 0 0 14.48 KB
#6899 SendRequest netcoreapp3.1 152μs 836ns 5.15μs 0 0 0 17.28 KB
#6899 SendRequest net472 0.00247ns 0.00133ns 0.00481ns 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 548μs 2.52μs 9.75μs 0 0 0 41.57 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 2.11μs 7.59μs 0 0 0 41.77 KB
master WriteAndFlushEnrichedTraces net472 879μs 6.29μs 62.9μs 7.81 0 0 53.44 KB
#6899 WriteAndFlushEnrichedTraces net6.0 537μs 2.98μs 20.2μs 0 0 0 41.64 KB
#6899 WriteAndFlushEnrichedTraces netcoreapp3.1 694μs 6.57μs 64.3μs 0 0 0 41.81 KB
#6899 WriteAndFlushEnrichedTraces net472 874μs 5.08μs 44.3μs 8.33 4.17 0 53.35 KB
Benchmarks.Trace.DbCommandBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6899

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑netcoreapp3.1 1.572 2,907.66 1,850.24

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.41μs 7.58ns 46.1ns 0.00923 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.91μs 3.89ns 13.5ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 3.9ns 15.1ns 0.148 0.0106 0 995 B
#6899 ExecuteNonQuery net6.0 1.25μs 1.25ns 4.69ns 0.0128 0 0 1.03 KB
#6899 ExecuteNonQuery netcoreapp3.1 1.85μs 3.74ns 14ns 0.00923 0 0 1.02 KB
#6899 ExecuteNonQuery net472 2.11μs 3.36ns 12.6ns 0.148 0.0105 0 995 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.23μs 0.849ns 3.29ns 0.0122 0 0 984 B
master CallElasticsearch netcoreapp3.1 1.56μs 0.675ns 2.43ns 0.00793 0 0 984 B
master CallElasticsearch net472 2.41μs 1.16ns 4.48ns 0.159 0 0 1 KB
master CallElasticsearchAsync net6.0 1.39μs 0.847ns 3.28ns 0.0137 0 0 960 B
master CallElasticsearchAsync netcoreapp3.1 1.61μs 2.3ns 8.61ns 0.00806 0 0 1.03 KB
master CallElasticsearchAsync net472 2.67μs 1.09ns 4.08ns 0.161 0 0 1.06 KB
#6899 CallElasticsearch net6.0 1.23μs 0.805ns 3.01ns 0.0124 0 0 984 B
#6899 CallElasticsearch netcoreapp3.1 1.69μs 1.17ns 4.39ns 0.0084 0 0 984 B
#6899 CallElasticsearch net472 2.63μs 0.59ns 2.28ns 0.158 0 0 1 KB
#6899 CallElasticsearchAsync net6.0 1.31μs 6.76ns 31ns 0.0128 0 0 960 B
#6899 CallElasticsearchAsync netcoreapp3.1 1.65μs 2.34ns 8.75ns 0.00829 0 0 1.03 KB
#6899 CallElasticsearchAsync net472 2.62μs 1.66ns 6.44ns 0.158 0 0 1.06 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 1.41ns 5.46ns 0.0134 0 0 960 B
master ExecuteAsync netcoreapp3.1 1.64μs 8.7ns 45.2ns 0.00813 0 0 960 B
master ExecuteAsync net472 1.77μs 1.02ns 3.83ns 0.142 0 0 923 B
#6899 ExecuteAsync net6.0 1.29μs 1.05ns 4.08ns 0.0129 0 0 960 B
#6899 ExecuteAsync netcoreapp3.1 1.63μs 1.51ns 5.66ns 0.00816 0 0 960 B
#6899 ExecuteAsync net472 1.89μs 1ns 3.88ns 0.14 0 0 923 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.39μs 3.18ns 12.3ns 0.022 0 0 2.32 KB
master SendAsync netcoreapp3.1 5.2μs 5.02ns 18.1ns 0.0259 0 0 2.86 KB
master SendAsync net472 7.42μs 2.74ns 10.3ns 0.482 0 0 3.13 KB
#6899 SendAsync net6.0 4.23μs 2.18ns 8.44ns 0.0211 0 0 2.32 KB
#6899 SendAsync netcoreapp3.1 5.3μs 4.99ns 18.7ns 0.0263 0 0 2.86 KB
#6899 SendAsync net472 7.47μs 4.68ns 18.1ns 0.487 0 0 3.13 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.56μs 1.45ns 5.01ns 0.0236 0 0 1.71 KB
master EnrichedLog netcoreapp3.1 2.41μs 4.06ns 14ns 0.012 0 0 1.71 KB
master EnrichedLog net472 2.66μs 2.48ns 9.26ns 0.251 0 0 1.64 KB
#6899 EnrichedLog net6.0 1.57μs 2.09ns 8.11ns 0.0235 0 0 1.71 KB
#6899 EnrichedLog netcoreapp3.1 2.27μs 1.16ns 4.51ns 0.0226 0 0 1.71 KB
#6899 EnrichedLog net472 2.54μs 1.17ns 4.53ns 0.254 0 0 1.64 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 113μs 575ns 2.64μs 0 0 0 4.32 KB
master EnrichedLog netcoreapp3.1 119μs 364ns 1.41μs 0 0 0 4.32 KB
master EnrichedLog net472 153μs 226ns 875ns 0 0 0 4.51 KB
#6899 EnrichedLog net6.0 113μs 225ns 872ns 0 0 0 4.32 KB
#6899 EnrichedLog netcoreapp3.1 115μs 160ns 621ns 0 0 0 4.32 KB
#6899 EnrichedLog net472 152μs 276ns 1.07μs 0 0 0 4.51 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.02μs 2.92ns 11.3ns 0.0303 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 4.35μs 3.58ns 13.4ns 0 0 0 2.26 KB
master EnrichedLog net472 4.82μs 2.86ns 10.7ns 0.312 0 0 2.09 KB
#6899 EnrichedLog net6.0 3.1μs 1.73ns 6.7ns 0.031 0 0 2.26 KB
#6899 EnrichedLog netcoreapp3.1 4.23μs 7.9ns 28.5ns 0.0209 0 0 2.26 KB
#6899 EnrichedLog net472 4.9μs 2.38ns 8.91ns 0.318 0 0 2.09 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.41μs 1.13ns 4.24ns 0.0143 0 0 1.15 KB
master SendReceive netcoreapp3.1 1.82μs 3.01ns 11.7ns 0.00885 0 0 1.15 KB
master SendReceive net472 2.1μs 1.9ns 7.35ns 0.176 0 0 1.16 KB
#6899 SendReceive net6.0 1.39μs 2.15ns 8.34ns 0.0141 0 0 1.15 KB
#6899 SendReceive netcoreapp3.1 1.81μs 0.924ns 3.58ns 0.00908 0 0 1.15 KB
#6899 SendReceive net472 2.07μs 2ns 7.77ns 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.79μs 1.95ns 7.55ns 0.0139 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 3.91μs 4.34ns 16.8ns 0.0197 0 0 1.69 KB
master EnrichedLog net472 4.45μs 4.87ns 18.2ns 0.31 0 0 2.08 KB
#6899 EnrichedLog net6.0 2.76μs 1.32ns 5.1ns 0.0138 0 0 1.64 KB
#6899 EnrichedLog netcoreapp3.1 4.04μs 4.88ns 18.9ns 0.0203 0 0 1.69 KB
#6899 EnrichedLog net472 4.46μs 3.37ns 13.1ns 0.311 0 0 2.08 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6899

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.119 569.38 637.11

Faster 🎉 in #6899

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.124 462.98 411.94

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 463ns 0.23ns 0.83ns 0.00687 0 0 584 B
master StartFinishSpan netcoreapp3.1 569ns 0.309ns 1.15ns 0.00569 0 0 584 B
master StartFinishSpan net472 656ns 0.434ns 1.68ns 0.0922 0 0 586 B
master StartFinishScope net6.0 508ns 0.461ns 1.79ns 0.0101 0 0 704 B
master StartFinishScope netcoreapp3.1 681ns 0.641ns 2.4ns 0.00682 0 0 704 B
master StartFinishScope net472 779ns 0.282ns 1.09ns 0.105 0 0 666 B
#6899 StartFinishSpan net6.0 412ns 0.282ns 1.02ns 0.00817 0 0 584 B
#6899 StartFinishSpan netcoreapp3.1 639ns 1.38ns 5.17ns 0.00671 0 0 584 B
#6899 StartFinishSpan net472 693ns 0.41ns 1.48ns 0.0905 0 0 586 B
#6899 StartFinishScope net6.0 490ns 0.285ns 1.07ns 0.00974 0 0 704 B
#6899 StartFinishScope netcoreapp3.1 692ns 1.31ns 4.74ns 0.00705 0 0 704 B
#6899 StartFinishScope net472 753ns 0.217ns 0.75ns 0.102 0 0 666 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 674ns 0.586ns 2.27ns 0.0101 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 951ns 0.877ns 3.28ns 0.00948 0 0 704 B
master RunOnMethodBegin net472 1.04μs 0.588ns 2.28ns 0.104 0 0 666 B
#6899 RunOnMethodBegin net6.0 633ns 0.432ns 1.67ns 0.00935 0 0 704 B
#6899 RunOnMethodBegin netcoreapp3.1 926ns 1.73ns 6.46ns 0.00929 0 0 704 B
#6899 RunOnMethodBegin net472 1.04μs 0.437ns 1.58ns 0.104 0 0 666 B

@andrewlock
Copy link
Member

andrewlock commented Apr 25, 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.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6899) - mean (68ms)  : 65, 71
     .   : milestone, 68,
    master - mean (68ms)  : 64, 72
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (1,009ms)  : 978, 1041
     .   : milestone, 1009,
    master - mean (1,005ms)  : 977, 1033
     .   : milestone, 1005,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6899) - mean (102ms)  : 100, 104
     .   : milestone, 102,
    master - mean (103ms)  : 101, 104
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (693ms)  : 673, 713
     .   : milestone, 693,
    master - mean (696ms)  : 681, 710
     .   : milestone, 696,

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

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (651ms)  : 625, 678
     .   : milestone, 651,
    master - mean (654ms)  : 634, 673
     .   : milestone, 654,

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

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (1,118ms)  : 1087, 1149
     .   : milestone, 1118,
    master - mean (1,114ms)  : 1087, 1140
     .   : milestone, 1114,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6899) - mean (269ms)  : 265, 273
     .   : milestone, 269,
    master - mean (270ms)  : 265, 274
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (878ms)  : 841, 915
     .   : milestone, 878,
    master - mean (884ms)  : 856, 912
     .   : milestone, 884,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6899) - mean (262ms)  : 258, 266
     .   : milestone, 262,
    master - mean (262ms)  : 259, 265
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (6899) - mean (865ms)  : 837, 893
     .   : milestone, 865,
    master - mean (872ms)  : 845, 899
     .   : milestone, 872,

Loading

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Apr 25, 2025

Datadog Report

All test runs c585551 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 496234 1827 3h 14m 55.17s Link
exploration_tests 0 0 0 22085 3 2m 18.01s Link

Copy link
Contributor

github-actions bot commented May 7, 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.

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Argument \"id\" has invalid value 1.\nExpected type \"String\", found 1.","code":"5.3.3.1","locations":["1:24"]}},{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Cannot query field \"apearsIn\" on type \"Human\". Did you mean \"appearsIn\"?","code":"5.2.1","locations":["1:35"]}}],

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Error trying to resolve throwNotImplementedException.","path":["throwNotImplementedException"],"code":"NOT_IMPLEMENTED","locations":["1:32"]}}],

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Argument \"id\" has invalid value 1.\nExpected type \"String\", found 1.","code":"ARGUMENTS_OF_CORRECT_TYPE","locations":["1:24"]}},{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Cannot query field \"apearsIn\" on type \"Human\". Did you mean \"appearsIn\"?","code":"FIELDS_ON_CORRECT_TYPE","locations":["1:35"]}}],

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Error trying to resolve field 'throwNotImplementedException'.","path":["throwNotImplementedException"],"code":"NOT_IMPLEMENTED","locations":["1:32"]}}],

6 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Argument 'id' has invalid value. Expected type 'String', found 1.","code":"ARGUMENTS_OF_CORRECT_TYPE","locations":["1:24"]}},{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Cannot query field 'apearsIn' on type 'Human'. Did you mean 'appearsIn'?","code":"FIELDS_ON_CORRECT_TYPE","locations":["1:35"]}}],

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"This API purposely throws a NotImplementedException","path":["throwNotImplementedException"],"code":"NOT_IMPLEMENTED","locations":["1:32"],"stacktrace":"   at Samples.GraphQL4.StarWarsExtensions.StarWarsSubscription.ThrowNotImplementedException(IResolveFieldContext context) in C:\\dd-trace-dotnet\\tracer\\test\\test-applications\\integrations\\Samples.GraphQL4\\StarWarsExtensions\\StarWarsSubscription.cs:line 138\r\n   at GraphQL.Resolvers.SourceStreamResolver`1.<>c__DisplayClass1_0.<.ctor>b__0(IResolveFieldContext context) in /_/src/GraphQL/Resolvers/SourceStreamResolver.cs:line 21\r\n   at GraphQL.Resolvers.SourceStreamResolver`1.ResolveAsync(IResolveFieldContext context) in /_/src/GraphQL/Resolvers/SourceStreamResolver.cs:line 38\r\n   at GraphQL.Execution.SubscriptionExecutionStrategy.ResolveResponseStreamAsync(ExecutionContext context, ExecutionNode node) in /_/src/GraphQL/Execution/SubscriptionExecutionStrategy.cs:line 99"}}],

4 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Subscription operations are not supported for POST requests.","code":"HTTP_METHOD_VALIDATION","locations":["1:1"]}}],

2 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"extensions.int":1,"extensions.float":1.1,"extensions.str":"1","extensions.bool":true,"extensions.other":"[1,foo]","extensions.sbyte":-42,"extensions.byte":42,"extensions.short":-1000,"extensions.ushort":1000,"extensions.uint":4294967295,"extensions.long":-9223372036854775808,"extensions.ulong":"18446744073709551615","extensions.decimal":"3.14159265358979","extensions.double":3.141592653589793,"extensions.char":"A","message":"This API purposely throws a NotImplementedException","path":["throwNotImplementedException"],"code":"NOT_IMPLEMENTED","locations":["1:32"],"stacktrace":"   at Samples.GraphQL4.StarWarsExtensions.StarWarsSubscription.ThrowNotImplementedException(IResolveFieldContext context) in C:\\dd-trace-dotnet\\tracer\\test\\test-applications\\integrations\\Samples.GraphQL4\\StarWarsExtensions\\StarWarsSubscription.cs:line 138\r\n   at GraphQL.Resolvers.SourceStreamResolver`1.<>c__DisplayClass1_0.<.ctor>b__1(IResolveFieldContext context) in /_/src/GraphQL/Resolvers/SourceStreamResolver.cs:line 24\r\n   at GraphQL.Resolvers.SourceStreamResolver`1.ResolveAsync(IResolveFieldContext context) in /_/src/GraphQL/Resolvers/SourceStreamResolver.cs:line 46\r\n   at GraphQL.Execution.SubscriptionExecutionStrategy.ResolveResponseStreamAsync(ExecutionContext context, ExecutionNode node) in /_/src/GraphQL/Execution/SubscriptionExecutionStrategy.cs:line 98"}}],

4 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"The field `boook` does not exist on the type `Query`.","locations":["1:2"]}}],

4 occurrences of :

+      events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Something went wrong","locations":["1:18"],"path":["throwException"],"code":"ERROR_CODE","stacktrace":"   at Samples.HotChocolate.Query.ThrowException() in C:\\dd-trace-dotnet\\tracer\\test\\test-applications\\integrations\\Samples.HotChocolate\\Query.cs:line 28","extensions.int":1,"extensions.float":1.1,"extensions.str":"1","extensions.bool":true,"extensions.other":"[1,foo]","extensions.sbyte":-42,"extensions.byte":42,"extensions.short":-1000,"extensions.ushort":1000,"extensions.uint":4294967295,"extensions.long":-9223372036854775808,"extensions.ulong":"18446744073709551615","extensions.decimal":"3.14159265358979","extensions.double":3.141592653589793,"extensions.char":"A"}}],

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 13, 2025

Datadog Summary

❌ Code Quality    ✅ Code Security    ✅ Dependencies

Test Optimization Report

All test runs 784f211 🔗

2 Total Test Services: 1 Failed, 1 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 32 0 0 368523 1677 3h 22m 54.8s Link
exploration_tests 0 0 0 22085 3 2m 9.49s Link

❌ Failed Tests (32)

This report shows up to 5 failed tests.

  • AllConfigurationValuesAreRegisteredWithIntake - Datadog.Trace.Tests.Telemetry.ConfigurationTests - Details

    Expand for error
     Expected collection to be empty because Keys should be listed in config_norm_rules or block_prefixes, but found at least one item {"DD_TRACE_GRAPHQL_ERROR_EXTENSIONS"}.
    
  • AllConfigurationValuesAreRegisteredWithIntake - Datadog.Trace.Tests.Telemetry.ConfigurationTests - Details

    Expand for error
     Expected keysWithoutConfig.OrderBy(x => x) to be empty because Keys should be listed in config_norm_rules or block_prefixes, but found at least one item {"DD_TRACE_GRAPHQL_ERROR_EXTENSIONS"}.
    
  • AllConfigurationValuesAreRegisteredWithIntake - Datadog.Trace.Tests.Telemetry.ConfigurationTests - Details

    Expand for error
     Expected keysWithoutConfig.OrderBy(x => x) to be empty because Keys should be listed in config_norm_rules or block_prefixes, but found at least one item {"DD_TRACE_GRAPHQL_ERROR_EXTENSIONS"}.
    
  • AllConfigurationValuesAreRegisteredWithIntake - Datadog.Trace.Tests.Telemetry.ConfigurationTests - Details

    Expand for error
     Expected collection to be empty because Keys should be listed in config_norm_rules or block_prefixes, but found at least one item {"DD_TRACE_GRAPHQL_ERROR_EXTENSIONS"}.
    
  • AllConfigurationValuesAreRegisteredWithIntake - Datadog.Trace.Tests.Telemetry.ConfigurationTests - Details

    Expand for error
     Expected keysWithoutConfig.OrderBy(x => x) to be empty because Keys should be listed in config_norm_rules or block_prefixes, but found at least one item {"DD_TRACE_GRAPHQL_ERROR_EXTENSIONS"}.
    

Was this helpful? Give us feedback!

@link04 link04 marked this pull request as ready for review May 13, 2025 01:02
@link04 link04 requested review from a team as code owners May 13, 2025 01:02
@pr-commenter
Copy link

pr-commenter bot commented May 13, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #6899 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.150
  • 10 benchmarks have fewer allocations
  • 7 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.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.13 KB 6.21 KB 72 B 1.17%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.8μs 49.3ns 191ns 0 0 0 5.56 KB
master StartStopWithChild netcoreapp3.1 13.3μs 64.6ns 258ns 0 0 0 5.75 KB
master StartStopWithChild net472 22.1μs 108ns 541ns 1.06 0.318 0.106 6.13 KB
#6899 StartStopWithChild net6.0 10.8μs 55ns 264ns 0 0 0 5.55 KB
#6899 StartStopWithChild netcoreapp3.1 13.5μs 69.4ns 340ns 0 0 0 5.76 KB
#6899 StartStopWithChild net472 22μs 116ns 638ns 0.931 0.207 0 6.21 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.33 KB 3.31 KB -23 B -0.69%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 967μs 4.74μs 19μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 100ns 362ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.26ms 305ns 1.18μs 0 0 0 3.33 KB
#6899 WriteAndFlushEnrichedTraces net6.0 929μs 74.7ns 289ns 0 0 0 2.7 KB
#6899 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 52.5ns 189ns 0 0 0 2.7 KB
#6899 WriteAndFlushEnrichedTraces net472 1.22ms 100ns 388ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 236.35 KB 237.92 KB 1.57 KB 0.66%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 239.88 KB 241.42 KB 1.55 KB 0.64%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 326μs 1.72μs 8.76μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 506μs 164ns 636ns 0 0 0 204.77 KB
master AllCycleSimpleBody net472 441μs 98.5ns 382ns 36.6 2.16 0 236.35 KB
master AllCycleMoreComplexBody net6.0 334μs 215ns 834ns 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 508μs 2.13μs 8.27μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 455μs 519ns 2.01μs 37.9 2.23 0 239.88 KB
master ObjectExtractorSimpleBody net6.0 337ns 0.18ns 0.674ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 397ns 2.19ns 12.9ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 303ns 0.044ns 0.165ns 0.0442 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.37μs 27.6ns 107ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.6μs 34.8ns 139ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.69μs 2.93ns 11.4ns 0.6 0 0 3.8 KB
#6899 AllCycleSimpleBody net6.0 330μs 1.46μs 5.65μs 0 0 0 197.07 KB
#6899 AllCycleSimpleBody netcoreapp3.1 479μs 1.58μs 6.12μs 0 0 0 204.78 KB
#6899 AllCycleSimpleBody net472 439μs 108ns 402ns 36.6 2.16 0 237.92 KB
#6899 AllCycleMoreComplexBody net6.0 341μs 598ns 2.32μs 0 0 0 200.58 KB
#6899 AllCycleMoreComplexBody netcoreapp3.1 510μs 725ns 2.71μs 0 0 0 208.2 KB
#6899 AllCycleMoreComplexBody net472 444μs 111ns 428ns 36.6 2.16 0 241.42 KB
#6899 ObjectExtractorSimpleBody net6.0 317ns 1.57ns 7.02ns 0 0 0 280 B
#6899 ObjectExtractorSimpleBody netcoreapp3.1 395ns 2.11ns 11.3ns 0 0 0 272 B
#6899 ObjectExtractorSimpleBody net472 301ns 0.0313ns 0.121ns 0.0441 0 0 281 B
#6899 ObjectExtractorMoreComplexBody net6.0 6.33μs 5.16ns 20ns 0 0 0 3.78 KB
#6899 ObjectExtractorMoreComplexBody netcoreapp3.1 7.89μs 4.72ns 18.3ns 0 0 0 3.69 KB
#6899 ObjectExtractorMoreComplexBody net472 6.68μs 3.15ns 11.8ns 0.602 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs‑net472 2.16 KB 2.17 KB 12 B 0.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 74μs 196ns 758ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 95.6μs 287ns 1.07μs 0 0 0 32.4 KB
master EncodeArgs net472 105μs 51.6ns 200ns 4.72 0 0 32.51 KB
master EncodeLegacyArgs net6.0 142μs 13.5ns 52.3ns 0 0 0 2.16 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 697ns 2.7μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 267μs 61.6ns 239ns 0 0 0 2.16 KB
#6899 EncodeArgs net6.0 73μs 219ns 848ns 0 0 0 32.4 KB
#6899 EncodeArgs netcoreapp3.1 91.9μs 276ns 1.03μs 0 0 0 32.4 KB
#6899 EncodeArgs net472 104μs 7.32ns 26.4ns 4.71 0 0 32.51 KB
#6899 EncodeLegacyArgs net6.0 142μs 14.7ns 52.9ns 0 0 0 2.16 KB
#6899 EncodeLegacyArgs netcoreapp3.1 201μs 637ns 2.47μs 0 0 0 2.14 KB
#6899 EncodeLegacyArgs net472 260μs 53ns 198ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.22 KB 1.55 KB -664 B -29.96%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net6.0 2.24 KB 1.57 KB -672 B -29.99%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472 2.28 KB 1.59 KB -697 B -30.53%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net6.0 4.55 KB 2.54 KB -2.02 KB -44.28%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 4.48 KB 2.49 KB -1.99 KB -44.46%
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑net472 4.66 KB 2.56 KB -2.1 KB -45.04%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 270μs 80.4ns 301ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 293μs 126ns 453ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 308μs 58.5ns 227ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 181μs 56.9ns 220ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 195μs 362ns 1.4μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 207μs 31.3ns 121ns 0 0 0 2.28 KB
#6899 RunWafRealisticBenchmark net6.0 263μs 73.8ns 276ns 0 0 0 2.54 KB
#6899 RunWafRealisticBenchmark netcoreapp3.1 282μs 60.7ns 219ns 0 0 0 2.49 KB
#6899 RunWafRealisticBenchmark net472 300μs 80.3ns 311ns 0 0 0 2.56 KB
#6899 RunWafRealisticBenchmarkWithAttack net6.0 178μs 37.9ns 147ns 0 0 0 1.57 KB
#6899 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 192μs 352ns 1.32μs 0 0 0 1.55 KB
#6899 RunWafRealisticBenchmarkWithAttack net472 203μs 62.4ns 225ns 0 0 0 1.59 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 62.2μs 144ns 558ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 70.3μs 171ns 640ns 0 0 0 17.42 KB
master SendRequest net472 0.0167ns 0.00216ns 0.00836ns 0 0 0 0 b
#6899 SendRequest net6.0 61.9μs 196ns 758ns 0 0 0 14.53 KB
#6899 SendRequest netcoreapp3.1 70.6μs 167ns 601ns 0 0 0 17.43 KB
#6899 SendRequest net472 0.0166ns 0.00181ns 0.007ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.13 KB 55.8 KB -338 B -0.60%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 719μs 3.53μs 15.8μs 0 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 705μs 4.01μs 30μs 0 0 0 42.14 KB
master WriteAndFlushEnrichedTraces net472 845μs 2.15μs 8.06μs 4.81 0 0 56.13 KB
#6899 WriteAndFlushEnrichedTraces net6.0 678μs 3.81μs 24.7μs 0 0 0 41.73 KB
#6899 WriteAndFlushEnrichedTraces netcoreapp3.1 684μs 3.3μs 12.8μs 0 0 0 41.93 KB
#6899 WriteAndFlushEnrichedTraces net472 834μs 2.8μs 10.8μs 4.81 0 0 55.8 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.93μs 4ns 15.5ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.49μs 4.03ns 15.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.72μs 4.35ns 16.8ns 0.151 0.0138 0 995 B
#6899 ExecuteNonQuery net6.0 1.9μs 7.04ns 27.3ns 0 0 0 1.03 KB
#6899 ExecuteNonQuery netcoreapp3.1 2.37μs 9.49ns 36.7ns 0 0 0 1.02 KB
#6899 ExecuteNonQuery net472 2.67μs 4.09ns 15.8ns 0.158 0.0131 0 995 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.82μs 4.81ns 18.6ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.36μs 10.6ns 40.9ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.53μs 1.88ns 7.27ns 0.158 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.85μs 6.87ns 26.6ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.48μs 13ns 65.2ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.72μs 2.34ns 9.08ns 0.167 0 0 1.11 KB
#6899 CallElasticsearch net6.0 1.83μs 9.63ns 47.2ns 0 0 0 1.04 KB
#6899 CallElasticsearch netcoreapp3.1 2.31μs 7.67ns 27.7ns 0 0 0 1.04 KB
#6899 CallElasticsearch net472 3.54μs 1.79ns 6.7ns 0.16 0 0 1.05 KB
#6899 CallElasticsearchAsync net6.0 1.8μs 8.69ns 33.7ns 0 0 0 1.02 KB
#6899 CallElasticsearchAsync netcoreapp3.1 2.31μs 11.2ns 46.3ns 0 0 0 1.09 KB
#6899 CallElasticsearchAsync net472 3.71μs 8.2ns 31.8ns 0.168 0 0 1.11 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.81μs 0.582ns 2.18ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.36μs 6.94ns 25ns 0 0 0 960 B
master ExecuteAsync net472 2.52μs 0.492ns 1.91ns 0.139 0 0 923 B
#6899 ExecuteAsync net6.0 1.83μs 1ns 3.75ns 0 0 0 960 B
#6899 ExecuteAsync netcoreapp3.1 2.31μs 7.09ns 27.4ns 0 0 0 960 B
#6899 ExecuteAsync net472 2.52μs 1.77ns 6.64ns 0.139 0 0 923 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 7.05μs 14.4ns 53.7ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.44μs 25.1ns 97.4ns 0 0 0 2.9 KB
master SendAsync net472 12.6μs 5.77ns 20.8ns 0.504 0 0 3.19 KB
#6899 SendAsync net6.0 7.04μs 9.63ns 36ns 0 0 0 2.37 KB
#6899 SendAsync netcoreapp3.1 8.67μs 10.1ns 39.2ns 0 0 0 2.9 KB
#6899 SendAsync net472 12.3μs 8.96ns 34.7ns 0.488 0 0 3.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #6899

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 1.150 446,100.00 513,150.00

More allocations ⚠️ in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 249.18 KB 273.86 KB 24.69 KB 9.91%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.81 KB 280.96 KB 21.15 KB 8.14%

Fewer allocations 🎉 in #6899

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.1 KB 42.81 KB -1.3 KB -2.94%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 348.98 KB 286.72 KB -62.26 KB -17.84%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 42.7μs 215ns 1.25μs 0 0 0 43.87 KB
master StringConcatBenchmark netcoreapp3.1 46.2μs 104ns 360ns 0 0 0 44.1 KB
master StringConcatBenchmark net472 57.3μs 262ns 981ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 448μs 1.95μs 6.75μs 0 0 0 259.81 KB
master StringConcatAspectBenchmark netcoreapp3.1 483μs 1.3μs 4.7μs 0 0 0 249.18 KB
master StringConcatAspectBenchmark net472 408μs 2.14μs 11.1μs 0 0 0 348.98 KB
#6899 StringConcatBenchmark net6.0 44.8μs 211ns 1.57μs 0 0 0 43.83 KB
#6899 StringConcatBenchmark netcoreapp3.1 48.3μs 287ns 2.69μs 0 0 0 42.81 KB
#6899 StringConcatBenchmark net472 56.7μs 120ns 414ns 0 0 0 65.54 KB
#6899 StringConcatAspectBenchmark net6.0 514μs 1.91μs 6.88μs 0 0 0 280.96 KB
#6899 StringConcatAspectBenchmark netcoreapp3.1 543μs 2.38μs 8.91μs 0 0 0 273.86 KB
#6899 StringConcatAspectBenchmark net472 407μs 2.16μs 11.2μs 0 0 0 286.72 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 2.57μs 12.6ns 54.8ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.45μs 12.5ns 48.5ns 0 0 0 1.76 KB
master EnrichedLog net472 3.92μs 3.15ns 11.8ns 0.254 0 0 1.69 KB
#6899 EnrichedLog net6.0 2.58μs 12.5ns 50ns 0 0 0 1.76 KB
#6899 EnrichedLog netcoreapp3.1 3.48μs 17.5ns 76.5ns 0 0 0 1.76 KB
#6899 EnrichedLog net472 3.86μs 2.16ns 8.1ns 0.252 0 0 1.69 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 122μs 88.8ns 320ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 128μs 45.4ns 164ns 0 0 0 4.37 KB
master EnrichedLog net472 168μs 71.2ns 276ns 0 0 0 4.57 KB
#6899 EnrichedLog net6.0 123μs 157ns 586ns 0 0 0 4.37 KB
#6899 EnrichedLog netcoreapp3.1 127μs 48ns 166ns 0 0 0 4.37 KB
#6899 EnrichedLog net472 167μs 48.8ns 189ns 0 0 0 4.57 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 5.04μs 24.7ns 99ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.73μs 13ns 48.5ns 0 0 0 2.32 KB
master EnrichedLog net472 7.44μs 8.69ns 33.7ns 0.332 0 0 2.14 KB
#6899 EnrichedLog net6.0 5.05μs 7.09ns 27.5ns 0 0 0 2.32 KB
#6899 EnrichedLog netcoreapp3.1 6.54μs 15.1ns 56.5ns 0 0 0 2.32 KB
#6899 EnrichedLog net472 7.32μs 5.76ns 20.8ns 0.331 0 0 2.14 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 2.04μs 3.57ns 13.8ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.57μs 11.7ns 46.7ns 0 0 0 1.21 KB
master SendReceive net472 3.18μs 4.37ns 16.9ns 0.188 0 0 1.21 KB
#6899 SendReceive net6.0 1.98μs 10.1ns 46.2ns 0 0 0 1.21 KB
#6899 SendReceive netcoreapp3.1 2.49μs 10.9ns 42.2ns 0 0 0 1.21 KB
#6899 SendReceive net472 3.08μs 2.89ns 11.2ns 0.183 0 0 1.21 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 4.2μs 16.7ns 62.5ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.63μs 17.3ns 66.8ns 0 0 0 1.69 KB
master EnrichedLog net472 6.68μs 4.9ns 19ns 0.302 0 0 2.08 KB
#6899 EnrichedLog net6.0 4.14μs 8.47ns 32.8ns 0 0 0 1.64 KB
#6899 EnrichedLog netcoreapp3.1 5.64μs 8.15ns 31.6ns 0 0 0 1.69 KB
#6899 EnrichedLog net472 6.79μs 10.2ns 38ns 0.305 0 0 2.08 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 net6.0 755ns 2.69ns 10.1ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 966ns 4.54ns 18.2ns 0 0 0 584 B
master StartFinishSpan net472 936ns 0.454ns 1.76ns 0.089 0 0 586 B
master StartFinishScope net6.0 905ns 0.531ns 2.06ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.15μs 5.88ns 27ns 0 0 0 704 B
master StartFinishScope net472 1.15μs 0.226ns 0.874ns 0.104 0 0 666 B
#6899 StartFinishSpan net6.0 792ns 0.604ns 2.34ns 0 0 0 584 B
#6899 StartFinishSpan netcoreapp3.1 929ns 4.87ns 25.3ns 0 0 0 584 B
#6899 StartFinishSpan net472 922ns 0.322ns 1.25ns 0.0921 0 0 586 B
#6899 StartFinishScope net6.0 907ns 4.42ns 18.2ns 0 0 0 704 B
#6899 StartFinishScope netcoreapp3.1 1.12μs 5.52ns 22.8ns 0 0 0 704 B
#6899 StartFinishScope net472 1.1μs 0.293ns 1.14ns 0.105 0 0 666 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 1.03μs 1.17ns 4.53ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.32μs 6.75ns 29.4ns 0 0 0 704 B
master RunOnMethodBegin net472 1.38μs 0.136ns 0.527ns 0.103 0 0 666 B
#6899 RunOnMethodBegin net6.0 1.01μs 5.48ns 30ns 0 0 0 704 B
#6899 RunOnMethodBegin netcoreapp3.1 1.39μs 5.82ns 22.6ns 0 0 0 704 B
#6899 RunOnMethodBegin net472 1.37μs 0.609ns 2.28ns 0.103 0 0 666 B

Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good just some questions on tests for the extensions and refactorings that we can do in the methods

Copy link
Contributor

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some nits and comments, but the only thing I see as blocking is how extensions with array values are being added as span event attributes. It looks like these need to be encoded as strings, which I think can be more strongly enforced in the system-tests code

Copy link
Contributor

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I've left some non-blocking nits, but please ensure to remove the unneeded variable in the HotChocolateCommon.ConstructErrorEvents method. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants