PromQL - Possible to query label by list of values?

Is is possible in PromQL to query a label with a list of values? For example this is a how you’d do it in SQL:

FROM my_table
WHERE column_1 IN ('A', 'B', 'C')

Is there a similar syntax in PromQL? I would have imagined something like this:

my_metric{Lable_1=["A", "B", "C"]}

You would use the regex match operator =~ like this:


If you use a Grafana list of values variable then it’s:


If you set a Custom all value of .* in your variable it may help performance if you have a long list of values.

More info:

1 Like