Re: [prometheus-users] prometheus rules returns "0" when i combine two metrics using label_replace

13 views
Skip to first unread message

Julius Volz

unread,
Dec 12, 2022, 10:28:25 AM12/12/22
to Umut Cokbilir, Prometheus Users
Hi Umut,

You are multiplying the left (or top) metric by some aggregation over the ping packet loss. If the latter is 0 (no packet loss), the output will be 0, since anything multiplied by 0 will be 0. If you want the right-hand side operator to be neutral (multiplication-wise), you could multiply it by 0 and then add 1, but it'd be even easier to use a "+" instead of a "*" and then just multiply the right-hand side by 0 to make sure it's always neutral with respect to addition.

Regards,
Julius

On Mon, Dec 12, 2022 at 2:38 PM Umut Cokbilir <umut.c...@gmail.com> wrote:
Hi All,
Please check my screen attached. Where am i doing wrong?
How to fix it?

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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9d4f4599-f826-47b9-9686-3a73e092fb82n%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages