Creating Grafana variable from the set of of all possible values of a label
Asked Answered
F

1

7

I'd like to create a Grafana variable/filter of all possible values of a label region on the metric instance. The query for listing these value is:

group by (region)(instance)

Unfortunately, when I paste this query in Grafana >> Variables >> Query options >> Query I get the errors

Validation
cannot parse parameter match[]

and

Templating [region]
Error updating options: cannot parse parameter match[]
Fosterling answered 14/4, 2022 at 16:26 Comment(0)
S
15

To create a variable in Grafana that contains all values of a specific label in a specific metric you can use label_values(metric, label). You can also do label_values(metric{label2="test"}, label) if you want to be more specific.

In your case it seems to me that it should be label_values(instance, region), where instance is the metric and region is the label.

You have information about it in Grafana's documentation.

Shiverick answered 14/4, 2022 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.