ah..  Sorry. There was a typo in my previous email. Actually I need to add
the or condition with different labels, like below

*container_cpu_usage_seconds_total{container="prometheus",
cluster="abc" or environment=~"xyz"}*

Thanks,


Thanks & Regards,

Anoop Mohan

Mob# +91-7293009486
E-mail : [email protected]


On Thu, Mar 3, 2022 at 10:15 PM Brian Candler <[email protected]> wrote:

> Yes, and you've almost answered it yourself :-)
>
> *container_cpu_usage_seconds_total{cluster=~"abc|xyz"}*
>
> On Thursday, 3 March 2022 at 16:32:32 UTC Anoop wrote:
>
>> Hi,
>>
>> Is there anyway to write a query with "*or" *condition in prometheus to
>> check if any of the label is present.
>>
>> For eg: I would like to write a query something like below.
>>
>> *container_cpu_usage_seconds_total{cluster="abc" or cluster=~"xyz"}*
>>
>> Is there anyway to do this?
>>
>> Thanks,
>>
> --
> 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/45ae4649-bfc6-49c3-854b-cedeea668e1en%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/45ae4649-bfc6-49c3-854b-cedeea668e1en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEQqSpdJnEFRtmx2dA3Gq74LmMtoqfwzo8Kk85UBt1F%2BDOyoig%40mail.gmail.com.

Reply via email to