-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Mirror ES status; set own status to red if user settings are not found #7454
Conversation
… available If user settings are requested but are not available in the Kibana index, turn the Kibana plugin red. If they are requested and available, turn the plugin green again, if necessary.
LGTM! |
Yellow is good in situations where the user doesn't need to take remedial actions to turn a plugin green. Red is good in situations where the user needs to do something to turn the plugin green.
Now that I'm looking at this PR, I think we can simplify things a bit further: Instead of mucking with the Kibana plugin status, we only need to turn the Elasticsearch plugin status yellow if the settings are not found. And we don't need to worry about turning it green again in this code; the Elasticsearch plugin's code will do that when it (re-)creates the Kibana index and the config doc within it. |
I think that'd be a mistake. If the query times out ES will be marked yellow and never again be marked green. |
Actually I believe the ES plugin regularly polls ES so it may eventually go green. |
function resetKibanaPluginStatusIfNecessary(user) { | ||
const isElasticsearchPluginGreen = server.plugins.elasticsearch.status.state === 'green'; | ||
const isKibanaPluginCurrentlyYellow = server.plugins.kibana.status.state === 'yellow'; | ||
if (isElasticsearchPluginGreen && isKibanaPluginCurrentlyYellow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if server.plugins.kibana.status.state === 'red'
? Does code somewhere else change it from red to yellow, and then this changes it yellow to green?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point Lee. I really think all we ought to do when user settings are not found is set the Elastiscearch plugin status to yellow, because ultimately that's the plugin responsible for (re)creating the .kibana
index and going green again when the index is ready. I think we shouldn't muck with the Kibana plugin status at all. Thoughts?
Your current code is working for me. And our tests are really suffering right now. So maybe we can go with what you have here now, and open another issue to reconsider it? Or revert whatever change put this in place until we have a better solution? |
@LeeDr Alright, lets try to get this PR in today. I'm going to do one more thing: I'm going to update this PR to do the simplification in #7454 (comment). If the tests continue to work well with that, lets use that. Otherwise I'll revert to the current state of this PR and we can use that. |
The Elasticsearch plugin is what is responsible for (re)creating the Kibana index. So it makes sense that if we couldn't find the user settings in that index, we set the Elasticsearch plugin to yellow. Once it recreates the Kibana index, it will set itself to green. No need to toggle the states of the Kibana plugin at all.
jenkins, test it |
I don't like how this is setting the status of the Kibana plugin, so I made #7459 so that this service could have it's own status. I implemented it in this pr and sent a pr to @ycombinator in ycombinator#1 Here is what the flow looks like with these changes: |
@spalger I completely agree that non-plugin code setting plugin status is hacky. Thanks for building a more generic notion of status's that could affect the overall server status! |
@spalger This is awesome |
If you merge master here the changed files will be a lot cleaner |
Merged master; had to force push. |
[ui/settings] go red when settings are not found, otherwise mimic es …
jenkins, test it |
LGTM |
|
||
function copyStatus() { | ||
const { state } = esStatus; | ||
status[state](state === 'green' ? 'Ready' : `Elasticsearch plugin is ${state}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this line should change into a proper conditional, or maybe just extract the ternary into a const
variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt wrong typing it
Just a minor nit but LGTM, you don't have to heed my comment. |
LGTM |
Thanks folks. Will merge as soon as build passes. |
Mirror ES status; set own status to red if user settings are not found Former-commit-id: 9714484
`v91.3.1`⏩`v92.0.0-backport.0` --- ## [`v92.0.0-backport.0`](https://github.com/elastic/eui/releases/v92.0.0-backport.0) **This is a backport release only intended for use by Kibana.** **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([#7454](elastic/eui#7454)) ## [`v92.0.0`](https://github.com/elastic/eui/releases/v92.0.0) - Updated generic types of `EuiBasicTable`, `EuiInMemoryTable` and `EuiSearchBar.Query.execute` to add `extends object` constraint ([#7340](elastic/eui#7340)) - This change should have no impact on your applications since the updated types only affect properties that exclusively accept object values. - Added a new `EuiFlyoutResizable` component ([#7439](elastic/eui#7439)) - Updated `EuiTextArea` to accept `isClearable` and `icon` as props ([#7449](elastic/eui#7449)) **Bug fixes** - `EuiRange`/`EuiDualRange`'s track ticks & highlights now update their positions on resize ([#7442](elastic/eui#7442)) **Deprecations** - Updated `EuiFilterButton` to remove the second `.euiFilterButton__textShift` span wrapper. Target `.euiFilterButton__text` instead ([#7444](elastic/eui#7444)) **Breaking changes** - Removed deprecated `EuiNotificationEvent`. We recommend copying the component to your application if necessary ([#7434](elastic/eui#7434)) - Removed deprecated `EuiControlBar`. We recommend using `EuiBottomBar` instead ([#7435](elastic/eui#7435))
`v91.3.1`⏩`v92.0.0-backport.0` --- ## [`v92.0.0-backport.0`](https://github.com/elastic/eui/releases/v92.0.0-backport.0) **This is a backport release only intended for use by Kibana.** **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([elastic#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([elastic#7454](elastic/eui#7454)) ## [`v92.0.0`](https://github.com/elastic/eui/releases/v92.0.0) - Updated generic types of `EuiBasicTable`, `EuiInMemoryTable` and `EuiSearchBar.Query.execute` to add `extends object` constraint ([elastic#7340](elastic/eui#7340)) - This change should have no impact on your applications since the updated types only affect properties that exclusively accept object values. - Added a new `EuiFlyoutResizable` component ([elastic#7439](elastic/eui#7439)) - Updated `EuiTextArea` to accept `isClearable` and `icon` as props ([elastic#7449](elastic/eui#7449)) **Bug fixes** - `EuiRange`/`EuiDualRange`'s track ticks & highlights now update their positions on resize ([elastic#7442](elastic/eui#7442)) **Deprecations** - Updated `EuiFilterButton` to remove the second `.euiFilterButton__textShift` span wrapper. Target `.euiFilterButton__text` instead ([elastic#7444](elastic/eui#7444)) **Breaking changes** - Removed deprecated `EuiNotificationEvent`. We recommend copying the component to your application if necessary ([elastic#7434](elastic/eui#7434)) - Removed deprecated `EuiControlBar`. We recommend using `EuiBottomBar` instead ([elastic#7435](elastic/eui#7435))
`v92.0.0-backport.0`⏩ `v92.1.1` --- ## [`v92.1.1`](https://github.com/elastic/eui/releases/v92.1.1) **Bug fixes** - Minor `EuiDataGrid` cell performance fixes ([#7465](elastic/eui#7465)) ## [`v92.1.0`](https://github.com/elastic/eui/releases/v92.1.0) - Updated `EuiResizableButton` to allow customizing the `indicator` style with either `handle` (default) or `border` ([#7455](elastic/eui#7455)) - Enhanced `EuiResizableContainer` to preserve the drag/resize event when the user's mouse leaves the parent container and re-enters ([#7456](elastic/eui#7456)) **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([#7454](elastic/eui#7454)) **Accessibility** - `EuiDataGrid`'s keyboard/screenreader experience has been tweaked to be more consistent for varying complex data: ([#7448](elastic/eui#7448)) - Headers are now always navigable by arrow key, regardless of whether the header cells contain interactive content - Non-expandable cells containing any amount of interactive content now must be entered via Enter or F2 keypress - Expandable cells continue to be toggled via Enter or F2 keypress - `EuiDataGrid` now provides a direct screen reader hint for Enter key behavior for expandable & interactive cells ([#7448](elastic/eui#7448))
`v92.0.0-backport.0`⏩ `v92.1.1` --- ## [`v92.1.1`](https://github.com/elastic/eui/releases/v92.1.1) **Bug fixes** - Minor `EuiDataGrid` cell performance fixes ([elastic#7465](elastic/eui#7465)) ## [`v92.1.0`](https://github.com/elastic/eui/releases/v92.1.0) - Updated `EuiResizableButton` to allow customizing the `indicator` style with either `handle` (default) or `border` ([elastic#7455](elastic/eui#7455)) - Enhanced `EuiResizableContainer` to preserve the drag/resize event when the user's mouse leaves the parent container and re-enters ([elastic#7456](elastic/eui#7456)) **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([elastic#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([elastic#7454](elastic/eui#7454)) **Accessibility** - `EuiDataGrid`'s keyboard/screenreader experience has been tweaked to be more consistent for varying complex data: ([elastic#7448](elastic/eui#7448)) - Headers are now always navigable by arrow key, regardless of whether the header cells contain interactive content - Non-expandable cells containing any amount of interactive content now must be entered via Enter or F2 keypress - Expandable cells continue to be toggled via Enter or F2 keypress - `EuiDataGrid` now provides a direct screen reader hint for Enter key behavior for expandable & interactive cells ([elastic#7448](elastic/eui#7448))
If user settings are requested but are not available in the Kibana index, turn the Elasticsearch plugin yellow. When the plugin automatically recreates the index, it will go green.
Fixes #7424