Skip to content

Enable subgraph metrics and extended error metrics by default - #9879

Open
BobaFetters wants to merge 10 commits into
dev-v3.xfrom
zach/router-1910
Open

Enable subgraph metrics and extended error metrics by default#9879
BobaFetters wants to merge 10 commits into
dev-v3.xfrom
zach/router-1910

Conversation

@BobaFetters

Copy link
Copy Markdown
Member

Router 3.0 changes the defaults for two Apollo telemetry settings to match the preferred configuration for GraphOS Studio users, and promotes one of them out of preview.

telemetry.apollo.subgraph_metrics now defaults to true. Subgraph metrics send additional per-subgraph operation metrics to GraphOS Studio via OTLP, powering subgraph insights. Previously this was opt-in. To restore the previous behavior, set:

telemetry:
  apollo:
    subgraph_metrics: false

telemetry.apollo.errors.preview_extended_error_metrics has been renamed to telemetry.apollo.errors.extended_error_metrics and now defaults to enabled. Extended error metrics send OTLP error metrics with additional dimensions (extensions.service, extensions.code), giving Studio richer error attribution out of the box. The preview_ prefix has been dropped now that the feature is stable.

Configurations using the old preview_extended_error_metrics field name are migrated automatically at startup (with a warning). To restore the previous behavior, set:

telemetry:
  apollo:
    errors:
      extended_error_metrics: disabled

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

Router 3.0 changes the defaults for two Apollo telemetry settings to match the preferred configuration for GraphOS Studio users, and promotes one of them out of preview.
@BobaFetters BobaFetters self-assigned this Jul 27, 2026
@BobaFetters
BobaFetters requested review from a team as code owners July 27, 2026 17:27
@apollo-librarian

apollo-librarian Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

1 new, 20 changed, 0 removed
+ graphos/routing/(latest)/upgrade/from-router-v2.mdx
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/customization/native-plugins.mdx
* graphos/routing/(latest)/customization/coprocessor/index.mdx
* graphos/routing/(latest)/customization/rhai/index.mdx
* graphos/routing/(latest)/observability/graphos/graphos-reporting.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/index.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/router-instrumentation.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/datadog-agent/datadog-agent-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/jaeger/jaeger-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/zipkin/zipkin-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/conditions.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/spans.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/telemetry-pipelines/trace-exporters/overview.mdx
* graphos/routing/(latest)/performance/caching/response-caching/faq.mdx
* graphos/routing/(latest)/security/demand-control.mdx
* graphos/routing/(latest)/self-hosted/containerization/proxy-certificates.mdx
* graphos/routing/(latest)/upgrade/from-router-v1.mdx
* graphos/routing/(latest)/_sidebar.yaml

Build ID: ac40c0cde81394b880c2585b
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/ac40c0cde81394b880c2585b


⚠️ AI Style Review — 2 Issues Found

Summary

The documentation has been updated to align with the style guide across several sections. Key updates include: framing Apollo products by using direct language like 'disable' instead of 'opt out'; shifting instructions to the active voice, present tense, and imperative mood for clarity; and adopting a more authoritative, encouraging tone for recommended features. Formatting improvements include the use of code font for user-input values, numerals for code-related values, and enhanced readability through the use of contractions and the removal of semicolons.

Duration: 3779ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@BobaFetters

Copy link
Copy Markdown
Member Author

/claude-review

router.start().await;
router
.wait_for_log_message(r#""subgraph":"connectors","message":"plugin `telemetry` is indirectly configured to send errors to Apollo studio for a connector-enabled subgraph, which is only supported when `preview_extended_error_metrics` is enabled"#)
.wait_for_log_message(r#""subgraph":"connectors","message":"plugin `telemetry` is indirectly configured to send errors to Apollo studio for a connector-enabled subgraph, which is only supported when `extended_error_metrics` is enabled"#)

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.

Bug: this test (and incompatible_warnings_on_subgraph below) is broken by the new extended_error_metrics default.

Both incompatibility warnings are gated on the mode not being Enabled (incompatible/telemetry.rs#L22-L29):

self.config.subgraph.all.send
    && !matches!(
        self.config.extended_error_metrics,
        apollo::ExtendedErrorMetricsMode::Enabled
    )

Neither the config of this test (L747-L756) nor that of incompatible_warnings_on_subgraph (L784-L796) sets extended_error_metrics, so with the new default of enabled from this PR the warning is never emitted and wait_for_log_message panics after its 30s deadline. The expected log strings were updated for the rename, but the configs were not updated to preserve the pre-condition the tests rely on.

This is easy to miss because both tests early-return when graph_os_enabled() is false (no TEST_APOLLO_KEY/TEST_APOLLO_GRAPH_REF), so the failure only shows up on credentialed runs.

Fix: add extended_error_metrics: disabled under errors: in both test configs, e.g.:

telemetry:
  apollo:
    errors:
      extended_error_metrics: disabled
      subgraph:
        all:
          send: true

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed the current diff (head 4224a1c) for bugs and CLAUDE.md compliance. 1 issue found, posted as an inline comment:

  1. Broken integration tests from the flipped defaultincompatible_warnings_on_all and incompatible_warnings_on_subgraph in apollo-router/tests/integration/connectors.rs wait for the connectors/telemetry incompatibility warnings, but those warnings are only emitted when extended_error_metrics is not enabled. Neither test config sets the field, so under the new enabled default the warnings never fire and wait_for_log_message times out and panics. Both configs need extended_error_metrics: disabled added. (The breakage is masked on runs without GraphOS test credentials, since both tests early-return when graph_os_enabled() is false.)

Otherwise the change checks out: the rename is complete across code/tests/docs, the 3003-extended-error-metrics.yaml migration correctly chains after 0037-preview_otlp_error_metrics.yaml and applies in minor-upgrade mode, the #[default] move on ExtendedErrorMetricsMode and the subgraph_metrics: true default are consistent with the updated schema snapshots, and the existing populate_config_instrument! entry in configuration/metrics.rs was updated in lockstep with the rename, so no CLAUDE.md violations.

# Conflicts:
#	docs/source/routing/configuration/yaml.mdx
…y tests

extended_error_metrics now defaults to Enabled, which suppresses the
incompatibility warnings these tests assert on, causing wait_for_log_message
to hang until timeout on credentialed runs.
@BobaFetters

Copy link
Copy Markdown
Member Author

/claude-review

@github-actions

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

…metrics defaults

Both now default to enabled, so router.operations.fetch.duration and the
extended error span events/status show up in previously-captured snapshots
that never opted out. Purely additive; no behavior change.
Comment thread docs/source/routing/observability/graphos/graphos-reporting.mdx Outdated

@goto-bus-stop goto-bus-stop left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code change LGTM. We should improve the docs though or file a follow-up ticket for that.

BobaFetters and others added 2 commits August 17, 2026 13:27
Address PR review feedback: the "enabling" framing read oddly now
that extended_error_metrics defaults to enabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

2 participants