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] Configurable number of hits for ES query alert #90089

Merged
merged 11 commits into from
Feb 9, 2021

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Feb 2, 2021

Resolves #89561

Summary

Added size as a parameter of the ES query alert, with a default of 100

Screen Shot 2021-02-02 at 4 04 05 PM

Checklist

Delete any items that are not applicable to this PR.

  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)
  • Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)

@ymao1 ymao1 self-assigned this Feb 2, 2021
@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.12.0 v8.0.0 labels Feb 3, 2021
@ymao1 ymao1 marked this pull request as ready for review February 3, 2021 17:54
@ymao1 ymao1 requested a review from a team as a code owner February 3, 2021 17:54
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

})
);
}
if ((size && size < 0) || size > 10000) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried putting the ES_QUERY_MAX_HITS_PER_EXECUTION const into common and using it inside this validation function but I got an optimizer error related to joi.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is caused by a config.ts file that shouldn't be in common (https://github.com/elastic/kibana/blob/master/x-pack/plugins/stack_alerts/common/config.ts). If that file gets moved to the server-side, it could work.

@ymao1 ymao1 requested a review from gchaps February 3, 2021 18:17
Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Documentation and UI copy LGTM.

Copy link
Contributor

@YulNaumenko YulNaumenko 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 Feb 8, 2021

@elasticmachine merge upstream

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! 👍

})
);
}
if ((size && size < 0) || size > 10000) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is caused by a config.ts file that shouldn't be in common (https://github.com/elastic/kibana/blob/master/x-pack/plugins/stack_alerts/common/config.ts). If that file gets moved to the server-side, it could work.

@ymao1
Copy link
Contributor Author

ymao1 commented Feb 9, 2021

@elasticmachine merge upstream

@ymao1
Copy link
Contributor Author

ymao1 commented Feb 9, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 336 337 +1

Async chunks

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

id before after diff
stackAlerts 682.2KB 682.7KB +531.0B

Page load bundle

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

id before after diff
stackAlerts 18.7KB 19.2KB +463.0B
triggersActionsUi 145.2KB 147.3KB +2.1KB
total +2.6KB

History

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

@ymao1 ymao1 merged commit 5f8de69 into elastic:master Feb 9, 2021
ymao1 added a commit to ymao1/kibana that referenced this pull request Feb 9, 2021
)

* Adding size parameter to ES query alert

* Can't use const inside validation

* Updating docs

* Fixing functional test

* License

Co-authored-by: Kibana Machine <[email protected]>
ymao1 added a commit that referenced this pull request Feb 9, 2021
…90830)

* Adding size parameter to ES query alert

* Can't use const inside validation

* Updating docs

* Fixing functional test

* License

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
@ymao1 ymao1 deleted the alerting/search-alert-configurable-hits branch March 25, 2021 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] Make DEFAULT_MAX_HITS_PER_EXECUTION in ES query alert configurable
6 participants