Skip to content
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

[RAM] Makes anomaly detection rule visible in Observability #170451

Merged
merged 19 commits into from
Dec 21, 2023

Conversation

XavierM
Copy link
Contributor

@XavierM XavierM commented Nov 2, 2023

Summary

From the rule management page in observability, user will be able to create an anomaly detection rule.

image image

@XavierM XavierM added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.0 labels Nov 2, 2023
@XavierM XavierM marked this pull request as ready for review December 4, 2023 22:37
@XavierM XavierM requested review from a team as code owners December 4, 2023 22:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@JiaweiWu JiaweiWu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triggers actions UI changes LGTM

@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Dec 4, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@darnautov
Copy link
Contributor

FYI the PR to set anomaly description as an alert message

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon we should rename the const for consistency. The rest LGTM!

Copy link
Contributor

@marshallmain marshallmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D&R changes LGTM

@XavierM XavierM added v8.13.0 and removed v8.12.0 labels Dec 6, 2023
@XavierM XavierM added the release_note:skip Skip the PR/issue when compiling release notes label Dec 6, 2023
Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The name of the new rule is Anomaly detection alert which does not match the rest of the rules, can we remove the alert keyword from this rule name? (Or was this name suggested by the PMs?)

  2. In case of not having an ML job, there is no option to create one from the flyout:

    Is there a feature to add this option? (I assume not related to this PR just noticed it here)

  3. Also, in case of having basic license, SLO rule is shown in disabled mode but the ML Anomaly one is not shown at all, is this expected?

The license error and the link to fix it is amaing 😍

image

return [ES_QUERY_ID, ...observabilityRuleTypeRegistry.list()];
return [
ES_QUERY_ID,
ML_ANOMALY_DETECTION_RULE_TYPE_ID,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinaychandrasekhar @katrin-freihofner Currently, the Anomaly rule is the second item in the rules list, since it is Beta, should we move it to the end of the list? (Also, in case of no ML job, the flyout does not have an option to send the user to create one.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI It's not in Beta anymore :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this with Vinay, and the current order is good.

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darnautov
Copy link
Contributor

darnautov commented Dec 18, 2023

thanks for the feedback @maryam-saeidi!

The name of the new rule is Anomaly detection alert which does not match the rest of the rules, can we remove the alert keyword from this rule name? (Or was this name suggested by the PMs?)

I recall we called it like this to avoid confusion with the Anomaly detection as a feature itself. I don't have any objections to renaming it for consistency with the other rule types. @peteharverson wdyt?

In case of not having an ML job, there is no option to create one from the flyout:
Is there a feature to add this option? (I assume not related to this PR just noticed it here)

Good point, created an issue for that #173654 , aiming to deliver in 8.13.

Also, in case of having basic license, SLO rule is shown in disabled mode but the ML Anomaly one is not shown at all, is this expected?

If you browse the Anomaly detection rule in the Rules management UI, it is disabled in a similar fashion as the SLO rule you mentioned. @XavierM can you please check if any additional config is needed here?

@peteharverson
Copy link
Contributor

The name of the new rule is Anomaly detection alert which does not match the rest of the rules, can we remove the alert keyword from this rule name? (Or was this name suggested by the PMs?)

Agree that for consistency we can remove alert from the rule name here. The description makes it clear that the rule is alerting on jobs.

@XavierM XavierM changed the title [RAM] add ML anomaly in 011y [RAM] Makes anomaly detection rule visible in Observability Dec 18, 2023
@XavierM
Copy link
Contributor Author

XavierM commented Dec 18, 2023

@darnautov and @peteharverson
FYI -> I also found this bug during testing #173573

@XavierM
Copy link
Contributor Author

XavierM commented Dec 18, 2023

If you browse the Anomaly detection rule in the Rules management UI, it is disabled in a similar fashion as the SLO rule you mentioned. @XavierM can you please check if any additional config is needed here?

@darnautov I just checked it and I do not see the same thing that you are seeing?

With the license ->
image

With NO license ->
image

I think the problem is here -> https://github.com/elastic/kibana/blob/main/x-pack/plugins/ml/public/plugin.ts#L207 because if you do not have a full license, you are not registering the anomaly detection rule. So that's why it is not showing up!

@darnautov
Copy link
Contributor

The name of the new rule is Anomaly detection alert which does not match the rest of the rules, can we remove the alert keyword from this rule name? (Or was this name suggested by the PMs?)

Agree that for consistency we can remove alert from the rule name here. The description makes it clear that the rule is alerting on jobs.

FYI It's been renamed in #173545, cc @maryam-saeidi @XavierM

@darnautov
Copy link
Contributor

If you browse the Anomaly detection rule in the Rules management UI, it is disabled in a similar fashion as the SLO rule you mentioned. @XavierM can you please check if any additional config is needed here?

@darnautov I just checked it and I do not see the same thing that you are seeing?

With the license -> image

With NO license -> image

I think the problem is here -> https://github.com/elastic/kibana/blob/main/x-pack/plugins/ml/public/plugin.ts#L207 because if you do not have a full license, you are not registering the anomaly detection rule. So that's why it is not showing up!

@XavierM tested and realised we added some unnecessary guards for registering ML alerting rules. I created a PR to address it #173644. When it's merged the Anomaly detection rule type should be visible with the basic license as well, but the entry in the list is disabled.

@darnautov
Copy link
Contributor

I can set a role visibility during the rule creation but it's not visible on edit. Is it expected behaviour?

image

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/rule-data-utils 116 117 +1
ml 64 65 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 3.6MB 3.6MB +4.0B
observability 587.1KB 587.2KB +39.0B
triggersActionsUi 1.4MB 1.4MB +9.0B
total +52.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 78.0KB 78.1KB +62.0B
triggersActionsUi 104.2KB 104.2KB +75.0B
total +137.0B
Unknown metric groups

API count

id before after diff
@kbn/rule-data-utils 119 120 +1
ml 150 151 +1
total +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants