Skip to content

fix(graphql): honor errorExtensions on the mercurius request span#9284

Merged
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-10-graphql-request-error-extensions
Jul 10, 2026
Merged

fix(graphql): honor errorExtensions on the mercurius request span#9284
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-10-graphql-request-error-extensions

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

The top-level graphql.request span (mercurius) 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 graphql.execute and graphql.validate spans 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 master and passes with the fix.

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.
@dd-octo-sts

dd-octo-sts Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.71 MB
Deduped: 7.36 MB
No deduping: 7.36 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

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 96.53% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ab60a2a | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 10, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-10 11:54:18

Comparing candidate commit ab60a2a in PR branch BridgeAR/2026-07-10-graphql-request-error-extensions with baseline commit b40ce55 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2305 metrics, 53 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-210.171ms; +202.769ms] or [-7.921%; +7.642%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-233697.398µs; +234432.598µs] or [-9.193%; +9.222%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-159411.362µs; +160620.062µs] or [-5.164%; +5.203%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-184270.853µs; +186212.987µs] or [-6.353%; +6.420%]

scenario:appsec-control-20

  • unstable execution_time [-124.553ms; +120.034ms] or [-7.565%; +7.291%]

scenario:appsec-control-24

  • unstable execution_time [-112.625ms; +114.722ms] or [-9.115%; +9.284%]

scenario:appsec-control-26

  • unstable execution_time [-116.880ms; +135.381ms] or [-9.511%; +11.016%]

scenario:appsec-iast-with-vulnerability-control-20

  • unstable execution_time [-29.874ms; +32.756ms] or [-5.365%; +5.883%]

scenario:appsec-iast-with-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-31.524ms; +28.493ms] or [-5.598%; +5.060%]

scenario:child_process-file-args-24

  • unstable execution_time [-28.962ms; +24.339ms] or [-6.078%; +5.108%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-1593.623ms; +408.569ms] or [-18.638%; +4.778%]
  • unstable execution_time [-1616.690ms; +435.824ms] or [-17.464%; +4.708%]
  • unstable instructions [-15.0G instructions; +3.4G instructions] or [-21.181%; +4.871%]
  • unstable throughput [-135.643op/s; +498.914op/s] or [-3.844%; +14.139%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-3634.639ms; +2393.181ms] or [-34.216%; +22.529%]
  • unstable execution_time [-3643.797ms; +2404.137ms] or [-32.097%; +21.177%]
  • unstable instructions [-32.1G instructions; +21.3G instructions] or [-36.087%; +23.929%]
  • unstable max_rss_usage [-10.706MB; +6.894MB] or [-6.585%; +4.241%]
  • unstable throughput [-525.879op/s; +782.831op/s] or [-17.649%; +26.273%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-354.696ms; +492.811ms] or [-4.426%; +6.149%]
  • unstable execution_time [-403.854ms; +562.767ms] or [-4.629%; +6.450%]
  • unstable instructions [-2789.7M instructions; +3870.1M instructions] or [-4.263%; +5.914%]
  • unstable throughput [-236.668op/s; +170.615op/s] or [-6.422%; +4.630%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-3509.639ms; +3761.138ms] or [-34.618%; +37.098%]
  • unstable execution_time [-3672.811ms; +3910.932ms] or [-33.789%; +35.980%]
  • unstable instructions [-30.5G instructions; +32.8G instructions] or [-35.994%; +38.720%]
  • unstable max_rss_usage [-9782.021KB; +11406.821KB] or [-6.064%; +7.071%]
  • unstable throughput [-739.404op/s; +757.321op/s] or [-23.768%; +24.344%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-351.139ms; +476.937ms] or [-4.455%; +6.051%]
  • unstable execution_time [-399.778ms; +543.468ms] or [-4.662%; +6.338%]
  • unstable instructions [-2681.7M instructions; +3822.2M instructions] or [-4.170%; +5.943%]
  • unstable throughput [-226.585op/s; +169.633op/s] or [-6.046%; +4.527%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-2873.199ms; +4071.243ms] or [-27.112%; +38.417%]
  • unstable execution_time [-2885.238ms; +4056.843ms] or [-25.433%; +35.760%]
  • unstable instructions [-25.4G instructions; +36.2G instructions] or [-28.464%; +40.587%]
  • unstable max_rss_usage [-8.913MB; +12.789MB] or [-5.475%; +7.855%]
  • unstable throughput [-879.548op/s; +630.987op/s] or [-29.540%; +21.192%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-485.178ms; +244.231ms] or [-9.914%; +4.991%]
  • unstable execution_time [-486.103ms; +248.193ms] or [-9.775%; +4.991%]
  • unstable throughput [-87104.201op/s; +167904.110op/s] or [-5.151%; +9.929%]

