I have some battery powered devices that report in irregular intervals that they are still there. When they check in I get a websocket message from their hub with a new last_seen
value. I can also query this last_seen value at any time. I can push to Prometheus or let it pull.
The questions I’d like Grafana to answer are usually “Which devices are currently considered up, according to a device-specific timeout, and which down?” and “When was the device up or down within this time span?”. The latter can also be phrased as “When has the device checked in within this time span?”, I could then see the down periods graphically as periods where the are no check-ins.
I’m wondering what’s the best way to represent this information in Prometheus/Grafana. Should I push the last_seen
timestamp as a UNIX timestamp as a metric value? Should I just send a metric up
with a value of 1
whenever I receive a check-in? Some other format I haven’t considered?