[Dashboard] Fix invalid PromQL when global_filters is empty in Grafana dashboard generation#63687
Merged
edoakes merged 3 commits intoMay 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces regex-based cleanup for empty global filters in PromQL expressions to prevent invalid syntax. The reviewer pointed out that running these regex replacements unconditionally is risky as it could corrupt valid queries (e.g., within quoted strings). They suggested wrapping the cleanup in a check to only run when global_filters_str is empty, and noted that dashboard variables may also require a similar cleanup.
Signed-off-by: liujp <715643011@qq.com>
Signed-off-by: liujp <715643011@qq.com>
78fba03 to
014a8cf
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 014a8cf. Configure here.
Signed-off-by: liujp <715643011@qq.com>
edoakes
approved these changes
May 28, 2026
edoakes
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution
rueian
pushed a commit
to rueian/ray
that referenced
this pull request
Jun 4, 2026
…a dashboard generation (ray-project#63687) Description Fix Serve LLM Grafana dashboard failing to load due to invalid PromQL syntax. The Serve LLM dashboard (serve_llm_dashboard_panels.py) sets standard_global_filters=[]. When the environment variable RAY_GRAFANA_SERVE_LLM_DASHBOARD_GLOBAL_FILTERS is also not set, {global_filters} in panel expressions is replaced with an empty string, producing invalid PromQL with double commas: <img width="1785" height="414" alt="Clipboard_Screenshot_1779942646" src="https://github.com/user-attachments/assets/9038d10e-fe51-4759-8df4-c505ac3ad2df" /> # Generated invalid expression - Grafana fails to load ray_serve_deployment_request_counter_total{model_name=~"$vllm_model_name", , deployment=~"$deployment"} This PR adds post-format regex cleanup in _generate_targets() to remove empty filter artifacts: - , , → , - , } → } - { , → { These patterns are never valid in PromQL, so other dashboards with non-empty filters are unaffected. --------- Signed-off-by: liujp <715643011@qq.com>
limarkdcunha
pushed a commit
to limarkdcunha/ray
that referenced
this pull request
Jun 30, 2026
…a dashboard generation (ray-project#63687) Description Fix Serve LLM Grafana dashboard failing to load due to invalid PromQL syntax. The Serve LLM dashboard (serve_llm_dashboard_panels.py) sets standard_global_filters=[]. When the environment variable RAY_GRAFANA_SERVE_LLM_DASHBOARD_GLOBAL_FILTERS is also not set, {global_filters} in panel expressions is replaced with an empty string, producing invalid PromQL with double commas: <img width="1785" height="414" alt="Clipboard_Screenshot_1779942646" src="https://github.com/user-attachments/assets/9038d10e-fe51-4759-8df4-c505ac3ad2df" /> # Generated invalid expression - Grafana fails to load ray_serve_deployment_request_counter_total{model_name=~"$vllm_model_name", , deployment=~"$deployment"} This PR adds post-format regex cleanup in _generate_targets() to remove empty filter artifacts: - , , → , - , } → } - { , → { These patterns are never valid in PromQL, so other dashboards with non-empty filters are unaffected. --------- Signed-off-by: liujp <715643011@qq.com>
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.

Description
Fix Serve LLM Grafana dashboard failing to load due to invalid PromQL syntax.
The Serve LLM dashboard (serve_llm_dashboard_panels.py) sets standard_global_filters=[]. When the environment variable RAY_GRAFANA_SERVE_LLM_DASHBOARD_GLOBAL_FILTERS is also not set, {global_filters} in panel expressions is replaced with an empty string, producing invalid PromQL with double commas:
Generated invalid expression - Grafana fails to load
ray_serve_deployment_request_counter_total{model_name=
"$vllm_model_name", , deployment="$deployment"}This PR adds post-format regex cleanup in _generate_targets() to remove empty filter artifacts:
These patterns are never valid in PromQL, so other dashboards with non-empty filters are unaffected.