scenario:iast-sink-check-26

  • unstable cpu_user_time [-172.995ms; +254.935ms] or [-4.756%; +7.009%]
  • unstable execution_time [-166.456ms; +260.669ms] or [-4.545%; +7.118%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-26

  • unstable cpu_usage_percentage [-4.534%; +5.773%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-713.659ms; +748.238ms] or [-5.551%; +5.820%]
  • unstable execution_time [-716.563ms; +757.460ms] or [-5.455%; +5.766%]
  • unstable throughput [-3.442op/s; +3.289op/s] or [-5.619%; +5.368%]

scenario:plugin-memcached-hashring-24

  • unstable execution_time [-90.570ms; +167.839ms] or [-3.575%; +6.625%]

scenario:plugin-memcached-hashring-26

  • unstable cpu_user_time [-1093.066ms; +352.131ms] or [-39.901%; +12.854%]
  • unstable execution_time [-1102.841ms; +357.418ms] or [-39.253%; +12.721%]
  • unstable instructions [-9.3G instructions; +3.0G instructions] or [-25.635%; +8.337%]
  • unstable throughput [-496806.907op/s; +1524906.055op/s] or [-3.284%; +10.079%]

scenario:plugin-mongodb-core-plain-find-26

  • unstable execution_time [-59.524ms; +149.510ms] or [-2.854%; +7.169%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-3.058MB; +6.634MB] or [-3.863%; +8.379%]

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (b40ce55) to head (ab60a2a).

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     
Flag Coverage Δ
aiguard 53.55% <ø> (-0.05%) ⬇️
aiguard-integration 57.00% <ø> (ø)
apm-bucket-0 53.78% <ø> (-0.05%) ⬇️
apm-bucket-1 58.07% <ø> (-0.04%) ⬇️
apm-bucket-2 56.11% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.32% <0.00%> (ø)
apm-integrations-aerospike 52.93% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.05% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.26% <ø> (-0.05%) ⬇️
apm-integrations-http 57.96% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 57.71% <ø> (-0.05%) ⬇️
apm-integrations-next 54.23% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.17% <ø> (-0.05%) ⬇️
apm-integrations-tedious 53.04% <ø> (-0.05%) ⬇️
appsec 68.96% <ø> (-0.10%) ⬇️
appsec-express_fastify_graphql 65.59% <0.00%> (-0.05%) ⬇️
appsec-integration 45.58% <0.00%> (ø)
appsec-kafka_ldapjs_lodash 59.09% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.24% <ø> (-0.04%) ⬇️
appsec-next 52.84% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 61.87% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.23% <ø> (-0.04%) ⬇️
debugger 65.73% <ø> (-0.02%) ⬇️
instrumentations-bucket-0 48.74% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 54.95% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.61% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 48.84% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.67% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 49.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.82% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.15% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.00% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.60% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.60% <ø> (-0.04%) ⬇️
instrumentations-bucket-8 54.63% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.09% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.17% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 33.96% <ø> (ø)
llmobs-ai_anthropic_bedrock 57.72% <ø> (-0.04%) ⬇️
llmobs-bucket-1 56.98% <ø> (-0.04%) ⬇️
llmobs-openai 57.55% <ø> (-0.04%) ⬇️
llmobs-sdk 59.94% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.20% <ø> (-0.05%) ⬇️
master-coverage 96.57% <100.00%> (?)
openfeature 54.61% <ø> (ø)
openfeature-unit 49.82% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.45% <ø> (-0.03%) ⬇️
platform-integration 62.23% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 37.28% <ø> (-0.03%) ⬇️
plugins-bucket-0 53.17% <ø> (-0.05%) ⬇️
plugins-bucket-1 55.07% <ø> (ø)
plugins-bucket-11 55.59% <100.00%> (-0.02%) ⬇️
plugins-bucket-18 57.06% <0.00%> (-0.05%) ⬇️
plugins-bucket-19 55.35% <ø> (-0.05%) ⬇️
plugins-bucket-20 57.44% <0.00%> (-0.05%) ⬇️
plugins-bucket-4 53.84% <ø> (-0.05%) ⬇️
plugins-bullmq_cassandra_cookie 57.39% <ø> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.31% <ø> (-0.05%) ⬇️
plugins-fetch_fs_generic-pool 54.54% <ø> (+0.03%) ⬆️
plugins-google-cloud-pubsub_grpc_handlebars 59.86% <ø> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.85% <ø> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.66% <ø> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.40% <ø> (-0.05%) ⬇️
plugins-lodash_mariadb_memcached 54.20% <ø> (-0.05%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.28% <ø> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.70% <ø> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.20% <ø> (-0.05%) ⬇️
plugins-opensearch_passport-http_pino 55.05% <ø> (-0.05%) ⬇️
plugins-postgres_process_pug 54.28% <ø> (-0.05%) ⬇️
plugins-redis_router_sequelize 57.02% <ø> (-0.05%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.02% <ø> (-0.05%) ⬇️
plugins-valkey_vm_winston 53.84% <ø> (-0.13%) ⬇️
plugins-ws 54.79% <ø> (-0.05%) ⬇️
profiling 58.19% <ø> (-0.05%) ⬇️
serverless-aws-sdk-aws-sdk 50.66% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.68% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 51.97% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.74% <ø> (-0.07%) ⬇️
serverless-aws-sdk-eventbridge 46.24% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.71% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.78% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.53% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.72% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.48% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sqs 55.91% <ø> (-0.05%) ⬇️
serverless-aws-sdk-stepfunctions 51.25% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.47% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.22% <ø> (ø)
serverless-bucket-1 55.99% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.97% <ø> (+0.02%) ⬆️
test-optimization-cypress 66.38% <ø> (+0.10%) ⬆️
test-optimization-jest 73.89% <ø> (-0.03%) ⬇️
test-optimization-mocha 74.29% <ø> (+0.05%) ⬆️
test-optimization-playwright-playwright-atr 61.56% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-efd 61.75% <ø> (+0.03%) ⬆️
test-optimization-playwright-playwright-final-status 61.71% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.43% <ø> (+0.19%) ⬆️
test-optimization-playwright-playwright-reporting 61.33% <ø> (+0.02%) ⬆️
test-optimization-playwright-playwright-test-management 62.24% <ø> (-0.09%) ⬇️
test-optimization-playwright-playwright-test-span 61.47% <ø> (-0.04%) ⬇️
test-optimization-selenium 60.66% <ø> (-0.14%) ⬇️
test-optimization-testopt 59.15% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.57% <0.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BridgeAR
BridgeAR marked this pull request as ready for review July 10, 2026 12:56
@BridgeAR
BridgeAR requested a review from a team as a code owner July 10, 2026 12:56
@BridgeAR
BridgeAR requested review from tlhunter and removed request for a team July 10, 2026 12:56
@pabloerhard
pabloerhard merged commit b968578 into master Jul 10, 2026
658 checks passed
@pabloerhard
pabloerhard deleted the BridgeAR/2026-07-10-graphql-request-error-extensions branch July 10, 2026 16:49
juan-fernandez pushed a commit that referenced this pull request Jul 14, 2026
)

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.
juan-fernandez pushed a commit that referenced this pull request Jul 14, 2026
)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants