Grafana Alert when No Data or Less Data!


Testing a lot around Grafana Alerting and I might design something wrong here…

My use-case : Monitoring hundreds of energy meters.

Designing a Grafana Alert for sudden voltage change, high current, low frequency… is quite easy and is heavily used in our context !

But how to detect a missing energy meter which stopped responding and sending data ?

Grafana “No Data” alerting seems to be like an All-or-nothing parameter that fire an alarm when you don’t have any incoming data from your query.

Using dashboard variables, and row repeat or panel repeat for each energy meter is not a solution because when creating the alert from the panel, the query is a “Select data from all energy meters” so you won’t notice any change in the number of alive energy meters nor identify who is the missing one…

How to design a query that would look like : “select hostname(s) that were present in the last 24h but are absent from the last 10 minutes ?”

Any help/hints/advices welcomed here :slight_smile:

Hi! :wave:

If using Prometheus, use count and offset to find missing labels. For example, if the metric is called voltage and the label is called meter:

count(count_over_time(voltage[15m])) by (meter) unless
count(count_over_time(voltage[5m])) by (meter)

This should show all meters seen in the last 15 minutes that have been missing for the last 5 minutes.

Thanks for the reply,

Using influxDb here :frowning:

My workaround for now : new graph pannel, mean mesurement with 10min window and fill(0)

When an Energy meter stops responding, mean() drops to zéro in a few minutes and I can use a standard alert below level.


Hi! :wave: Is there a similar query you can write for InfluxDB? Have you asked on the InfluxDB community forums?