I use Telegraf / InfluxDB / Grafana to register and view metrics for my servers. Sometimes one of these component edges and metrics stop flowing into InfluxDB.
To be able to notice when this happens (instead of using Monit to restart the service), I would like to create a Grafana dashboard where I have a singlestat dashboard for each host that shows the most recent timestamp (or better, how much time has passed) since the last metric. I would also like to colorize a singlestat background depending on how long it has been. I would like to be able to do this for any InfluxDB metric, as different metrics may have different reasons for the lag.
Right now, I tried something similar in InfluxQL, but I just get an error message that at least one non-temporary field should be present in the request:
SELECT last(time) FROM "system" WHERE "load1" > -1 GROUP BY "host"
If I try to change it to this, I get a “multiple series error”:
SELECT last(time), last("load1") FROM "system" GROUP BY "host"
Am I trying to do something difficult, or am I missing something obvious?
source
share