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

[Monitoring] Cluster state watch to Kibana alerting #61685

Merged
merged 11 commits into from
Apr 6, 2020

Conversation

chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Mar 27, 2020

Builds upon #54306
Relates to #42960

This PR migrates the next cluster alert, the cluster state one.

Most of the changes in the PR are due to the initial work not working that well for multiple alerts, so some refactoring was necessary.

In particular, the way in which we tell the client what to show in the alert in the UI changed. The original implementation didn't support what we needed to do with other alerts so that's been changed and hopefully makes sense. It's a bit of a "generic" approach and I am welcome to any better approaches here.

Testing

  • Set KIBANA_ALERTING_ENABLED to true in both legacy/plugins/monitoring/common/constants.js and plugins/monitoring/common/constants.ts
  • Navigate to the monitoring app and follow the instructions in the alerting callout at the top to enable Kibana alerting
  • If you do not see an alert in the UI yet, create an index using dev tools and go back to the monitoring UI and you should see one about replica shards.

Screenshots

Creation

Screen Shot 2020-03-30 at 2 30 32 PM

Screen Shot 2020-03-30 at 2 30 55 PM

Post creation

Screen Shot 2020-03-30 at 1 45 09 PM

TODO

  • This cluster alert has a link to the indices page with an action label that indicates you can do something about it. Should we change this since you can't really do anything on that page? cc @sorantis

@chrisronline chrisronline self-assigned this Mar 30, 2020
@chrisronline chrisronline added Feature:Stack Monitoring release_note:skip Skip the PR/issue when compiling release notes review Team:Monitoring Stack Monitoring team v7.8.0 v8.0.0 labels Mar 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/stack-monitoring (Team:Monitoring)

@chrisronline chrisronline marked this pull request as ready for review March 30, 2020 18:32
@chrisronline chrisronline requested a review from a team March 30, 2020 18:32
@chrisronline
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

}
}

if (alerts.total !== 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should this maybe be if (alerts.total > 1) {? Since it can still be a different falsy value

Copy link
Contributor

@igoristic igoristic left a comment

Choose a reason for hiding this comment

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

Looking pretty good 🥇

@chrisronline chrisronline merged commit ab0cc88 into elastic:master Apr 6, 2020
@chrisronline chrisronline deleted the monitoring/new_alert branch April 6, 2020 19:31
spalger added a commit that referenced this pull request Apr 7, 2020
@spalger
Copy link
Contributor

spalger commented Apr 7, 2020

The i18n tests started failing once this was merged, so I've reverted it for now: https://kibana-ci.elastic.co/job/elastic+kibana+master/4238/execution/node/148/log/

13:54:13  [20:54:12] Validating Default Messages [completed]
13:54:13  [20:54:12] Compatibility Checks [started]
13:54:13  [20:54:12] Compatibility check with x-pack/plugins/translations/translations/zh-CN.json [started]
13:54:13  [20:54:13] Compatibility check with x-pack/plugins/translations/translations/zh-CN.json [failed]
13:54:13  [20:54:13] → 
13:54:13  Incompatible translation: "values" object contains unused properties ("xpack.monitoring.alerts.licenseExpiration.ui.firingMessage"): [linkText].
13:54:13  
13:54:13  [20:54:13] Compatibility Checks [failed]
13:54:13  [20:54:13] → 
13:54:13  Incompatible translation: "values" object contains unused properties ("xpack.monitoring.alerts.licenseExpiration.ui.firingMessage"): [linkText].
13:54:13  
13:54:13  ERROR Unhandled exception!
13:54:13  ERROR Error: 
13:54:13        Incompatible translation: "values" object contains unused properties ("xpack.monitoring.alerts.licenseExpiration.ui.firingMessage"): [linkText].
13:54:13  
13:54:13            at createFailError (/var/lib/jenkins/workspace/elastic+kibana+master/kibana/packages/kbn-dev-utils/target/run/fail.js:25:26)
13:54:13            at verifyMessages (/var/lib/jenkins/workspace/elastic+kibana+master/kibana/src/dev/i18n/integrate_locale_files.ts:109:11)
13:54:13            at integrateLocaleFiles (/var/lib/jenkins/workspace/elastic+kibana+master/kibana/src/dev/i18n/integrate_locale_files.ts:191:3)
13:54:13  Warning: non-zero exit code 1� Use --force to continue.
13:54:13  

gmmorris added a commit to gmmorris/kibana that referenced this pull request Apr 7, 2020
* master: (36 commits)
  [data.search.aggs] Remove service getters from agg types (elastic#61628)
  fixing APM internationalization (elastic#62757)
  fix: 🐛 correctly create error on no_matching_indices (elastic#61257)
  [Lens] Remove all legacy imports (elastic#62596)
  Add label for ace editor (elastic#62588)
  [ML] Show better file structure finder explanations (elastic#62316)
  Fix old pathes in eslintrc (elastic#62580)
  [Uptime] Improve Telemetry test (elastic#62428)
  [SIEM] Adds sort rules Cypress test (elastic#62700)
  [Uptime]Abstracted 'access:uptime-read' tag into a wrapper for… (elastic#62576)
  fixing bug (elastic#62577)
  [Maps] Allow updating requestType for ESGeoGridSource (elastic#62365)
  [Maps] do not show circle border when symbol size is zero (elastic#62644)
  [Maps] Always show current zoom level (elastic#62684)
  bc5 siem rules merge (elastic#62679)
  Revert "[Monitoring] Cluster state watch to Kibana alerting (elastic#61685)"
  Fix visual tests (elastic#62660)
  [Telemetry] update crypto packages (elastic#62469)
  [DOCS] Removed references to left (elastic#60807)
  [Maps] Move layers to np maps (elastic#61877)
  ...
chrisronline added a commit that referenced this pull request Apr 7, 2020
…ng (#62793)

* Revert "Revert "[Monitoring] Cluster state watch to Kibana alerting (#61685)""

This reverts commit f1bd3bd.

* Fix i18n error

* Fix test
chrisronline added a commit to chrisronline/kibana that referenced this pull request Apr 7, 2020
…ng (elastic#62793)

* Revert "Revert "[Monitoring] Cluster state watch to Kibana alerting (elastic#61685)""

This reverts commit f1bd3bd.

* Fix i18n error

* Fix test
chrisronline added a commit that referenced this pull request Apr 7, 2020
…ng (#62793) (#62838)

* Revert "Revert "[Monitoring] Cluster state watch to Kibana alerting (#61685)""

This reverts commit f1bd3bd.

* Fix i18n error

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants