I have an energy monitoring device, a Belkin Wemo, that reports current usage in milliwatts, and I have those being exported into prometheus. What I'd like is a graph that shows me cumulative KwH, monotonically increasing, since the moment I started collecting data.
The following query plotted in a table with a min_step=1h shows me KwH for each hour, and they add up to what I believe the total KwH is, so I'm pretty sure my data is correct:
sum_over_time(current_power[1h])/1000/1000/count_over_time(current_power[1h])
Plotting that same query in a graph does not do what I want, because I want a cumulative total, not a series of individual hourly totals. If I could just sum the results of this query, I think it would do what I want. However, the sum() operator just doesn't seem to do what I think it would when wrapped around the above query.