On 23/01/2021 10:55, akshay sharma wrote:
Thanks for your reply.

Actually the issue which are facing is ,
Let the exporter expose metric at every 15minutes, and let the Prometheus to scrape data every 2mintues.

But suppose at t1, Prometheus scrapes data and gets the metrics with some value say x(metric) and y(value).

I've a alert rule if metric >= y, alerts should be raised.

Now alert is raised as conditions is true, now Prometheus again scrapes data at t3 but now metrics is not available ..he gets nothing .  Then when again alert rules evaluates it is getting no data . But why alert is getting resolved??? Because there is no value how the condition is true? ? Metric >=y ,will never be true in case of no data right.? Is need to understand this scenario.

Because at time=t3 as far as Prometheus is concerned the metric no longer exists. The way alerts work is that the expression is evaluated, and if there is a resulting set of metrics (could be many due to different label combinations) alerts are created. With your query the metric no longer exists, so the metric >= y will not return anything, hence any pre-existing alert will be resolved.

The correct solution is to ensure the metric continues to exist, so scraping at least every 2 minutes and ensuring the exporter always returns data.

--
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/5f83c290-c876-d16e-1074-3092812a536a%40Jahingo.com.

Reply via email to