fix(dashboard): SGLang panels show No data when exporter negotiates escaping=underscores - #160
Merged
mengchengTang merged 1 commit intoSep 3, 2026
Conversation
SGLang exporters that negotiate OpenMetrics 1.0 with
`escaping=underscores` cause Prometheus to store `sglang:foo` as
`sglang_foo`, so every panel in the SGLang dashboard renders "No data".
Select metrics via `{__name__=~"sglang[:_]foo"}` so the dashboard works
regardless of which form the scrape produced, instead of hardcoding one
of the two spellings.
The four `label_values()` template queries need the same treatment: with
`$sglang_model_name` and `$sglang_replica` unresolved, every panel stays
empty even after the expressions are fixed.
Co-authored-by: Cursor <cursoragent@cursor.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.
Problem
Every panel in
verl_tainer_v1_with_sglang_enginerenders No data against a live SGLang rollout, even though Prometheus is scraping the SGLang targets successfully.The dashboard queries metrics as
sglang:e2e_request_latency_seconds_bucket, but the series are stored assglang_e2e_request_latency_seconds_bucket.Root cause
SGLang 0.5.16 answers
/metricswith:The payload itself uses colon-prefixed names (
sglang:cache_hit_rate, ...), but the negotiatedescaping=underscoresscheme only permits[a-zA-Z0-9_]. Colons are outside that set, so Prometheus escapes them to underscores before the sample is stored.This is observable as a mismatch between what Prometheus parsed and what it stored, on the same target:
Environment: SGLang 0.5.16, Prometheus 2.54.1 (the version installed by
rl-insight server install), rl-insight 0.3.0, verl withrollout.name=sglang.Fix
Select through
__name__with a character class that accepts both spellings:I deliberately avoided rewriting
sglang:tosglang_, because that would break deployments whose exporter or scrape negotiation preserves the colon form. The character class works in both.The four
label_values()template queries need the same change. Without them$sglang_model_nameand$sglang_replicaresolve to nothing and every panel stays empty even after the expressions are corrected.Verification
Against a live 4-replica SGLang rollout, after the change:
$sglang_model_nameresolves to["DeepSeek-V4-Flash-FP8"],$sglang_replicato["0","1","2","3"]histogram_quantile(0.95, ...)over the bucket selector returns a valueOnly query strings changed; no panel layout, title, or datasource was touched. The file remains valid JSON.