Skip to content

fix(graphql): skip Apollo health checks in Mercurius#9363

Merged
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-14-skip-mercurius-health-check-pr
Jul 15, 2026
Merged

fix(graphql): skip Apollo health checks in Mercurius#9363
pabloerhard merged 1 commit into
masterfrom
BridgeAR/2026-07-14-skip-mercurius-health-check-pr

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

Apollo Gateway health-check polls still emitted a graphql.request span for Mercurius because its request boundary runs before the graphql-js hooks. Skip the same exact fixed query at that boundary, while keeping similarly named user operations traced.

Refs: #9134

Apollo Gateway reaches the Mercurius request boundary before the graphql-js hooks, so each poll still emitted a graphql.request span after its nested spans were suppressed. Match the same exact fixed query at that boundary so health-check-shaped user operations remain traced.
@dd-octo-sts

dd-octo-sts Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.77 MB
Deduped: 7.43 MB
No deduping: 7.43 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 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-prod-us1-6

datadog-prod-us1-6 Bot commented Jul 15, 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.61% (+0.00%)

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

@pr-commenter

pr-commenter Bot commented Jul 15, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-15 00:31:44

Comparing candidate commit 37764f3 in PR branch BridgeAR/2026-07-14-skip-mercurius-health-check-pr with baseline commit 1abef82 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2316 metrics, 42 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 [-211.757ms; +203.896ms] or [-7.976%; +7.680%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-227.294ms; +232.531ms] or [-8.957%; +9.164%]

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

  • unstable execution_time [-158.381ms; +162.842ms] or [-5.128%; +5.272%]

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

  • unstable execution_time [-187.579ms; +193.691ms] or [-6.467%; +6.678%]

scenario:appsec-control-20

  • unstable execution_time [-123.623ms; +127.106ms] or [-7.522%; +7.734%]

scenario:appsec-control-24

  • unstable execution_time [-113895.471µs; +115004.271µs] or [-9.148%; +9.237%]

scenario:appsec-control-26

  • unstable execution_time [-124875.019µs; +124051.886µs] or [-10.058%; +9.992%]

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

  • unstable execution_time [-10.457ms; +15.500ms] or [-4.079%; +6.046%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-19.842ms; +10.043ms] or [-7.873%; +3.985%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-28.187ms; +31.101ms] or [-5.120%; +5.649%]

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

  • unstable cpu_user_time [-1953.712ms; +3145.220ms] or [-23.663%; +38.094%]
  • unstable execution_time [-1958.695ms; +3150.326ms] or [-21.854%; +35.149%]
  • unstable instructions [-16.6G instructions; +26.8G instructions] or [-24.588%; +39.654%]
  • unstable max_rss_usage [-8.122MB; +13.059MB] or [-5.184%; +8.336%]
  • unstable throughput [-848.575op/s; +523.345op/s] or [-23.103%; +14.248%]

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

  • unstable cpu_user_time [-2263.424ms; +752.988ms] or [-23.680%; +7.878%]
  • unstable execution_time [-2321.092ms; +843.404ms] or [-22.552%; +8.195%]
  • unstable instructions [-20.2G instructions; +6.7G instructions] or [-25.362%; +8.359%]
  • unstable throughput [-179.324op/s; +446.102op/s] or [-5.559%; +13.830%]

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

  • unstable cpu_user_time [-2636.164ms; +4134.693ms] or [-27.682%; +43.417%]
  • unstable execution_time [-2641.914ms; +4136.978ms] or [-25.754%; +40.328%]
  • unstable instructions [-23.3G instructions; +36.8G instructions] or [-29.258%; +46.263%]
  • unstable max_rss_usage [-8.189MB; +12.980MB] or [-5.118%; +8.112%]
  • unstable throughput [-812.058op/s; +525.294op/s] or [-25.139%; +16.261%]

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

  • unstable cpu_user_time [-2590.464ms; +4123.166ms] or [-27.181%; +43.263%]
  • unstable execution_time [-2786.148ms; +4343.959ms] or [-27.157%; +42.341%]
  • unstable instructions [-23.1G instructions; +36.9G instructions] or [-29.016%; +46.310%]
  • unstable max_rss_usage [-8.753MB; +13.371MB] or [-5.511%; +8.418%]
  • unstable throughput [-836.929op/s; +545.716op/s] or [-25.839%; +16.849%]

scenario:dogstatsd-aggregated-20

  • unstable cpu_usage_percentage [-5.480%; +6.246%]
  • unstable execution_time [-116.432ms; +98.944ms] or [-8.879%; +7.546%]
  • unstable throughput [-665005.221op/s; +735703.337op/s] or [-5.711%; +6.318%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-367.336ms; +287.203ms] or [-7.844%; +6.133%]
  • unstable execution_time [-368.713ms; +291.443ms] or [-7.746%; +6.122%]
  • unstable throughput [-105375.053op/s; +130450.628op/s] or [-5.974%; +7.395%]

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

  • unstable cpu_user_time [-734.047ms; +802.706ms] or [-5.698%; +6.231%]
  • unstable execution_time [-743.935ms; +803.149ms] or [-5.652%; +6.102%]
  • unstable throughput [-3.649op/s; +3.399op/s] or [-5.964%; +5.555%]

scenario:plugin-pg-service-26

  • unstable cpu_usage_percentage [-9.699%; +5.956%]
  • unstable execution_time [-107.158ms; +153.529ms] or [-11.773%; +16.867%]
  • unstable throughput [-714061.716op/s; +532788.234op/s] or [-10.597%; +7.907%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-3.312MB; +8.134MB] or [-4.199%; +10.313%]

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.64%. Comparing base (1abef82) to head (37764f3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9363   +/-   ##
=======================================
  Coverage   96.64%   96.64%           
=======================================
  Files         923      923           
  Lines      122844   122875   +31     
  Branches    20989    21059   +70     
=======================================
+ Hits       118723   118756   +33     
+ Misses       4121     4119    -2     
Flag Coverage Δ
aiguard 53.65% <ø> (-0.05%) ⬇️
aiguard-integration 57.10% <ø> (ø)
apm-bucket-0 53.88% <ø> (-0.05%) ⬇️
apm-bucket-1 58.45% <ø> (-0.05%) ⬇️
apm-bucket-2 56.18% <ø> (-0.05%) ⬇️
apm-capabilities-tracing 60.63% <75.00%> (+<0.01%) ⬆️
apm-integrations-aerospike 53.03% <ø> (-0.05%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.18% <ø> (-0.05%) ⬇️
apm-integrations-couchbase 53.37% <ø> (-0.05%) ⬇️
apm-integrations-http 58.04% <ø> (-0.04%) ⬇️
apm-integrations-kafkajs 57.83% <ø> (-0.05%) ⬇️
apm-integrations-next 54.26% <ø> (-0.05%) ⬇️
apm-integrations-prisma 54.26% <ø> (-0.05%) ⬇️
apm-integrations-tedious 53.14% <ø> (-0.05%) ⬇️
appsec 68.86% <ø> (-0.04%) ⬇️
appsec-express_fastify_graphql 65.73% <75.00%> (-0.04%) ⬇️
appsec-integration 51.95% <75.00%> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash 59.17% <ø> (-0.04%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.40% <ø> (-0.04%) ⬇️
appsec-next 52.88% <ø> (-0.04%) ⬇️
appsec-node-serialize_passport_postgres 62.04% <ø> (-0.04%) ⬇️
appsec-sourcing_stripe_template 60.42% <ø> (-0.06%) ⬇️
debugger 65.70% <ø> (-0.02%) ⬇️
instrumentations-bucket-0 48.88% <ø> (-0.05%) ⬇️
instrumentations-bucket-1 55.08% <ø> (-0.05%) ⬇️
instrumentations-bucket-10 56.71% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 48.87% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 49.05% <ø> (-0.05%) ⬇️
instrumentations-bucket-13 48.81% <ø> (-0.05%) ⬇️
instrumentations-bucket-2 50.02% <ø> (-0.05%) ⬇️
instrumentations-bucket-3 53.99% <ø> (-0.05%) ⬇️
instrumentations-bucket-4 49.29% <ø> (-0.05%) ⬇️
instrumentations-bucket-5 53.16% <ø> (-0.05%) ⬇️
instrumentations-bucket-6 55.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-7 53.63% <ø> (-0.05%) ⬇️
instrumentations-bucket-8 54.76% <ø> (-0.05%) ⬇️
instrumentations-bucket-9 56.19% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-couchbase 48.27% <ø> (-0.05%) ⬇️
instrumentations-integration-esbuild 34.07% <ø> (ø)
llmobs-ai_anthropic_bedrock 57.77% <ø> (-0.04%) ⬇️
llmobs-bucket-1 57.11% <ø> (-0.04%) ⬇️
llmobs-openai 57.50% <ø> (-0.04%) ⬇️
llmobs-sdk 60.07% <ø> (-0.05%) ⬇️
llmobs-vertex-ai 54.31% <ø> (-0.05%) ⬇️
master-coverage 96.64% <100.00%> (?)
openfeature 54.70% <ø> (ø)
openfeature-unit 49.91% <ø> (-0.05%) ⬇️
platform-core_esbuild_instrumentations-misc 38.54% <ø> (-0.03%) ⬇️
platform-integration 62.33% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 37.33% <ø> (-0.03%) ⬇️
plugins-bucket-0 53.26% <ø> (-0.04%) ⬇️
plugins-bucket-1 55.20% <ø> (ø)
plugins-bucket-11 57.63% <100.00%> (+0.05%) ⬆️
plugins-bucket-18 57.16% <75.00%> (-0.03%) ⬇️
plugins-bucket-19 55.47% <ø> (-0.03%) ⬇️
plugins-bucket-20 57.68% <75.00%> (-0.03%) ⬇️
plugins-bucket-4 53.87% <ø> (-0.05%) ⬇️
plugins-bullmq_cassandra_cookie 57.47% <ø> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.42% <ø> (-0.05%) ⬇️
plugins-fetch_fs_generic-pool 54.59% <ø> (-0.13%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 59.92% <ø> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.86% <ø> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.77% <ø> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.51% <ø> (-0.07%) ⬇️
plugins-lodash_mariadb_memcached 54.30% <ø> (-0.05%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.40% <ø> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.79% <ø> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.33% <ø> (-0.05%) ⬇️
plugins-opensearch_passport-http_pino 55.19% <ø> (-0.05%) ⬇️
plugins-postgres_process_pug 54.38% <ø> (-0.05%) ⬇️
plugins-redis_router_sequelize 57.16% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.06% <ø> (-0.02%) ⬇️
plugins-valkey_vm_winston 53.94% <ø> (-0.13%) ⬇️
plugins-ws 54.93% <ø> (-0.04%) ⬇️
profiling 58.26% <ø> (-0.04%) ⬇️
serverless-aws-sdk-aws-sdk 50.78% <ø> (-0.04%) ⬇️
serverless-aws-sdk-bedrockruntime 50.75% <ø> (-0.05%) ⬇️
serverless-aws-sdk-client 52.09% <ø> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.80% <ø> (-0.05%) ⬇️
serverless-aws-sdk-eventbridge 46.46% <ø> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.79% <ø> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.87% <ø> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.59% <ø> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.82% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.54% <ø> (-0.05%) ⬇️
serverless-aws-sdk-sqs 55.96% <ø> (-0.16%) ⬇️
serverless-aws-sdk-stepfunctions 51.36% <ø> (-0.05%) ⬇️
serverless-aws-sdk-util 48.54% <ø> (-0.05%) ⬇️
serverless-bucket-0 55.24% <ø> (ø)
serverless-bucket-1 56.06% <ø> (-0.05%) ⬇️
test-optimization-cucumber 72.94% <ø> (+0.02%) ⬆️
test-optimization-cypress 66.35% <ø> (+0.07%) ⬆️
test-optimization-jest 74.28% <ø> (-0.05%) ⬇️
test-optimization-mocha 74.69% <ø> (+0.04%) ⬆️
test-optimization-playwright-playwright-atr 61.50% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-efd 61.68% <ø> (ø)
test-optimization-playwright-playwright-final-status 61.66% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-impacted-tests 61.38% <ø> (+0.16%) ⬆️
test-optimization-playwright-playwright-reporting 61.27% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-test-management 62.23% <ø> (-0.12%) ⬇️
test-optimization-playwright-playwright-test-span 61.41% <ø> (-0.06%) ⬇️
test-optimization-selenium 60.71% <ø> (-0.11%) ⬇️
test-optimization-testopt 59.16% <ø> (+0.08%) ⬆️
test-optimization-vitest 71.40% <75.00%> (+0.01%) ⬆️

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 15, 2026 10:39
@BridgeAR
BridgeAR requested a review from a team as a code owner July 15, 2026 10:39
@BridgeAR
BridgeAR requested review from wconti27 and removed request for a team July 15, 2026 10:39

@pabloerhard pabloerhard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious on why is this not an option? Is it always considered as noisy?

@BridgeAR

Copy link
Copy Markdown
Member Author

@pabloerhard I can not imagine any customer wanting the health checks from being traces. That is indeed very noisy and would likely be a magnitude higher than all other spans of a customer combined. I would only ever imagine allowing this as option, if it is requested and I can not imagine that.

Adding options for something that will almost with certainty never change is not a good idea. Options are adding complexity and mental overhead for us and the customer.

@pabloerhard
pabloerhard merged commit 51fdd86 into master Jul 15, 2026
692 of 693 checks passed
@pabloerhard
pabloerhard deleted the BridgeAR/2026-07-14-skip-mercurius-health-check-pr branch July 15, 2026 14:39
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 16, 2026
Apollo Gateway reaches the Mercurius request boundary before the graphql-js hooks, so each poll still emitted a graphql.request span after its nested spans were suppressed. Match the same exact fixed query at that boundary so health-check-shaped user operations remain traced.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 16, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 16, 2026
Apollo Gateway reaches the Mercurius request boundary before the graphql-js hooks, so each poll still emitted a graphql.request span after its nested spans were suppressed. Match the same exact fixed query at that boundary so health-check-shaped user operations remain traced.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 16, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
Apollo Gateway reaches the Mercurius request boundary before the graphql-js hooks, so each poll still emitted a graphql.request span after its nested spans were suppressed. Match the same exact fixed query at that boundary so health-check-shaped user operations remain traced.
juan-fernandez pushed a commit that referenced this pull request Jul 16, 2026
Apollo Gateway reaches the Mercurius request boundary before the graphql-js hooks, so each poll still emitted a graphql.request span after its nested spans were suppressed. Match the same exact fixed query at that boundary so health-check-shaped user operations remain traced.
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