Cannot use label_values in conjunction with label_replace

  • What Grafana version and what operating system are you using?

Mac, not sure

  • What are you trying to achieve?

I have a metric foo, with a label <state_country>. I want to repeat a panel for each value of state, with all of the values for country per state present in each panel.

  • How are you trying to achieve it?

I’ve tried to create a multi-value variable based on the output of label_values(label_replace(, “country”, “$1”, “country_state”, “(.)_(.)”), “country”). I may have reproduced this slightly incorrectly, but I’ve verified that the inner query does work correctly and produces a new label called country.

  • What happened?

The result “None” was returned.

  • What did you expect to happen?

I expected to get back a list of values for the new snp label.

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

There were no errors in the Grafana UI and I do not think that I have access to the logs.

  • Did you follow any online instructions? If so, what is the URL?