# How to generate alert only when metric is absent 5min ago

**URL:** <https://discuss.prometheus.io/t/how-to-generate-alert-only-when-metric-is-absent-5min-ago/1777>\
**Category:** PromQL\
**Created:** [July 27, 2023, 3:11pm UTC](https://discuss.prometheus.io/t/how-to-generate-alert-only-when-metric-is-absent-5min-ago/1777 "2023-07-27T15:11:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abi](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Abi](https://discuss.prometheus.io/u/Abi)\
**Post date:** [July 27, 2023, 3:11pm UTC](https://discuss.prometheus.io/t/how-to-generate-alert-only-when-metric-is-absent-5min-ago/1777/1 "2023-07-27T15:11:38Z")

</div>

A metric was present 5 mins ago  
Currently metric is not present  
I need to create an alert expression only when metric was present 5 mins ago and currently not present. After this alert is generated, When metric is absent for more than 5mins, alert need not generate again
