-
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
[RAC] Add indicator about enabled / disabled rules on the alerts page #116476
Comments
Some work is needed to determine if the data needed can be queried for (i.e. do the APIs exist?) |
I'll work on creating a separate issue so that these Stats can link to the Rules page with a relevant filter applied |
Refining Questions:
|
@jasonrhodes Observability rule types are registered like this https://github.com/elastic/kibana/blob/main/x-pack/plugins/infra/public/plugin.ts#L37. We could keep track of the observability rule types while registering them and have a list method that returns them back if that's what we want mgiota@6dd0d25#diff-ed7415e46fe4dd47e01009081b6d385fd629bb6dee329826a3c8ae215e56f2eeR35. Would this help? |
Are we able to use the Alerting APIs here? We can GET rule by ID or FIND rules.
You should be able to tell in the response body if the rule is disabled or muted or if certain alerts for the rule are muted.
The find API takes filters so you can filter by rule type id (still named |
@ymao1 In the get rule by id api link you posted there are two urls
Is any of these a legacy url that we shouldn't use? |
No, both of those are current routes. If you are using them in the client using the kibana http library, I believe it will inject the space id if you're calling it from a custom space. Here is how we use it for the Rule Management UI: https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.ts. We don't add any special handling to determine if we're in the default or custom space. |
Thank you so much, @ymao1! |
@hbharding / @vinaychandrasekhar, refining questions left for you:
|
Yes, in that state currently, and yes on it being "rule summary"
Rules that are currently erroring. @hbharding if you have a different opinion, please chime in. |
@ymao1 a few follow up questions re: the API if you don't mind: Here is the response for a single rule in either of the API calls you mention above: {
"id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35",
"notify_when": "onActionGroupChange",
"params": {
"aggType": "avg",
},
"consumer": "alerts",
"rule_type_id": "test.rule.type",
"schedule": {
"interval": "1m"
},
"actions": [],
"tags": [],
"name": "test rule",
"enabled": true,
"throttle": null,
"api_key_owner": "elastic",
"created_by": "elastic",
"updated_by": "elastic",
"mute_all": false,
"muted_alert_ids": [],
"updated_at": "2021-02-10T05:37:19.086Z",
"created_at": "2021-02-10T05:37:19.086Z",
"scheduled_task_id": "0b092d90-6b62-11eb-9e0d-85d233e3ee35",
"execution_status": {
"last_execution_date": "2021-02-10T17:55:14.262Z",
"status": "ok"
}
} Here are my assumptions, please confirm/deny :)
Last, do you think the Alerting Framework would be ok with us poking around and possibly suggesting some kind of |
This is correct!
Yes, this should have the same shape. Here is the definition: kibana/x-pack/plugins/alerting/common/alert.ts Lines 36 to 44 in f51f30e
where status can be one of ok | active | error | pending | unknown
Absolutely! It doesn't look like we have an issue for it yet but the saved objects client has added support for aggregations, which the rules client could take advantage of by allowing an additional field in the find API to specify what to aggregate on. Feel free to make an issue and we will triage (or if you have the bandwidth to tackle it, even better :)) |
Yeah I think we could tackle it. We'll create an issue to get more firm feedback and then go from there. Thanks! |
Ticket for a new endpoint created! We'll move forward using the existing find API for now. |
Thanks for the precious pointers! I made some progress on the implementation reusing the kibana/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts Lines 21 to 33 in f2b9acf
Now I have a question for @hbharding and @vinaychandrasekhar : should the counters reflect the current query? I'd imagine at a minimum you'd want them to be sensitive to |
@claudiopro per discussion in the weekly AO call with Katrin and Henry, we'd like to have the numbers reflect the total rules, and should not consider the current filters. Thanks for the question! |
Separately, @claudiopro a question for you - in the screenshot above, the disabled and muted counts show negative numbers. Is that by intent? cc @hbharding |
I suspect it's a bug or an in progress screenshot :). Let's make sure that if no Disabled / Muted rules are found, the number should say |
@vinaychandrasekhar @hbharding correct, it's a placeholder to make sure I don't forget to wire the UI with the API request for disabled and muted rules, currently missing (to be implemented with #119852) |
Summary
When users are on the alerts page, they have no way of knowing if any of their rules are disabled, muted, or have errors. Knowing this information could be helpful in certain situations.
Solution
Add a text indicator like we do on other RAC pages in the right area of the page header. See screenshots below for details.
We can use
EuiStat size="xs"
which comes with a convenientisLoading
prop.AC
read
info about Rules (i.e. if the API call to the rules fails)Open Questions
Related
The text was updated successfully, but these errors were encountered: