Thanks! I didn't know by or without would work like that, so now I know. :) 
fantastic. This is now I think a working query:

round(sum(max by (serverId, clusterId) 
(increase(server_statistics_total{statistic="failed", 
serverId=~"$serverId"}[$__range])) > 0))

Do you think that is as accurate as possible with a gauge and multiple 
metric providers? :)

On Wednesday, September 2, 2020 at 9:59:13 AM UTC+2 b.ca...@pobox.com wrote:

> On Wednesday, 2 September 2020 08:31:15 UTC+1, Gergely Brautigam wrote:
>>
>> So I would have to add some kind of check to only choose max if there are 
>> two for the same server id.
>>
>>
> max by (server_id) (metric)
>
> or
>
> max without (pod, instance) (metric)
>
>
> https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators
>
>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/bb693528-ebe3-4e0b-9fd2-23cb6bd1cd48n%40googlegroups.com.

Reply via email to