Re: [prometheus-users] Arithmetic operations on metric possible with scrape config?

2021-10-25 Thread Ben Cohee
Thanks Brian. I already use the regex_extracts for the SNMP floating point conversion via - https://www.robustperception.io/numbers-from-displaystrings-with-the-snmp_exporter - so yes this is what I was looking for (and overlooking). also Thanks @sup - I had not thought about adding a

Re: [prometheus-users] Arithmetic operations on metric possible with scrape config?

2021-10-23 Thread Ben Kochie
The best way to do this is to use a recording rule. Something like this: - record: global:pduInputPowerConsumption:sum expr: | sum(pduInputPowerConsumption{job="apc_pdus"} * 10 or on () vector(0)) + sum(pduInputPowerConsumption{job!="apc_pdus"} or on () vector(0)) This is also

Re: [prometheus-users] Arithmetic operations on metric possible with scrape config?

2021-10-23 Thread Brian Brazil
On Sat, 23 Oct 2021 at 00:44, Ben Cohee wrote: > This has been bothering me for a while, and hopefully someone has a > solution I am simply overlooking. > > I use snmp_exporter to pull power metrics from a bunch of different PDU > vendors (APC, Raritan, Geist, ServerTech, etc). I have one