Hey there, i've been experimenting with log threshold type of rules recently and i've encountered some strange behaviors. Elastic version is 8.6.2
given a log threshold rule with action connector of some index.
When disabling i would expect that a 'resolve' event would be sent to the connector for each active alert that lived while the rule was enabled. Isn't it the case?
When enabling the rule, actions are being triggered and events are written to the index, everything is working fine, but when i disable and then re-enable the alert become active again but it has no start date and duration in the kibana ui -
and while this happens no actions are triggered, meaning no new events for my index. i let the rule run for couple of iterations and still no actions triggered. if i delete the rule and re-create it , its solves the issue.
When disabling i would expect that a 'resolve' event would be sent to the connector for each active alert that lived while the rule was enabled. Isn't it the case?
Disabling the rule, will not allow the rule to rerun and check the status of the alerts, whether they are Active/Recovered. So the alerts stay at their last state and no event is sent via connectors.
When enabling the rule, actions are being triggered and events are written to the index, everything is working fine, but when i disable and then re-enable the alert become active again but it has no start date and duration in the kibana ui -
The screenshot you posted is not very clear to know from which page it has been taken, but I aussme it's from the Stack Mangement > Rules page.
For Observability rule types, I would suggest using the Alerts pages under Observability.
Hey thanks for the reply,
basically what i don't understand is why after re-enabling the rule and the condition is satisfied, nothing is written to my index connector
There is a known issue regarding Start time and Duration being empty in the UI in the Stack Management > Rules > Rule Name > Alerts.
The reason nothing is being written to index connector is that the alert is technically still active in your case even though it shows "recovered" in UI when you disable the rule. When the rule is enabled again, the same alert's status is changed to "active". It is not a new alert. Only if the status of the alert actually changed to "recovered" in the meantime (below threshold), it will be written to the index connector as per rule configuration (Notify = On status changes). You could change "Notify" option to "On check intervals" to receive notification to the index connector at every check regardless of the status (this will result in more number of notifications).
I would recommend to use Observability > Alerts to view correct start/duration of the alerts. The status of the alert remains as is (Active/Recovered) when the rule is disabled which is more accurate indication as the rule is no longer running to check the status.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.