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

[Alerting] Warn by default when rule schedule interval is set below the minimum configured. #127498

Merged
merged 24 commits into from
Mar 21, 2022

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Mar 10, 2022

Resolves #126946

Summary

Updates minimum schedule interval configuration in the following ways:

  • Moves config underneath xpack.alerting.rules config keys
  • Adds enforce value to specify whether we are enforcing the minimum or not. Defaults to false.
  • When enforce = true, behavior is same as described in this PR where existing rules run untouched but rules cannot be created or updated with an interval below the configured minimum.

When enforce = false:

  • The UI shows this helper text if user selects minimum below the configured.

Screen Shot 2022-03-14 at 11 52 35 AM

  • Rule update and creation with interval below the minimum are allows but this warning is logged:

Screen Shot 2022-03-14 at 11 52 59 AM

Checklist

@ymao1 ymao1 changed the title Alerting/minimum rule interval warn [Alerting] Warn by default when rule schedule interval is set below the minimum configured. Mar 14, 2022
@ymao1 ymao1 self-assigned this Mar 14, 2022
@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Feature:Alerting/RulesManagement Issues related to the Rules Management UX v8.2.0 labels Mar 14, 2022
@ymao1 ymao1 marked this pull request as ready for review March 14, 2022 16:27
@ymao1 ymao1 requested review from a team as code owners March 14, 2022 16:27
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

Docker config change LGTM

@ymao1 ymao1 requested review from lcawl and a team March 14, 2022 16:28
@ymao1
Copy link
Contributor Author

ymao1 commented Mar 14, 2022

@lcawl Can you review the wording of the helper text and server log warning as show in the screenshots?

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Changes LGTM! Tested locally and saw the warnings 👍

})}
/>
</>
);

const getHelpTextForInterval = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I notice if I increase xpack.alerting.rules.minimumScheduleInterval.value to a value higher than 1m and open the create rule flyout, the interval of 1m is set by default and the warning displays. If this isn't desired behaviour, should we change it so the default rule interval equals minimumScheduleInterval.value when configured to a value higher than 1m?

Screen Shot 2022-03-16 at 3 16 46 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good catch @mikecote! Updated in this commit to set the default schedule interval to match the minimum configured if the minimum is greater.

That commit should also fix this bug: #122707

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, thank you!

That commit should also fix this bug: #122707

I wasn't able to confirm this, I set defaultScheduleInterval with a few varying configurations.

Copy link
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

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

code-wise LGTM, but due to an ssl issue, couldn't verify it by running the PR locally.
edit: I was able to run it locally. works as expected.

Screenshot 2022-03-17 at 15 47 50

@lcawl lcawl added the ui-copy Review of UI copy with docs team is recommended label Mar 16, 2022
Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

Minor suggestions, otherwise text LGTM

Copy link
Contributor

@klacabane klacabane left a comment

Choose a reason for hiding this comment

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

LGTM

@ymao1
Copy link
Contributor Author

ymao1 commented Mar 21, 2022

@elasticmachine merge upstream

@ymao1 ymao1 enabled auto-merge (squash) March 21, 2022 20:08
@ymao1 ymao1 disabled auto-merge March 21, 2022 20:57
@ymao1
Copy link
Contributor Author

ymao1 commented Mar 21, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 334 335 +1

Async chunks

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

id before after diff
triggersActionsUi 662.2KB 663.2KB +1.1KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
alerting 20 21 +1

Page load bundle

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

id before after diff
triggersActionsUi 96.5KB 96.6KB +54.0B

History

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

cc @ymao1

@ymao1 ymao1 merged commit 0b1425b into elastic:main Mar 21, 2022
@ymao1 ymao1 deleted the alerting/minimum_rule_interval_warn branch March 21, 2022 22:55
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 Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) ui-copy Review of UI copy with docs team is recommended v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn by default when rules created below the minimum rule interval
10 participants