Skip to content

feat(api): add EnableCircuitBreakerRemainingStats to ProxyMetrics - #9805

Open
omkar619-dev wants to merge 1 commit into
envoyproxy:mainfrom
omkar619-dev:feat/circuit-breaker-track-remaining
Open

feat(api): add EnableCircuitBreakerRemainingStats to ProxyMetrics#9805
omkar619-dev wants to merge 1 commit into
envoyproxy:mainfrom
omkar619-dev:feat/circuit-breaker-track-remaining

Conversation

@omkar619-dev

Copy link
Copy Markdown

Fixes #7743

Adds enableCircuitBreakerRemainingStats to EnvoyProxy.spec.telemetry.metrics, following @arkodg's preference for opt-in via EnvoyProxy rather than BackendTrafficPolicy. Plumbed ProxyMetrics -> ir.Metrics -> internal/gatewayapi/listener.go -> buildXdsClusterCircuitBreaker, mirroring the existing EnablePerEndpointStats path.

Set on both Thresholds and PerHostThresholds, per @guydc's note that per-host users are interested in this too.

Not applied to ext-auth / ext-proc / jwt / oidc clusters: those are built via createExtServiceXDSCluster (internal/xds/translator/utils.go), which never receives metrics. Documented on the API field godoc.

One thing worth flagging from the Envoy proto: remaining retry resources are not tracked when a retry budget is used in place of the max_retries circuit breaker. Since Envoy Gateway already supports retryBudget, I've documented that interaction on the field.

Defaults to off, so all existing xDS golden fixtures pass unchanged. New fixture circuit-breaker-track-remaining covers both threshold types.

/cc @arkodg @guydc

@omkar619-dev
omkar619-dev requested a review from a team as a code owner August 20, 2026 05:16
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 0de22f2
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a868e7179ed4d00082a389a
😎 Deploy Preview https://deploy-preview-9805--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb571e04bb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread api/v1alpha1/envoyproxy_metric_types.go
Adds an opt-in EnvoyProxy telemetry setting that enables Envoy's circuit
breaker track_remaining field, exposing the remaining_* gauges that report
how much headroom is left before a circuit breaker opens.

The flag is applied to both the default-priority thresholds and the
per-host thresholds. Clusters generated for ext-auth, ext-proc, JWT and
OIDC providers are not covered, as they are built via
createExtServiceXDSCluster which does not receive proxy telemetry context.
This limitation is documented on the API field.

Fixes envoyproxy#7743

Signed-off-by: Omkar Shendge <omkarshendge619@gmail.com>
@omkar619-dev
omkar619-dev force-pushed the feat/circuit-breaker-track-remaining branch from cb571e0 to 0de22f2 Compare August 20, 2026 05:19
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.

[stats] Add support for track_remaining in Circuit Breaker configuration

1 participant