-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Alerting UI] Use recorded start/duration/end times from event log for rule details page #101662
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
I was searching for this issue, couldn't find it, so created another one, which I'll close. But I added some additional detail, so copying that in here: The calculation of the "alert duration", we are doing today is expensive. The relevant code is in this module: kibana/x-pack/plugins/alerting/server/rules_client/rules_client.ts Lines 453 to 463 in 946e145
Basically, in previous releases, we didn't have the alert duration available directly in active-instance events, so we had to calculate it by finding the closest new-instance event. The date on the new-instance event becomes the kibana/x-pack/plugins/alerting/common/alert_instance_summary.ts Lines 28 to 34 in 946e145
There were problems with this approach anyway, as the query getting the event log docs may not have gone far enough back to find a relevant new-instance event. But the big win will be not having to return all the event log docs, to get the alert duration, we can just get the last active-instance event, which contains the duration. Another optimization we could make is to move the alert duration into the task manager state, shape here, since I think we already have to get the task manager state whenever we calculate the alert instance summary: kibana/x-pack/plugins/alerting/common/alert_instance.ts Lines 11 to 21 in 946e145
|
With this PR, we are persisting additional information to the event log about the start, duration and end time of each alert (instance). We should be able to simplify the calculations that are currently being performed to get the start time of active alerts (for duration calculation).
Note:
The text was updated successfully, but these errors were encountered: