Skip to content

docs(router): circuit breaker in subgraph execution#86

Open
Copilot wants to merge 15 commits into
mainfrom
copilot/create-documentation-for-feature
Open

docs(router): circuit breaker in subgraph execution#86
Copilot wants to merge 15 commits into
mainfrom
copilot/create-documentation-for-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Documentation of graphql-hive/router#900

@ardatan ardatan added the waits for release Represents changes in a library that have not yet been released label Apr 9, 2026
@ardatan ardatan changed the title docs(router): sync circuit breaker docs with PR #900 changes docs(router): circuit breaker in subgraph execution Apr 9, 2026
@ardatan ardatan marked this pull request as ready for review April 9, 2026 12:27
Copilot AI review requested due to automatic review settings April 9, 2026 12:27
Copilot AI temporarily deployed to storybook-preview April 9, 2026 12:27 Inactive
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Router documentation describing the new circuit breaker behavior for subgraph execution and exposes the related traffic_shaping.circuit_breaker configuration in the reference docs (supporting graphql-hive/router#900).

Changes:

  • Add a new “Circuit Breaker” section to the Performance Tuning guide (states, configuration examples, tuning guidance, and a metric mention).
  • Extend the traffic_shaping configuration reference to document the circuit_breaker option and its fields.
  • Update the “Outbound Options” section to include circuit_breaker among globally/per-subgraph overrideable settings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/documentation/content/docs/router/guides/performance-tuning.mdx Introduces circuit breaker guide content, examples, and metrics/tuning notes.
packages/documentation/content/docs/router/configuration/traffic_shaping.mdx Documents traffic_shaping.*.circuit_breaker config schema and links to the tuning guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/documentation/content/docs/router/guides/performance-tuning.mdx Outdated
Comment thread packages/documentation/content/docs/router/guides/performance-tuning.mdx Outdated
Comment thread packages/documentation/content/docs/router/guides/performance-tuning.mdx Outdated
@ardatan
Copy link
Copy Markdown
Member

ardatan commented Apr 9, 2026

@copilot fix linting

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot fix linting

Fixed in d96c94a — ran oxfmt to correct table column alignment and YAML comment spacing in performance-tuning.mdx.

Copilot AI requested a review from ardatan April 9, 2026 13:52
Copilot AI temporarily deployed to storybook-preview May 13, 2026 11:56 Inactive
@ardatan ardatan requested a review from dotansimha May 13, 2026 11:57
@ardatan ardatan added the waits for release Represents changes in a library that have not yet been released label May 13, 2026
@ardatan ardatan removed the request for review from dotansimha May 13, 2026 12:08
@ardatan ardatan marked this pull request as draft May 13, 2026 12:08
@ardatan ardatan marked this pull request as ready for review May 13, 2026 13:22
@ardatan ardatan temporarily deployed to storybook-preview May 13, 2026 13:22 — with GitHub Actions Inactive
@ardatan ardatan requested a review from dotansimha May 13, 2026 13:23
@ardatan
Copy link
Copy Markdown
Member

ardatan commented May 13, 2026

@copilot fix lint errors

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot fix lint errors

Fixed in 4151832. I applied formatting fixes to /home/runner/work/docs/docs/packages/documentation/content/docs/router/configuration/traffic_shaping.mdx and /home/runner/work/docs/docs/packages/documentation/content/docs/router/guides/performance-tuning.mdx, and verified with bun run format:check and bun run lint.

ardatan added a commit to graphql-hive/router that referenced this pull request May 14, 2026
Closes #489
Ref ROUTER-158
Documentation graphql-hive/docs#86
Preview of the feature doc
https://b0d94292-hive-platform-docs.theguild.workers.dev/graphql/hive/docs/router/guides/performance-tuning#circuit-breaker
Preview of the API doc
https://b0d94292-hive-platform-docs.theguild.workers.dev/graphql/hive/docs/router/configuration/traffic_shaping#circuit_breaker

## Circuit Breaker implementation on Subgraph Execution

Anything is thrown as SubgraphExecutorError is considered as an error by
the circuit breaker. It uses the same logic that we have in usage
reporting in Hive Console SDK with `recloser` library.

Circuit breaker configuration is available for all subgraphs as a global
configuration and subgraph-level configuration.
Besides the implementation, the metrics are also added which is
mentioned in the proposal inside the GitHub issue linked above.

What are considered as errors by Circuit Breaker?
- Everything that throws in the subgraph execution today incl. invalid
JSON payloads, empty response bodies, connection errors etc.
- In addition, all [500. 502, 503, 504] responses are considered as
errors too by default. These status codes can be changed by the user. In
that case, the original response is held in case of the circuit breaker
throws. Then it is reused to keep the behavior of today. So those
responses are not considered as an error by the execution engine itself
but only for the circuit breaker.

---------

Co-authored-by: theguild-bot <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Comment thread packages/documentation/content/docs/router/guides/performance-tuning.mdx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waits for release Represents changes in a library that have not yet been released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants