[Bugfix][Dashboard] Dedup healthy_pods_total across router replicas#943
Open
banlor wants to merge 1 commit intovllm-project:mainfrom
Open
[Bugfix][Dashboard] Dedup healthy_pods_total across router replicas#943banlor wants to merge 1 commit intovllm-project:mainfrom
banlor wants to merge 1 commit intovllm-project:mainfrom
Conversation
count by(endpoint) (vllm:healthy_pods_total) returns N samples per backend with N router replicas — each router emits its own time-series with distinct scrape-target labels. The "Available vLLM instances" stat ends up multiplied. sum(max by (server) (vllm:healthy_pods_total)) collapses replicas first, so the count matches actual healthy backends regardless of router count. Fixes vllm-project#644 Signed-off-by: Mikhail Basov <Michael.S.Sinclair@protonmail.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Prometheus expressions in several vLLM dashboard configurations to use a sum(max by (server) ...) aggregation for counting healthy pods. The reviewer recommends further refining this logic by including namespace and model labels in the max by clause to ensure accurate deduplication and prevent collisions in multi-tenant or multi-model environments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Available vLLM instances" stat panel reads:
The metric is emitted by each router replica from its own service-discovery view, so Prometheus stores N time-series per backend (one per scrape target).
count by(endpoint)then multiplies the result by router replica count.Fix:
max by (server)dedups across router replicas before summing. The metric is 0/1, so max is effectively OR across replicas. If any router sees a backend healthy, it counts.Went with max (optimistic) over min (pessimistic) on purpose. During scale-up or SD propagation lag, routers can briefly disagree about a backend's health. For an availability stat, the useful answer is "is there a router willing to route there", and
minwould under-report during transient lag.Verification
promtool tests with synthetic series:
Fixes #644