envoyproxy / envoyproxy/gateway
Merging backends drops alt_stat_name (EnvoyProxy clusterStatName) for merged clusters
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
### Background
`EnvoyProxy.spec.telemetry.metrics.clusterStatName` lets users configure a pattern (e.g. `%ROUTE_NAME%-%ROUTE_RULE_NAME%`) that Envoy Gateway resolves per-route-rule into each cluster's `alt_stat_name`, giving friendlier stat labels than the auto-generated cluster name.
When `EnvoyProxy.spec.mergeBackends` merges multiple routes' identical backends into a shared `BackendCluster`, `alt_stat_name` is currently dropped entirely for merged clusters — their stats fall back to Envoy's default (the long, structural cluster name) instead of the configured pattern.
### Why this isn't a quick fix
`clusterStatName` is a single pattern string with no way to express different behavior for merged vs. non-merged clusters. Since the pattern's placeholders (`%ROUTE_NAME%`, `%ROUTE_RULE_NAME%`, etc.) are inherently per-route, a single resolved value can't correctly describe a cluster shared by multiple different routes.
### Possible directions
- Extend `clusterStatName`'s API to let users express distinct behavior for the merged case (e.g. a separate pattern, or an explicit opt-out).
- Something else — open to discussion.
### Context
Raised during review of #9477: https://github.com/envoyproxy/gateway/pull/9477#discussion_r3610585531
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the EnvoyProxy.spec.mergeBackends and telemetry.metrics.clusterStatName behavior described here, then review the discussion in PR #9477. Determine the intended API behavior when routes share a BackendCluster, including how alt_stat_name should be handled for merged clusters. Done means the behavior is agreed and implemented with coverage for merged and non-merged backends.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100