# How Alerts & Actions handles query delay in ML jobs alerts? v7.12

**URL:** <https://discuss.elastic.co/t/how-alerts-actions-handles-query-delay-in-ml-jobs-alerts-v7-12/273067>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [May 14, 2021, 10:16pm UTC](https://discuss.elastic.co/t/how-alerts-actions-handles-query-delay-in-ml-jobs-alerts-v7-12/273067 "2021-05-14T22:16:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [May 14, 2021, 10:16pm UTC](https://discuss.elastic.co/t/how-alerts-actions-handles-query-delay-in-ml-jobs-alerts-v7-12/273067/1 "2021-05-14T22:16:58Z")

</div>

Im having some problems with Alerts & Actions, usually when I create an alert it works the first time it found an anomlay but then I stop getting alerts, so I was wondering how Alerts & Actions handles query delay in ML jobs alerts

---

<div class="post-metadata">

**Author:** ![darnautov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darnautov/32/70608_2.png) [@darnautov](https://discuss.elastic.co/u/darnautov)\
**Post date:** [May 17, 2021, 9:50am UTC](https://discuss.elastic.co/t/how-alerts-actions-handles-query-delay-in-ml-jobs-alerts-v7-12/273067/2 "2021-05-17T09:50:45Z")

</div>

Hi @ElasticLiver,

In `7.12` the lookback interval for executing alert condition is the job's bucket span doubled. This results in missing alerts for datafeeds with a fairly long query delay (probably what you're experiencing with your configuration).  
For the upcoming release (`7.13`) we [improved the logic of the lookback interval](https://github.com/elastic/kibana/pull/97370) so it takes query delay into account by default, and also allow to set it to any custom interval if needed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 14, 2021, 9:51am UTC](https://discuss.elastic.co/t/how-alerts-actions-handles-query-delay-in-ml-jobs-alerts-v7-12/273067/3 "2021-06-14T09:51:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
