15.05.2017, 07:13
I almost forgot to comment about "accumulated watt hours do not need to be recorded every 5 secs."
Actually, I would like to see this updated more frequently. In order to correctly calculate the average watts used, we need to take the first derivative of the watt-hours. In Prometheus, we provide a couple functions to handle this well, but we need several samples in order to calculate this. For example rate(watt_hours_total[15s]) would take 3 samples, which is the minimum necessary to handle a counter reset/rollover.
Using cumulative counters for calculating gauge values eliminates the whole sampling problem, lost samples reduce fidelity, but not accuracy.
Actually, I would like to see this updated more frequently. In order to correctly calculate the average watts used, we need to take the first derivative of the watt-hours. In Prometheus, we provide a couple functions to handle this well, but we need several samples in order to calculate this. For example rate(watt_hours_total[15s]) would take 3 samples, which is the minimum necessary to handle a counter reset/rollover.
Using cumulative counters for calculating gauge values eliminates the whole sampling problem, lost samples reduce fidelity, but not accuracy.