Skip to content

[serve][llm] Add Cluster filter to Serve LLM Grafana dashboard - #64596

Merged
eicherseiji merged 2 commits into
ray-project:masterfrom
kevin85421:serve-llm-dashboard-cluster-filter
Jul 9, 2026
Merged

eicherseiji merged 2 commits into
ray-project:masterfrom
kevin85421:serve-llm-dashboard-cluster-filter

Conversation

@kevin85421

@kevin85421 kevin85421 commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Why are these changes needed?

Most Ray Grafana dashboards let users use Cluster to switch between different Ray clusters. For example, I set Cluster to kaihsun-test in the Default Dashboard to view the metrics related to my RayCluster.

image

However, the current Serve LLM Dashboard doesn't support Cluster as a variable. See the screenshot below for an example. Therefore, I can only see the serve deployment name, and I don't know which KubeRay RayService the deployment is from.

image

This PR adds Cluster as a variable, and the change is similar to #49498. See the screenshot below for an example.

Screenshot 2026-07-08 at 11 49 14 PM

Related issue number

Checks

@kevin85421
kevin85421 force-pushed the serve-llm-dashboard-cluster-filter branch from bfd9572 to 92994ab Compare July 8, 2026 07:51

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds cluster-level filtering to the Serve LLM Grafana dashboard by introducing a 'Cluster' template variable and updating the standard global filters. It also adds corresponding unit tests to verify that the dashboard utilizes these filters correctly. The review feedback suggests correcting a typo ('automaticaly' to 'automatically') in the variable's description and setting the 'label' field to 'Cluster' instead of null for consistency with other template variables.

@kevin85421
kevin85421 force-pushed the serve-llm-dashboard-cluster-filter branch 2 times, most recently from ea2d2de to b435295 Compare July 9, 2026 05:28
The Serve LLM dashboard could not be filtered by cluster: it had an empty
`standard_global_filters` and its base JSON defined no `Cluster` template
variable, unlike the default/serve/data dashboards. As a result every panel
query ignored `ray_io_cluster`.

Enable the cluster filter by setting `standard_global_filters` to
`ray_io_cluster=~"$Cluster"` (injected into the existing `{global_filters}`
slots) and add the `Cluster` template variable to the base JSON, mirroring the
Serve dashboard.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Kai-Hsun Chen <[email protected]>
@kevin85421
kevin85421 force-pushed the serve-llm-dashboard-cluster-filter branch from b435295 to 06bf1f6 Compare July 9, 2026 07:16
@kevin85421
kevin85421 marked this pull request as ready for review July 9, 2026 07:29
@kevin85421
kevin85421 requested a review from a team as a code owner July 9, 2026 07:29
@kevin85421 kevin85421 added the go add ONLY when ready to merge, run all tests label Jul 9, 2026
@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue llm community-contribution Contributed by the community labels Jul 9, 2026

@eicherseiji eicherseiji left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, tested locally

Image Image

@eicherseiji
eicherseiji merged commit ad62896 into ray-project:master Jul 9, 2026
7 checks passed
jeffreywang88 added a commit that referenced this pull request Jul 16, 2026
Mirrors the vLLM Serve LLM dashboard (#64596): adds a Cluster
template variable and sets standard_global_filters to ray_io_cluster=~"$Cluster",
which fills the existing {global_filters} slots in the panel queries.

Co-Authored-By: Dongjun Na <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…roject#64596)

## Why are these changes needed?

Most Ray Grafana dashboards let users use `Cluster` to switch between
different Ray clusters. For example, I set `Cluster` to `kaihsun-test`
in the `Default Dashboard` to view the metrics related to my RayCluster.

<img width="1109" height="450" alt="image"
src="https://github.com/user-attachments/assets/0d46bd74-11a4-4c39-ab40-9302e109a130"
/>

However, the current `Serve LLM Dashboard` doesn't support `Cluster` as
a variable. See the screenshot below for an example. Therefore, I can
only see the serve deployment name, and I don't know which KubeRay
RayService the deployment is from.

<img width="1470" height="451" alt="image"
src="https://github.com/user-attachments/assets/25c019e5-30b0-4942-902c-9eb3efe2abe2"
/>

This PR adds `Cluster` as a variable, and the change is similar to
ray-project#49498. See the screenshot below
for an example.

<img width="1471" height="408" alt="Screenshot 2026-07-08 at 11 49
14 PM"
src="https://github.com/user-attachments/assets/cbc154d8-0616-407f-a7d6-009016b7fb45"
/>

## Related issue number

<!-- For example: "Closes ray-project#1234" -->

## Checks

- [x] I've signed off every commit (by using the -s flag, i.e., `git
commit -s`) in this PR.
- [x] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [x] I've added any new APIs to the API Reference. For example, if I
added a method in Tune, I've added it in `doc/source/tune/api/` under
the corresponding `.rst` file.
- [x] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [x] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: Kai-Hsun Chen <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: 400Ping <[email protected]>
MengjinYan pushed a commit that referenced this pull request Nov 3, 2026
…na dashboard (#67470)

## Problem

- The Data LLM panel queries have no `{global_filters}` placeholder, so
no global filter ever reaches the panels. Filters set through
`RAY_GRAFANA_DATA_LLM_DASHBOARD_GLOBAL_FILTERS` only reach the model and
worker dropdowns.
- The dashboard has no `SessionName` or `Cluster` dropdown, unlike the
Data, Default and Serve dashboards.
- So with Worker ID set to All, every panel mixes vLLM engines from
every cluster that Prometheus scrapes. Choosing a cluster does not
narrow the panels.

## Change

- Add `{global_filters}` to every Data LLM panel selector (38 queries).
- Set `standard_global_filters` to the Data dashboard's filters:
`SessionName=~"$SessionName"` and `ray_io_cluster=~"$Cluster"`.
- Add `SessionName` and `Cluster` dropdowns, and narrow the model and
worker dropdowns to the selected session and cluster.

```
              before                                  after
SessionName ─ (no dropdown)            SessionName ─┬─> model & worker dropdowns
Cluster ───── (no dropdown)            Cluster ─────┤      and every panel selector
override ───> model & worker           override ────┘
              dropdowns only
```

Repro, which prints how many panel queries carry each filter and the
dropdown names:

```bash
RAY_GRAFANA_DATA_LLM_DASHBOARD_GLOBAL_FILTERS='ClusterId=~"$ClusterId"' python -c '
import json
from ray.dashboard.modules.metrics.grafana_dashboard_factory import generate_data_llm_grafana_dashboard
d = json.loads(generate_data_llm_grafana_dashboard()[0])
exprs = [t["expr"] for p in d["panels"] for t in p.get("targets", [])]
print(len(exprs), sum("ClusterId=~" in e for e in exprs), sum("ray_io_cluster=~" in e for e in exprs))
print([v["name"] for v in d["templating"]["list"]])'
```

| | Before | After |
|---|---|---|
| Panel queries carrying the override filter | 0 of 38 | 38 of 38 |
| Engines in Cache Utilization for one cluster, Worker ID = All (one
real job) | 13 (5 from other jobs) | 8 |

### Before / after

Cache Utilization on a managed Grafana, with one job's cluster selected
and Worker ID = All. Before, engines from another job appear from 14:16;
after, only this job's 8 engines appear, from 14:37.

**Before:**

<img width="1525" height="784" alt="1-cache-utilization-before"
src="https://github.com/user-attachments/assets/6dcb3e95-eb82-44ad-9b58-ecb2cf99d000"
/>


**After:**

<img width="1478" height="812"
alt="1-cache-utilization-after-session-cluster"
src="https://github.com/user-attachments/assets/c9c58477-7793-4d48-a3c6-894b7bcdd1ca"
/>

## Decisions to confirm

- The `SessionName` dropdown lists sessions from a vLLM metric
(`ray_vllm_request_prompt_tokens_sum`) instead of
`ray_data_output_bytes`. It then shows only sessions that ran vLLM.
- The `SessionName` "All" value is `.*` rather than the Data dashboard's
`.+`, so series without the label still show.

## Related

- Not a duplicate: no open issue or PR covers this. #64596 (Serve LLM)
and #49498 applied the same `Cluster` filter pattern to other
dashboards.
- Tests: `pytest python/ray/tests/test_metrics_head.py`: 15 passed, with
9 new Data LLM cases. Run on a checkout that matches the latest nightly
wheel; on current master, the 4 cluster-start tests need a nightly that
includes #67258.
- AI assistance: written with Claude Code. I reviewed every line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Marwan Sarieddine <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests llm serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants