-
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
Extended existing alerting functionality to support preconfigured only action types #64030
Extended existing alerting functionality to support preconfigured only action types #64030
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
LGTM; tested out various combinations of enabled-via-config action types, pre-configured action types, everything worked as expected
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.
It seems the pre-configured only actions don't run on the server side, I get the following error:
server log [09:34:19.767] [warning][alerting][alerting][plugins][plugins] Alert "3ba5d2d2-12fb-40db-8ed6-a7b4741a56ba" skipped scheduling action "log" because it is disabled
This could be worth an API Integration test to ensure pre-configured only action types work.
It also seems that the sort order is off when mixing pre-configured only action types in the alert flyout (the clickable ones should be first and ordered alphabetically). Below only "Index" and "Server Log" are clickable:
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.
So far the remaining from my previous review LGTM, great work! I will defer to @gchaps to review the docs portion. Maybe there's something in common between the docs for preconfigured action types and the docs for preconfigured connectors.
x-pack/plugins/triggers_actions_ui/public/application/lib/check_action_type_enabled.tsx
Outdated
Show resolved
Hide resolved
…y-action-types # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
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 comments
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.
Getting close, looks like there's two more places on the server side that need to allow preconfigured actions and they should run afterwards.
I use the following test scenario to see if a preconfigured action works:
- Disable the
.server-log
action type by removing it fromxpack.actions.enabledActionTypes
- Create a preconfigured server log action type within
xpack.actions.preconfigured
- Create an alert where
.kibana_task_manager
count is below 1000 and send a server log (preconfigured) as the action - Wait for message to display
x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts
Outdated
Show resolved
Hide resolved
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.
LGTM! Pulled down locally and was able to get a preconfigured only connector to log something on the server. Just one comment about the logic within isActionTypeExecutable
.
…preconfigured list
…y-action-types # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…y action types (elastic#64030) * Extended existing alerting functionality to support preconfigured only action types * fixed functional test * Adding documentation * Fixed UI part due to comments * added missing tests * fixed action type execution * Fixed documentation * Fixed due to comments * fixed type checks * extended isActionExecutable to check exact action id if it is in the preconfigured list
…y action types (elastic#64030) * Extended existing alerting functionality to support preconfigured only action types * fixed functional test * Adding documentation * Fixed UI part due to comments * added missing tests * fixed action type execution * Fixed documentation * Fixed due to comments * fixed type checks * extended isActionExecutable to check exact action id if it is in the preconfigured list
…y action types (elastic#64030) * Extended existing alerting functionality to support preconfigured only action types * fixed functional test * Adding documentation * Fixed UI part due to comments * added missing tests * fixed action type execution * Fixed documentation * Fixed due to comments * fixed type checks * extended isActionExecutable to check exact action id if it is in the preconfigured list
…y action types (#64030) (#64525) * Extended existing alerting functionality to support preconfigured only action types * fixed functional test * Adding documentation * Fixed UI part due to comments * added missing tests * fixed action type execution * Fixed documentation * Fixed due to comments * fixed type checks * extended isActionExecutable to check exact action id if it is in the preconfigured list
Resolve #63166
Extend existing UI to be able to support preconfigured action types.
Current functionality is based on skipping preconfigured action type in
xpack.actions.enabledActionTypes: ['.server-log', '.email', '.index']
and having only preconfigured connectors of this action type:xpack.actions.preconfigured:
- id: 'my-slack1' # action/connector id
actionTypeId: .slack #use the built in slack action type
name: 'Slack #xyz'
# sensitive config like secrets are preferably stored in Kibana keystore
config:
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
User shouldn't be able to create a connector of preconfigured action type:
But still should have an option to attach the preconfigured connectors to an alert: