Grafana Variable Label Filters Not Saving

What Grafana version and what operating system are you using?

  • Grafana v10.1.2
  • GKE

What are you trying to achieve?
I want to create a new variable called “Project” that has the Query type of Label values and the label set to prometheus_group, which will then change the view of my dashboard accordingly.

How are you trying to achieve it?
I’ve imported the Kubernetes dashboard from: Kubernetes cluster monitoring (via Prometheus) | Grafana Labs

For all of my Prometheus metrics, I have 2 configured labels:

  • cluster - The GKE cluster name.
  • prometheus_group - The GCP Project name.

When I create the label and click on “Run query” nothing happens.
To be honest, I don’t know what to expect here.
Should something happen? I would’ve thought at least an “OK” message of some kind would appear.

Regardless, nothing changes on the dashboard; I think because the “Node” variable is set to “All” and doesn’t filter based on what I select within Project.

It looks like I need to add a label filter to this variable, but when I select the Prometheus_group label and the $Project value, the Prometheus_group label disappears, and the dropdown returns to “Select label”. I’ve attached screenshots below to demonstrate this.

What did you expect to happen?
I would expect to be able to adjust the Node variable to filter based on what I’ve selected in the Project variable I’ve configured.

Is this some sort of bug in the UI?


Any help with this would be greatly appreciated!

Hey @TitanRob16 , I see this was a while ago but I ran into the same issue just now. It seems like it is a UI bug but I found a way around it.
Screenshot 2024-02-12 at 2.39.53 PM

If you fill out the “Metric” field (you can use any metric that has the label you are looking for) and then the “Label Filter” the UI will hold on to the filter value enough for you to save it. If you hit “Apply” it might disappear again but if you just save it and then go to the dashboard, you should get the expected result.

Hope this helps someone who might stumble upon this by googling :slight_smile:

1 Like