-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Show execution duration on Rule Details view #114719
[Alerting] Show execution duration on Rule Details view #114719
Conversation
…ing/show-durations-rule-details
…ing/show-durations-rule-details
…ing/show-durations-rule-details
…ing/show-durations-rule-details
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
@@ -37,6 +66,8 @@ type AlertInstancesProps = { | |||
durationEpoch?: number; | |||
} & Pick<AlertApis, 'muteAlertInstance' | 'unmuteAlertInstance'>; | |||
|
|||
const DESIRED_NUM_EXECUTION_DURATIONS = 30; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are piggybacking on the existing event log query to retrieve the execution duration information. The existing query looks back 60*schedule interval, so due to scheduling drift, we actually get 50-ish to 60 executions. In order to maintain a more consistent chart experience, we're truncating to 30. In the future, we can think about performing a separate query specifically for execution durations (and using aggregations for the avg) and when we do that, we would be able to specify exactly the number of executions to show.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened this issue separate out the query for execution durations in the future, which would allow us to show a dropdown for users to select the number they want to see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some feedback on title sizes and flexbox widths. Happy to chat about these if i'm not clear on my comments—hopefully put them in the right spot :)
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Show resolved
Hide resolved
<EuiHealth | ||
data-test-subj={`ruleStatus-${alert.executionStatus.status}`} | ||
textSize="inherit" | ||
color={healthColor} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like in the screenshot that the 'health' color doesn't match what is shown in the table. (Looks like primary
in the table and healthy
here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This health color relates to the rule execution and the color in the table relates to whether the alert for the rule is active or recovered. They are two different things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is confusing that they both say active and they are different colors.....but this color lines up with the color on the Rule Management List view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
@mdefazio Updated and updated the screenshots as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One small nit but great work here!
x-pack/plugins/triggers_actions_ui/public/application/lib/execution_duration_utils.ts
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/lib/execution_duration_utils.ts
Outdated
Show resolved
Hide resolved
...triggers_actions_ui/public/application/sections/alert_details/components/alert_instances.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these last minute edits!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think it would be useful to expose the charts functionality as a separate (maybe reusable) component, but this could be done in the follow up issue. Don't want to block you with this suggestion.
…ing/show-durations-rule-details
x-pack/plugins/triggers_actions_ui/public/application/lib/execution_duration_utils.ts
Outdated
Show resolved
Hide resolved
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @ymao1 |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* Adding execution duration to get alert instance summary * Showing execution duration on rule details view * Fixing unit tests * Updating to match new mockup * Fixing types * Fixing functional test * Removing unneeded max and min and adding tests * Removing unneeded max and min and adding tests * Fixing functional test * Adding left axis * PR feedback * Reducing chart height * PR feedback * PR feedback * PR feedback
…15092) * Adding execution duration to get alert instance summary * Showing execution duration on rule details view * Fixing unit tests * Updating to match new mockup * Fixing types * Fixing functional test * Removing unneeded max and min and adding tests * Removing unneeded max and min and adding tests * Fixing functional test * Adding left axis * PR feedback * Reducing chart height * PR feedback * PR feedback * PR feedback Co-authored-by: ymao1 <ying.mao@elastic.co>
* Adding execution duration to get alert instance summary * Showing execution duration on rule details view * Fixing unit tests * Updating to match new mockup * Fixing types * Fixing functional test * Removing unneeded max and min and adding tests * Removing unneeded max and min and adding tests * Fixing functional test * Adding left axis * PR feedback * Reducing chart height * PR feedback * PR feedback * PR feedback
Resolves #114616
Summary
Added summary of execution durations to Rule Details view, with warning when the average execution duration exceeds the rule timeout
Rule with
status: active
and 30 most recent execution durations with averageRule where last execution ended in
error
Rule where no execution data is available yet
Rule where average execution duration exceeds rule timeout
Rule where execution duration suddenly spikes
Checklist
Delete any items that are not applicable to this PR.