-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Fix Watcher stuck firing state #138563
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
Fix Watcher stuck firing state #138563
Conversation
71e7b85 to
87d2208
Compare
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 just renamed this file to align with the exported function name and reduced the function's params.
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 changed this name to remove all references to "firing".
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 removed these properties because it didn't look like they were being used anywhere.
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.
This fixed a React error that surfaced when executing the Jest tests.
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.
This change means that we no longer needed the tests about the relationship between isAckable and state, above, because there is no longer any relationship.
… with ACTIVE. Update ACTION_STATES by replacing FIRING with OK. - Refactor isAckable logic to directly translate value provided by ES. - Replace WatchStatus component with ActionStateBadge and WatchStateBadge components.
…'Last triggered' column to 'Last checked'. - Add tooltips to both. - Add tooltips to State and Comment headers.
…y. Remove unused properties from client WatchStatus model.
… Execution History Panel.
…cuted header to Action Statuses Panel and tooltips. Update tests.
87d2208 to
72e7bc6
Compare
|
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
alisonelizabeth
left a comment
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.
Nice work @cjcenizal! So awesome to see this addressed 🎉
Everything worked as expected. I think I tested all the different states, except error (I wasn't sure the best way to trigger an error).
Two questions -
- Do you think it would be helpful to surface whether there is an action that is "ackable" in the "Comments" column of the watch list table? It seems like it could be and is supplemental to the existing throttled/acknowledged comments.
- Were you planning on updating the Watcher docs? Let me know if you need help here.
|
|
||
| interface Props { | ||
| state: string; | ||
| size?: 'xs' | 's' | 'm'; |
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.
Can you use EuiTextProps['size']?
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.
Nice! Will do.
| } | ||
|
|
||
| const stateToIconMap = { | ||
| [WATCH_STATES.ACTIVE]: <EuiIcon type="check" color="success" />, |
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.
Great idea, will do.
gchaps
left a comment
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.
Tooltip text should end with a period.
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchList.watchTable.lastFiredHeader.tooltipText', | ||
| { | ||
| defaultMessage: `The most recent time this watch's condition was met and its actions were executed`, |
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 know its repetitive, but IMO "last time" is easier to understand than "most recent time"
The last time the condition was met and action taken.
| 'xpack.watcher.sections.watchList.watchTable.commentHeader.tooltipText', | ||
| { | ||
| defaultMessage: | ||
| 'Information about whether the watch is throttled, acknowledged, or has failed to execute', |
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.
Is it the watch that is throttled, or is it the action?
Whether the watch was acknowledged, throttled, or failed to execute.
or something like:
The state of the watch--throttled, acknowledged, or failed to execute.
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.
Good question -- it's whether any of the watch's actions have been acknowledged, throttled, or failed to execute. So how about:
Whether any actions have been acknowledged, throttled, or failed to execute.
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 suggest removing "any". On second look, can this be:
Whether actions are acknowledged, throttled, or failed.
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchDetail.watchTable.stateHeader.tooltipText', | ||
| { | ||
| defaultMessage: 'OK, acked, throttled, or error 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.
| defaultMessage: 'OK, acked, throttled, or error state', | |
| defaultMessage: 'OK, acknowledged, throttled, or error', |
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchHistory.watchActionStatusTable.lastExecuted.tooltipText', | ||
| { | ||
| defaultMessage: `When this action was last executed`, |
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.
| defaultMessage: `When this action was last executed`, | |
| defaultMessage: `The last time this action was executed`, |
*executed could also be "taken"
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchHistory.watchTable.metConditionHeader.tooltipText', | ||
| { | ||
| defaultMessage: `Whether the watch's condition was met and its actions were executed`, |
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.
Whether the condition was met and action taken.
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchList.watchTable.stateHeader.tooltipText', | ||
| { | ||
| defaultMessage: 'Active, inactive, or error 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.
Since the title of the column in state, can you remove "state" from the tooltip?
Active, inactive, or error
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchList.watchTable.lastTriggeredHeader.tooltipText', | ||
| { | ||
| defaultMessage: `The most recent time this watch's condition was checked`, |
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.
The last time the condition was checked.
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchHistory.watchTable.stateHeader.tooltipText', | ||
| { | ||
| defaultMessage: 'Active or error 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.
Active or error
Should this also include "inactive"?
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 don't believe so, because this part of the UI shows a history of attempted executed actions, and if it's inactive then it won't execute.
| 'xpack.watcher.sections.watchHistory.watchTable.commentHeader.tooltipText', | ||
| { | ||
| defaultMessage: | ||
| 'Information about whether the watch was throttled, acknowledged, or failed to execute', |
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.
| 'Information about whether the watch was throttled, acknowledged, or failed to execute', | |
| 'Whether the action was throttled, acknowledged, or failed to execute', |
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchHistory.watchActionStatusTable.state.tooltipText', | ||
| { | ||
| defaultMessage: 'OK, acked, throttled, or error 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.
| defaultMessage: 'OK, acked, throttled, or error state', | |
| defaultMessage: 'OK, acknowledged, throttled, or error', |
…S.IS_ACKABLE state.
|
@alisonelizabeth @gchaps Thank you for your feedback! I've implemented all of your suggestions, except the docs update. I'd like to do that in a separate PR after this one has been approved and merged. Could you please take another look at these changes? |
| 'xpack.watcher.sections.watchList.watchTable.commentHeader.tooltipText', | ||
| { | ||
| defaultMessage: | ||
| 'Whether any actions are acknowledgeable or have been acknowledged, throttled, or failed to execute.', |
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.
Can this be the same as the one below?
Whether actions are acknowledged, acknowledgeable, throttled, or failed.
gchaps
left a comment
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.
A few questions, but otherwise LGTM
| 'xpack.watcher.sections.watchHistory.watchTable.commentHeader.tooltipText', | ||
| { | ||
| defaultMessage: | ||
| 'Whether the action was throttled, acknowledged, acknowledgeable, or failed to execute.', |
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.
Is this the right order, or should it go from positive to negative: acknowledged, acknowledgeable, throttled, or failed? Should actions be singular or plural as the comment above?
Whether the action was throttled, acknowledged, acknowledgeable, or failed.',
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.
Can we come up with another word for acknowledgeable?
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.
For context, some actions can be "Acknowledged". I made up the term "Acknowledgeable" to describe this. Another term known to our users is "Ackable".
I have no preference about the order, and I don't have a feeling that the order will affect the meaning extracted by the reader.
What do you mean by "Should actions be singular or plural as the comment above"? I can't find the referenced comment.
| content={i18n.translate( | ||
| 'xpack.watcher.sections.watchHistory.watchActionStatusTable.state.tooltipText', | ||
| { | ||
| defaultMessage: 'OK, acknowledged, throttled, or error.', |
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.
How does this related to acknowledge, acknowledgeable, throttled, and failed. Should these two messages be using the same words?
|
@gchaps @alisonelizabeth I reverted the addition of the "Acknowledgeable" state, since AFAIK this hasn't been requested by users and it's raising additional questions in my mind about its value to the user. We can always add it back in a separate PR. |
alisonelizabeth
left a comment
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.
Latest LGTM
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* Update WATCH_STATES by replacing DISABLED with INACTIVE and OK/FIRING with ACTIVE. Update ACTION_STATES by replacing FIRING with OK. - Refactor isAckable logic to directly translate value provided by ES. - Replace WatchStatus component with ActionStateBadge and WatchStateBadge components. * Change WatchListPage 'Last fired' column to 'Condition last met' and 'Last triggered' column to 'Last checked'. - Add tooltips to both. - Add tooltips to State and Comment headers. * Rename Watch Status Model's lastFired -> lastExecution for consistency. Remove unused properties from client WatchStatus model. * Add Condition Met column and tooltips to State and Comment headers on Execution History Panel. * Add tooltip to State header in Execution History flyout. Add Last executed header to Action Statuses Panel and tooltips. Update tests. * Use EUI types instead of hand-rolling them. * Remove unused ACTION_STATES.FIRING and references to WATCH_STATES.FIRING. * Use dots to denote states, similar to Index Management. * Refactor deriveComment to use early exits.

Fixes:
Follow-up to #138026
Release note
Watches will no longer get stuck in a "Firing" state in Watcher.
Summary
I simplified the possible action and watch states, updated the UI accordingly, added more info to the UI in the form of tooltips to help users make sense of what they're seeing, and updated the tests. By removing the concept of a "firing" state from the UI, watches can now longer get "stuck" in that state and cause confusion among users. By adding more information about watch and action state, users will be able to form a clearer understanding of their behavior.
Data changes
ACTION_STATESandWATCH_STATEShave been simplified.WATCH_STATES:FIRING->OKACTIVE->DISABLEDINACTIVEERRORCONFIG_ERRORACTION_STATESFIRINGOKACKNOWLEDGEDTHROTTLEDERRORCONFIG_ERRORUNKNOWNRegarding config error: I understand that we don't expect ES to permit invalid watch configurations, but I decided to retain
CONFIG_ERRORfor now since it seems outside of the scope of the specific problem this PR fixes. See #23887 for more background on this state.Regarding isAckable:
isAckableis now a direct translation of the action model's underlying ES value, instead of derived from itsstate. I believe this is a truer reflection of how ES treats ackability (docs).UI changes
Watch list
I added columns for "Condition last met" and "Last checked", and added tooltips to most of the columns.
Execution history panel
I retained the "State" column because it could contain useful information, for example if it was in an error state. I added a "Condition met" column and added tooltips to most of the columns.
Action statuses panel
I added a "Last executed" column and added tooltips to most of the columns.
Simulate watch results flyout
I didn't make any changes to this flyout beyond surfacing the new action states, because it seems beyond the scope of the problem this PR addresses.
Steps to test
Create a watch locally with this request and explore the UI.