fix(graphql): honor errorExtensions on the mercurius request span#9284
Conversation
The top-level graphql.request span read the global tracer config when
copying GraphQL error extensions onto its dd.graphql.query.error event,
so a user's `tracer.use('graphql', { errorExtensions })` /
DD_TRACE_GRAPHQL_ERROR_EXTENSIONS was silently dropped there while the
execute and validate spans honored it. Read the plugin config like its
siblings do.
Overall package sizeSelf size: 6.71 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 437.94 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: ab60a2a | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-10 11:54:18 Comparing candidate commit ab60a2a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2305 metrics, 53 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9284 +/- ##
========================================
Coverage 96.56% 96.57%
========================================
Files 918 918
Lines 121564 121564
Branches 20634 20839 +205
========================================
+ Hits 117394 117395 +1
+ Misses 4170 4169 -1 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
) The top-level graphql.request span read the global tracer config when copying GraphQL error extensions onto its dd.graphql.query.error event, so a user's `tracer.use('graphql', { errorExtensions })` / DD_TRACE_GRAPHQL_ERROR_EXTENSIONS was silently dropped there while the execute and validate spans honored it. Read the plugin config like its siblings do.
) The top-level graphql.request span read the global tracer config when copying GraphQL error extensions onto its dd.graphql.query.error event, so a user's `tracer.use('graphql', { errorExtensions })` / DD_TRACE_GRAPHQL_ERROR_EXTENSIONS was silently dropped there while the execute and validate spans honored it. Read the plugin config like its siblings do.
Summary
The top-level
graphql.requestspan (mercurius) read the global tracer config when copying GraphQL error extensions onto itsdd.graphql.query.errorevent, so a user'stracer.use('graphql', { errorExtensions })/DD_TRACE_GRAPHQL_ERROR_EXTENSIONSwas silently dropped there — while thegraphql.executeandgraphql.validatespans honored it. It now reads the plugin config like its siblings do.A mercurius regression test asserts a configured extension lands on the request span's error event and an unconfigured one does not; it fails on
masterand passes with the fix.