On 25/01/2021 23:08, [email protected] wrote:
Hell Guys
I have a doubts about using arithmetic operations in Prometheus
Currently I have a metric *A* that return more than a single row with values, so when I try to divide these values of *A* by using the single result of another metric *B* I get as result only one row instead of many row as the first metric *A*, but when I put the value in hard code, I get the result I want it i.e.  many row as the first metric *A*
*Why is this happening?*
*Thanks for your help in advance *

With many operations Prometheus will match the metrics using their labels. For your example of A & B, take a look at what combinations of labels exist - both could be single values or multiple values, both could have identical sets of labels or different ones. These will all alter the outcome.

For division by a fixed number there is no problem with label matching, so for example A / 5 will return exactly as you'd expect, being each of the values of A (which could be multiple combinations of labels) divided by 5.

--
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/9ef073f1-6f10-cace-bd35-4b8967c16a78%40Jahingo.com.

Reply via email to