Without knowing the units, it's hard to answer what exactly you're
trying to get. The value is an instantaneous watts and you want watt-hours?

avg_over_time(snmp_value{metric="Consomation"}[24h]) * 24

This will give you the watt-hours over the 24 hours.



On Tue, Dec 5, 2023 at 11:48 AM Malek Balek <[email protected]>
wrote:

> Hello all,
> I'm a little stuck with this one as i don't understand how to do it with
> and maybe you could help me with this one.
>
> I scrap an APC every 5 min to get the instant power consumption
>
> And i would like to calculate the average consomption of every hour and
> then sum up this average to get the daily consomption in grafana.
>
> Something like this:
>
>
>
> i've tried
> (sum_over_time((avg_over_time({metric="Consomation",
> __name__="snmp_value"}[1h]))[24h]))
>
> But the data seem wrong, and grafana is showing data per hour
>
> Do you know the correct way to do it ?
>
> Malek
>
> --
> 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/39a2ef03-df25-47aa-916a-6d4a435efb21n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/39a2ef03-df25-47aa-916a-6d4a435efb21n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABbyFmqUmYwE8_4oks9T2Af0yw112Spmc%2BXVF_h4pXGusKWp4g%40mail.gmail.com.

Reply via email to