Commit 6c27241
[Alerting v2] Create an advanced setting to toggle the alerting v2 feature (elastic#272365)
## Summary
This PR creates an advanced setting to toggle the alerting v2 feature.
It controls the rule and dispatcher execution, the APIs, and the UIs. It
does not control the resource creation. All resources will be created or
registered regardless. Lastly, it removes all other advanced settings
and consolidates the settings under one. I intentionally avoided any
refactor on how other places in the code, like the agent builder, are
being initialized based on the new setting to avoid getting out of
scope.
<img width="1912" height="217" alt="Screenshot 2026-06-03 at 1 05 02 PM"
src="https://github.com/user-attachments/assets/9c33a3d9-e5f0-4137-b6e2-739070b5cde9"
/>
I also removed the tests in
`x-pack/platform/test/api_integration_deployment_agnostic/alerting_v2`
because they are already covered by Scout in the `alerting_v2` plugin
and I migrated the telemetry test to Scout.
Lastly, I created a `getAlertingV2ManagementNavPanel` util that is used
by all solution navigations. This will help us in the future if we want
to make changes to the way we show the alerting v2 navigation so as not
to ping all teams for review.
## Test plan
### Manual verification
#### 0. Preconditions
- Local Kibana with the `alertingVTwo` plugin enabled.
- Enable debug logging for the plugin so you can observe the rule
executor / dispatcher halt logs. In `config/kibana.dev.yml`:
```yaml
logging.loggers:
- name: plugins.alertingVTwo
level: debug
```
- Create **two V2 rules** so you cover both pipelines:
- one of kind `signal`
- one of kind `alerts`
- Confirm `alerting:v2:enabled` is **on** in **Stack Management →
Advanced Settings**.
#### 1. Baseline — `alerting:v2:enabled = true`
- **Stack Management nav:** the `V2 Alerting Preview` section is visible
with its 4 apps: `Rules`, `Episodes`, `Action Policies`, `Execution
History`. Each app opens normally.
- **Rule executor logs:** rules run end-to-end. You should see normal
step logs (no `engine_disabled` halt) and the rules produce alert
events.
- **Dispatcher logs:** dispatcher runs end-to-end (no `engine_disabled`
halt) and dispatches actions.
- **Agent Builder attachments:** if `agentBuilder` plugin is present,
its attachments are still registered (no regression).
#### 2. Kill switch — `alerting:v2:enabled = false`
- Toggle `alerting:v2:enabled` to **off** in Advanced Settings, then
**reload** the page (the setting is `requiresPageReload: true`).
- **Stack Management nav:**
- `V2 Alerting Preview` section is **gone**.
- All 4 apps (`Rules`, `Episodes`, `Action Policies`, `Execution
History`) are **gone**.
- Direct URL navigation to any of those app paths results in core's "app
not found" / not-rendered behavior.
- **Rule executor logs** (per rule tick, for **each** of your two
rules):
```
[check_engine_enabled] Alerting v2 is disabled, halting rule <rule_id>
RuleExecutor: Pipeline halted at step: engine_disabled
```
- Confirm **no `RuleExecutor: Executing step: <name>` logs** appear for
any step (this PR removes the misleading assembly-time log).
- **Dispatcher logs:**
```
Dispatcher: Executing step: check_engine_enabled
[check_engine_enabled] Alerting v2 is disabled, halting dispatcher
execution <execution_uuid>
Dispatcher: Pipeline halted at step: engine_disabled
```
- Confirm **no `Dispatcher: Executing step:` logs for any step after
`check_engine_enabled`** — the dispatcher uses a sequential `for…of`
loop, so a halt prevents subsequent step logs.
- **No new alert events or action invocations** are produced while the
setting is off.
#### 3. Toggle back — `alerting:v2:enabled = true`
- Toggle the setting back to **on**, reload the page.
- **Stack Management nav:** `V2 Alerting Preview` section and all 4 apps
reappear.
- **Rule executor & dispatcher:** resume normal execution on the next
tick (no Kibana restart required — the setting is read at execution time
on the server).
Fixes: elastic/rna-program#573
Fixes: elastic#262779
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>1 parent 5b4e065 commit 6c27241
119 files changed
Lines changed: 1422 additions & 1252 deletions
File tree
- .buildkite/ftr-manifests
- .github
- src/platform
- x-pack
- platform
- plugins
- private/translations/translations
- test
- api_integration_deployment_agnostic
- apis/alerting_v2
- fixtures
- configs
- serverless
- stateful
- solutions
- observability/plugins
- observability
- public
- serverless_observability
- public
- search/plugins
- enterprise_search
- public
- serverless_search
- public
- security
- plugins
- security_solution_ess
- security_solution_serverless
- vectordb/plugins/serverless_vectordb
- public
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
449 | 448 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
| 1098 | + | |
1098 | 1099 | | |
1099 | 1100 | | |
1100 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
0 commit comments