Conversation
Grafana's seriesOverrides[].stack is tri-state: false, true, or a group name
("A", "B", "D"...). Only false was honored, so a named group fell through and a
series Grafana draws as a separate overlay was accumulated onto the stacked
breakdown it is meant to sit above.
Dashboard 9852's Memory panel is the case: {"alias": "/Total memory/",
"fill": 0, "stack": "D"} makes Grafana stack active+buffers+cached to 6.46 GB
and draw Total memory as its own unfilled line at 6.20 GB. The migration
stacked all four, so the chart maximum read 12.65 GB -- roughly twice too tall,
while every individual series value was correct.
A named group holding exactly one series is precisely an unstacked overlay, and
it maps losslessly onto the per-metric `stack` the panel schema already carries
("rendered as an unstacked overlay") and the Kibana target already renders as a
separate layer (dashboards_api.py, kubernetes-mixin style stacked breakdown plus
unstacked overlay). Only this source-side mapping was missing.
Kibana Lens accumulates one stack per layer, so a named group holding two or
more series cannot be represented. Those stay stacked and are disclosed as a
warning rather than silently reshaped.
Note the fix only takes effect when the series name matches the override alias.
9852's alias is the regex /Total memory/ (with a space) while default naming
yields Total_memory, so it matches there only because the curated pack renames
the series; underscore-vs-space alias matching is a separate gap.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8 tasks
This was referenced Sep 22, 2026
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.
Closes #446
Summary
Grafana's
seriesOverrides[].stackis tri-state:false,true, or a group name ("A","B","D"…). Onlyfalsewas honored, so a named group fell through and a series Grafana draws as a separate overlay got accumulated onto the stacked breakdown it is meant to sit above.The case
Dashboard 9852's Memory panel:
{"alias": "/Total memory/", "color": "#bf1b00", "fill": 0, "linewidth": 2, "stack": "D"}Grafana stacks active+buffers+cached to 6.46 GB and draws Total memory as its own unfilled line at 6.20 GB. The migration stacked all four:
Every individual series value was already correct — only the stacking composition was wrong, which makes a side-by-side look like a data discrepancy when it isn't.
Approach
A named group holding exactly one series is an unstacked overlay, and it maps losslessly onto machinery that already existed end-to-end:
stack— "rendered as an unstacked overlay"dashboards_api.py, commented "kubernetes-mixin style: stack usage by breakdown, overlay requests/limits unstacked")Only the source-side mapping was missing. Resulting Memory panel:
area_stackedlineGroups with 2+ members are disclosed, not reshaped. Lens accumulates one stack per layer, so several independent stacks cannot be represented; those stay stacked and emit a warning rather than being silently restructured.
Reviewer note
The fix only takes effect when the series name matches the override alias. 9852's alias is the regex
/Total memory/(with a space) while default naming yieldsTotal_memory(underscore), so it matches there only because the curated pack renames the series. Underscore-vs-space alias matching for un-packed dashboards is a separate gap, flagged at the end of #446 — not addressed here.Test plan
test_named_stack_group_singleton_becomes_unstacked_overlay— singleton → overlay, siblings stay stacked, and the native output carries both anarea_stackedand an unstacked layertest_named_stack_group_with_multiple_series_is_disclosed_not_reshaped— 2-member group stays stacked and surfaces a disclosuremake test6390 passed, 61 skipped;make lintandmake typecheckclean🤖 Generated with Claude Code