[prometheus-users] Re: PromQL: understanding the and operator

2024-02-23 Thread 'Brian Candler' via Prometheus Users
On Saturday 24 February 2024 at 01:00:57 UTC+7 Alexander Wilke wrote: Another possibility could be QueryA + queryB == 0 #both down No, that doesn't work, for exactly the same reason that "QueryA and QueryB" doesn't work. With a binary expression like "foo + bar", each side is a vector, and

[prometheus-users] Re: PromQL: understanding the and operator

2024-02-23 Thread 'Brian Candler' via Prometheus Users
On Friday 23 February 2024 at 02:28:52 UTC+7 Puneet Singh wrote: Now i tried to find the time duration where both these service were simultaneously down / 0 on both server1 and server2 : (sum without (USER) ( *go_service_status{HOSTNAME="server1",SERVER_CATEGORY="db1",SERVICETYPE="grade1"}*) <

[prometheus-users] Re: PromQL: understanding the and operator

2024-02-23 Thread Alexander Wilke
Another possibility could be QueryA + queryB == 0 #both down Or the other way QueryA + querxB == 2 # both up Alexander Wilke schrieb am Freitag, 23. Februar 2024 um 17:45:28 UTC+1: > In Grafana i create query A and Query B and then an Expression C with > "Math" and then I can compare Like

[prometheus-users] Re: PromQL: understanding the and operator

2024-02-23 Thread Alexander Wilke
In Grafana i create query A and Query B and then an Expression C with "Math" and then I can compare Like $A > 0 && B > 0. Maybe there is "Transform Data" and then a calcukation Option. Puneet Singh schrieb am Donnerstag, 22. Februar 2024 um 21:58:08 UTC+1: > okay, So I think should this be the

[prometheus-users] Re: PromQL: understanding the and operator

2024-02-22 Thread Puneet Singh
okay, So I think should this be the correct way to perform the and operation ? - (sum without (USER, HOSTNAME ,instance ) ( *go_service_status{HOSTNAME="server1",SERVER_CATEGORY="db1",SERVICETYPE="grade1"}*) < 1) and (sum without ( USER, HOSTNAME ,instance ) (

[prometheus-users] Re: PromQL: understanding the and operator

2024-02-22 Thread Puneet Singh
*Correction: I was expecting a graph similar to the once for server2 , but i got : should be - I was expecting a graph similar to the server1 , but i got : On Friday 23 February 2024 at 00:58:52 UTC+5:30 Puneet Singh wrote: > Hi All, > I have a metric called go_service_status where i use the