I have this Prometheus query that i am using to calculate the power consumption of apc PDUs in KWH,
sum(sum_over_time((rPDU2DeviceStatusPower_gauge{site=~"$site"})[$__range] /100 ) / count_over_time(rPDU2DeviceStatusPower_gauge{site=~"$site"}[$__range]) * ($__range/3600)) by (site)
i am visualizing this in pie chart that why i am grouping by site name of each pdu.
my collect interval is 5min
the metric rPDU2DeviceStatusPower_gauge return the power consumption of the pdu load in hundredths of kilowatts, that's why i am dividing by 100
can you tell me if this query is correct ?
What i tried : the query above
What i am expecting : well, to get the correct value in kwh