Skip to content

feat: Add endpoints_per_pool Prometheus metric for hash-based routing#550

Merged
hoffmaen merged 2 commits intocloudfoundry:developfrom
sap-contributions:endpoints-per-pool
Apr 13, 2026
Merged

feat: Add endpoints_per_pool Prometheus metric for hash-based routing#550
hoffmaen merged 2 commits intocloudfoundry:developfrom
sap-contributions:endpoints-per-pool

Conversation

@hoffmaen
Copy link
Copy Markdown
Contributor

@hoffmaen hoffmaen commented Apr 8, 2026

Linked with cloudfoundry/docs-running-cf#143

Summary

  • Introduces a new endpoints_per_pool Prometheus gauge metric with labels route and lb_algorithm, reporting the number of endpoints per route pool for routes using hash-based load balancing
  • The metric is updated on endpoint registration, unregistration, and pruning of stale endpoints
  • When a route switches away from hash-based routing (including removal of the HB setting), the metric entry is automatically cleaned up

Motivation

Hash-based routing distributes requests based on a consistent hash, which can degrade when the instance count for a pool becomes too high. This metric provides visibility into the endpoint count per hash-based routing pool, keeping metric cardinality low by only tracking hash-based routes.

Backward Compatibility

Breaking Change? No

Note on AI usage

Parts of this code and tests were developed with assistance from Claude Code (claude-opus-4-20250514).

@hoffmaen hoffmaen force-pushed the endpoints-per-pool branch 3 times, most recently from 251199f to d3b37b3 Compare April 13, 2026 11:32
Soha-Albaghdady and others added 2 commits April 13, 2026 15:01
Rename DeleteEndpointsPerPool to UncaptureEndpointsPerPool, add metric
cleanup on route pruning and LB algorithm changes, and add tests.
@hoffmaen hoffmaen force-pushed the endpoints-per-pool branch from 43a163a to 0e77f30 Compare April 13, 2026 13:07
@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group Apr 13, 2026
@hoffmaen hoffmaen merged commit 2f28706 into cloudfoundry:develop Apr 13, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants