I'm not going to attempt to analyse your query in detail, since you haven't 
provided any examples of the metrics and labels in question, but I would 
expect you need to look at

foo / ON(...) bar
or
foo / IGNORING(...) bar
as described here 
<https://prometheus.io/docs/prometheus/latest/querying/operators/#one-to-one-vector-matches>,
 
or GROUP_LEFT / GROUP_RIGHT as described here 
<https://prometheus.io/docs/prometheus/latest/querying/operators/#many-to-one-and-one-to-many-vector-matches>
.

However I just wanted to point out that your expression is missing 
parentheses.  Operator precedence 
<https://prometheus.io/docs/prometheus/latest/querying/operators/#binary-operator-precedence>
 says 
that
foo >= 0 / bar >= 0
is parsed as
foo >= (0 / bar) >= 0

you want:
(foo >= 0) / (bar >= 0)

Having said that, the ">= 0" is redundant here, because rate() can only 
ever return a positive value.  If the input value drops, it's treated as a 
counter reset.

-- 
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/cd17e701-3fd7-4dc0-a842-4ee8b71d72ef%40googlegroups.com.

Reply via email to