docs(router): circuit breaker in subgraph execution#86
Conversation
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/df201bf4-472a-4cd5-8286-7cf523e0365d Co-authored-by: ardatan <[email protected]>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/adb0fa7f-61d4-4b30-b4ea-aa2ebf2aaf89 Co-authored-by: ardatan <[email protected]>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/a0c25c65-fc2d-4849-9d1f-e7e2cef52f58 Co-authored-by: ardatan <[email protected]>
|
There was a problem hiding this comment.
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_shapingconfiguration reference to document thecircuit_breakeroption and its fields. - Update the “Outbound Options” section to include
circuit_breakeramong 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.
…tuning.mdx Co-authored-by: Copilot <[email protected]>
…tuning.mdx Co-authored-by: Copilot <[email protected]>
…tuning.mdx Co-authored-by: Copilot <[email protected]>
|
@copilot fix linting |
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/5cfb6b53-b887-4443-9179-567a36d06d91 Co-authored-by: ardatan <[email protected]>
|
@copilot fix lint errors |
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/afea84a9-65b6-4867-9ac5-67864ed1cc0e Co-authored-by: ardatan <[email protected]>
Fixed in 4151832. I applied formatting fixes to |
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]>
Documentation of graphql-hive/router#900