I checked another answer for similar question without a good answer. I am trying to unit test alert rules. Prometheus provides promtool, that works nicely but prometheus alerts seem to work differently to grafana. Grafana seems to alert if the value > 0, but you cannot alert if comparing to 0, unless you add bool
. Promtool alerts when the value is present (after filter), so to be able to use promtool one have to do some hack like (metric == bool 0) != 0
, I can have both promtool and grafana return the same behavior (alert when metric value is zero). Is there any tool from grafana, just wondering if there are other gotchas from grafana alert when coming from prometheus.
1 Like