kibana/x-pack/plugins/actions/server/lib
Chris Roberson 1f798aac3f
[Alerting] Change execution of alerts from async to sync (#97311)
* added ability to run ephemeral tasks

* fixed typing

* added typing on plugin

* WIP

* Fix type issues

* Hook up the ephemeral task into the task runner for actions

* Tasks can now run independently of one another

* Use deferred language

* Refactor taskParams slightly

* Use Promise.all

* Remove deferred logic

* Add config options to limit the amount of tasks executing at once

* Add ephemeral task monitoring

* WIP

* Add single test so far

* Ensure we log after actions have executed

* Remove confusing * 1

* Add logic to ensure we fallback to default enqueueing if the total actions is above the config

* Add additional test

* Fix tests a bit, ensure we log the alerting:actions-execute right away and the tests should listen for alerts:execute

* Better tests

* If the queue is at capacity, attempt to execute the ephemeral task as a regular action

* Ensure we run ephemeral tasks before to avoid them getting stuck in the queue

* Do not handle the promise anymore

* Remove unnecessary code

* Properly handle errors from ephemeral task lifecycle

* moved acitons domain out of alerting and into actions plugin

* Remove some tests

* Fix TS and test issues

* Fix type issues

* Fix more type issues

* Fix more type issues

* Fix jest tests

* Fix more jest tests

* Off by default

* Fix jest tests

* Update config for this suite too

* Start of telemetry code

* Fix types and add missing files

* Fix telemetry schema

* Fix types

* Fix more types

* moved load event emission to pollingcycle and added health stats on Ephemeral tasks

* Add more telemetry data based on new health metrics for the ephemeral queue

* Fix tests and types

* Add separate request capacity for ephemeral queue

* Fix telemetry schema and add tests for usage collection

* track polled tasks by persistence and use in capacity estimation instead of executions

* fixed typing

* Bump default capacity

* added delay metric to ephemeral stats

* Fix bad merge

* Fix tests

* Fix tests

* Fix types

* Skip failing tests

* Exclude ephemeral stats from capacity estimation tests

* PR feedback

* More PR feedback

* PR feedback

* Fix merge conflict

* Try fixing CI

* Fix broken lock file from merge

* Match master

* Add this back

* PR feedback

* Change to queue and add test

* Disable ephemeral queue in tests

* Updated desc

* Comment out ephemeral-specific tests tha require the entire test suite to support ephemeral tasks

* Add clarifying comment

Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-20 13:24:24 -04:00
..
errors Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
action_execution_source.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
action_executor.mock.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
action_executor.test.ts [alerting][actions] add task scheduled date and delay to event log - 2 (#103172) 2021-06-24 10:06:01 -04:00
action_executor.ts [Alerting] Change execution of alerts from async to sync (#97311) 2021-07-20 13:24:24 -04:00
audit_events.test.ts [core.logging] Ensure LogMeta is ECS-compliant. (#96350) 2021-04-20 09:31:32 -06:00
audit_events.ts [core.logging] Ensure LogMeta is ECS-compliant. (#96350) 2021-04-20 09:31:32 -06:00
custom_host_settings.test.ts [Actions] Rename tls.* configs to ssl.* (#102902) 2021-06-23 14:37:31 -04:00
custom_host_settings.ts [Actions] Rename tls.* configs to ssl.* (#102902) 2021-06-23 14:37:31 -04:00
ensure_sufficient_license.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
ensure_sufficient_license.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
executor_error.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
get_action_type_feature_usage_name.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
index.ts Create task to cleanup action execution failures (#96971) 2021-04-20 19:11:25 -04:00
license_state.mock.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
license_state.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
license_state.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
mustache_renderer.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
mustache_renderer.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
related_saved_objects.test.ts [actions] add rule saved object reference to action execution event log doc (#101526) 2021-06-22 15:18:35 -04:00
related_saved_objects.ts [actions] add rule saved object reference to action execution event log doc (#101526) 2021-06-22 15:18:35 -04:00
space_id_to_namespace.ts Create task to cleanup action execution failures (#96971) 2021-04-20 19:11:25 -04:00
task_runner_factory.test.ts [Alerting] Change execution of alerts from async to sync (#97311) 2021-07-20 13:24:24 -04:00
task_runner_factory.ts [Alerting] Change execution of alerts from async to sync (#97311) 2021-07-20 13:24:24 -04:00
validate_with_schema.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
validate_with_schema.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
verify_api_access.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00