Skip to content

Conversation

@sleepyfoodie
Copy link
Contributor

@sleepyfoodie sleepyfoodie commented Nov 28, 2025

The previous refactor broke cluster variable. The cluster dashboard never showed its cluster selector because that dashboard’s variable definition was different from every other dashboard. It was querying label values via cadvisor (up{job="cadvisor"}) and hiding the control unless showMultiCluster was enabled, so in most setups the query returned nothing and Grafana didn’t render the variable.

This PR has it pointing at kube-state-metrics and forcing showOnDashboard.withLabelAndValue() makes the variable populate and stay visible.

local datasource = common.datasource(config);
local clusterVar =
common.cluster(config, datasource, 'up{%(kubeStateMetricsSelector)s}')
+ var.query.generalOptions.showOnDashboard.withLabelAndValue();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this go on the common variable definition instead? Otherwise this will have to be copy/pasted every time it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes! I'll update that

@sleepyfoodie sleepyfoodie requested a review from skl November 28, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants