-
Notifications
You must be signed in to change notification settings - Fork 840
Description
I have data source, power meters, who report at random times. I put their values into a Gauge.
Some meters report often, every 30 seconds. Some report every 12 hours.
When the data arrives at least a frequently as the prometheus time-frame interval, there is no weirdness. When the time between data points is longer, the exporter reports the last reported value, which looks like it's asserting that the value hasn't changed, when in fact it has no idea if the value has changed.
I am kind of new to Prometheus and I may be doing something wrong, I admit, but I think I can get a better idea from truthful time reports
1000,null,null,null,null,null,null,3000,null,null,null,null,null,null,null,null,null,null,null,null,8000
than a series of mostly lies
1000,1000,1000,1000,1000,1000,1000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,8000
from prometheus_client import start_http_server, Counter, Gauge
power_gauge = Gauge('powermeter_readings_kwh', 'power consumption', ["meterid"])
start_http_server(8000)
for reading in source():
power_gauge.labels(meterid=reading.get("ID")).set(reading.get("Consumption"))