Skip to content

[Data][LLM] Add SessionName and Cluster filters to the Data LLM Grafana dashboard - #67470

Merged
MengjinYan merged 1 commit into
masterfrom
marwan/data-llm-dashboard-cluster-filter
Nov 3, 2026
Merged

MengjinYan merged 1 commit into
masterfrom
marwan/data-llm-dashboard-cluster-filter

Conversation

@marwan116

@marwan116 marwan116 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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:

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:

1-cache-utilization-before

After:

1-cache-utilization-after-session-cluster

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

🤖 Generated with Claude Code

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]>
@marwan116
marwan116 requested review from a team as code owners October 27, 2026 13:48

@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 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>.*)\".*",

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.

medium

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.

Suggested change
"regex": "{SessionName=\"(?<value>.*)\".*",
"regex": "{SessionName=\"(?<value>[^\"]*)\".*",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@marwan116 marwan116 added data Ray Data-related issues llm go add ONLY when ready to merge, run all tests labels Oct 27, 2026
@jeffreywang88 jeffreywang88 self-assigned this Oct 27, 2026

@jeffreywang88 jeffreywang88 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

@MengjinYan
MengjinYan merged commit 89f5414 into master Nov 3, 2026
7 checks passed
@MengjinYan
MengjinYan deleted the marwan/data-llm-dashboard-cluster-filter branch November 3, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests llm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants