On 23.01.21 01:14, akshay sharma wrote: > > I'm trying to raise an alert on metric(metric_test). Evaluation interval is > every 5mints. > > Issue: > > Suppose, At time(T1) alert is fired and prometheus scrapes metric at > time(t3) but there is no metric with name metric_test at target during that > time, prometheus will update as no data as shown below. In Prometheus GUI > -> Graph, when you query for metric like below , it is showing no data. > > Metric_test > > no data > > at time(t5) evaluation of alerts happens, due to "no data" it is marking > alerts as resolved. I don't want evaluation of alert expressions to happen > when there is no data . > > How can we avoid that?
You kind of have to evaluate the expression to find out that the evaluation results in "no data". Would the `absent` function perhaps help in your case? https://prometheus.io/docs/prometheus/latest/querying/functions/#absent -- Björn Rabenstein [PGP-ID] 0x851C3DA17D748D03 [email] [email protected] -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/20210205130909.GO4007%40jahnn.

