Repository navigation
[Data][LLM] Add SessionName and Cluster filters to the Data LLM Grafana dashboard - #67470
Conversation
Problem:
- The Data LLM panel queries have no {global_filters} placeholder, so
no global filter, including RAY_GRAFANA_DATA_LLM_DASHBOARD_GLOBAL_FILTERS,
ever reaches the panels.
- The dashboard has no SessionName or Cluster dropdown, unlike the Data,
Default and Serve dashboards.
- With Worker ID set to All, every panel mixes vLLM engines from every
cluster that Prometheus scrapes.
Change:
- Add {global_filters} to every Data LLM panel selector.
- Use the Data dashboard's standard filters: SessionName and
ray_io_cluster.
- Add SessionName and Cluster dropdowns, and narrow the model and worker
dropdowns to the selected session and cluster.
- Add tests for the dropdowns, the filters in every panel, the absence
of self-referencing dropdowns, and the absence of dangling commas.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marwan Sarieddine <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request integrates standard global filters (SessionName and Cluster) into the Data LLM Grafana dashboard panels and adds corresponding template variables to the dashboard base JSON. It also introduces comprehensive unit tests to verify that these filters are correctly applied and formatted. The review feedback suggests a safer regex pattern for the SessionName variable extraction to avoid greedy matching issues when other labels are present.
| "refId": "StandardVariableQuery" | ||
| }, | ||
| "refresh": 2, | ||
| "regex": "{SessionName=\"(?<value>.*)\".*", |
There was a problem hiding this comment.
Using a greedy wildcard .* inside the capture group (?<value>.*) can lead to incorrect matching if the Prometheus query response contains additional labels (e.g., if other labels are preserved or added by the datasource). It is safer and more robust to use a negated character class [^\"]* to match only the characters within the quotes of the SessionName value.
| "regex": "{SessionName=\"(?<value>.*)\".*", | |
| "regex": "{SessionName=\"(?<value>[^\"]*)\".*", |
There was a problem hiding this comment.
Not changing this: the dropdown query is count by (SessionName)(...), which keeps only the SessionName label, so every result line has exactly one quoted value and the greedy group cannot run past it. It is also the same pattern the other dropdowns in Ray's dashboard JSONs use, including the Data dashboard's SessionName, and against a live Prometheus the query returned the expected single session.
Problem
{global_filters}placeholder, so no global filter ever reaches the panels. Filters set throughRAY_GRAFANA_DATA_LLM_DASHBOARD_GLOBAL_FILTERSonly reach the model and worker dropdowns.SessionNameorClusterdropdown, unlike the Data, Default and Serve dashboards.Change
{global_filters}to every Data LLM panel selector (38 queries).standard_global_filtersto the Data dashboard's filters:SessionName=~"$SessionName"andray_io_cluster=~"$Cluster".SessionNameandClusterdropdowns, and narrow the model and worker dropdowns to the selected session and cluster.Repro, which prints how many panel queries carry each filter and the dropdown names:
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:
After:
Decisions to confirm
SessionNamedropdown lists sessions from a vLLM metric (ray_vllm_request_prompt_tokens_sum) instead ofray_data_output_bytes. It then shows only sessions that ran vLLM.SessionName"All" value is.*rather than the Data dashboard's.+, so series without the label still show.Related
Clustervariable to enable filtering of different RayClusters on Kubernetes #49498 applied the sameClusterfilter pattern to other dashboards.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 [Core/Auth] Create the auth token for ray.init() and test cluster heads, and require one for ray start --head #67258.🤖 Generated with Claude Code