-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[RAM] Add aggs to know how many rules are snoozed #128212
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
Changes from all commits
8fc1c35
7abbdd1
b057fe8
06b2122
f3adfad
8524287
e3c9ec2
e36c023
8a5da42
a81b1e4
4842cde
ea004cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ interface RuleStatsState { | |
| disabled: number; | ||
| muted: number; | ||
| error: number; | ||
| snoozed: number; | ||
| } | ||
|
|
||
| export interface TopAlert { | ||
|
|
@@ -90,6 +91,7 @@ function AlertsPage() { | |
| disabled: 0, | ||
| muted: 0, | ||
| error: 0, | ||
| snoozed: 0, | ||
| }); | ||
|
|
||
| useEffect(() => { | ||
|
|
@@ -111,18 +113,21 @@ function AlertsPage() { | |
| const response = await loadRuleAggregations({ | ||
| http, | ||
| }); | ||
| const { ruleExecutionStatus, ruleMutedStatus, ruleEnabledStatus } = response; | ||
| if (ruleExecutionStatus && ruleMutedStatus && ruleEnabledStatus) { | ||
| const { ruleExecutionStatus, ruleMutedStatus, ruleEnabledStatus, ruleSnoozedStatus } = | ||
| response; | ||
| if (ruleExecutionStatus && ruleMutedStatus && ruleEnabledStatus && ruleSnoozedStatus) { | ||
| const total = Object.values(ruleExecutionStatus).reduce((acc, value) => acc + value, 0); | ||
| const { disabled } = ruleEnabledStatus; | ||
| const { muted } = ruleMutedStatus; | ||
| const { error } = ruleExecutionStatus; | ||
| const { snoozed } = ruleSnoozedStatus; | ||
| setRuleStats({ | ||
| ...ruleStats, | ||
| total, | ||
| disabled, | ||
| muted, | ||
| error, | ||
| snoozed, | ||
| }); | ||
| } | ||
| setRuleStatsLoading(false); | ||
|
|
@@ -263,9 +268,9 @@ function AlertsPage() { | |
| data-test-subj="statDisabled" | ||
| />, | ||
| <EuiStat | ||
| title={ruleStats.muted} | ||
| title={ruleStats.muted + ruleStats.snoozed} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @XavierM I would like to see this PR merged #128108 where we implemented the snoozed status (and update the muteAll field) and do a bit of manual testing to see if these numbers work well. I am just writing the scenarios I would like to test once both PRs are merged:
Scenario 2
|
||
| description={i18n.translate('xpack.observability.alerts.ruleStats.muted', { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @XavierM Shall we make it explicit in the name that it contains muted and snoozed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't mind keeping it as it is either.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's keep it like that for now because this is going to change again in the next release meaning muted will become deprecated sooner than later. |
||
| defaultMessage: 'Muted', | ||
| defaultMessage: 'Snoozed', | ||
| })} | ||
| color="primary" | ||
| titleSize="xs" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.