On 12 Aug 09:12, Michael Black wrote:
> 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:
> 
>     SELECT *
>     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"]}`

Yes that is possible with a regex:

my_metric{Lable_1=~"A|B|C"}`

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/prometheus-users/5a5448e8-f054-4ca5-8400-8eb9100a9555n%40googlegroups.com.


-- 
Julien Pivotto
@roidelapluie

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/20200812161753.GA880615%40oxygen.

Reply via email to