Skip to content

[Alerting v2] [Rule form] provide services via context#255427

Merged
dominiqueclarke merged 1 commit intoelastic:alerting_v2from
dominiqueclarke:chore/alerting-v2-rule-form-services-context
Mar 2, 2026
Merged

[Alerting v2] [Rule form] provide services via context#255427
dominiqueclarke merged 1 commit intoelastic:alerting_v2from
dominiqueclarke:chore/alerting-v2-rule-form-services-context

Conversation

@dominiqueclarke
Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke commented Mar 2, 2026

Summary

This PR refactors the @kbn/alerting-v2-rule-form package to provide services via React Context instead of prop drilling. This improves code maintainability by eliminating the need to pass services through multiple component layers.

Changes

New Context System

Created a dedicated services context for the rule form:

  • RuleFormServicesProvider - Context provider component that wraps the form
  • useRuleFormServices() - Hook for consuming services in child components
  • RuleFormServices - Unified type interface for required services (http, data, dataViews, notifications)

Component Simplification

Components no longer need services passed as props:

// Before
<TimeFieldSelect services={services} />
<GroupFieldSelect services={services} />

// After  
<TimeFieldSelect />
<GroupFieldSelect />

The RuleExecutionFieldGroup component is now simplified as it no longer needs to forward services to its children.

Discover Integration Fix

Fixed a runtime error in the Discover → Create Rule integration where stateContainer.createAppStateObservable() was being called on DiscoverStateContainer, but this method only exists on ExtendedDiscoverStateContainer. The fix creates the observable directly using createTabAppStateObservable(), matching the pattern used elsewhere in Discover.

Also added:

  • Lazy loading for DynamicRuleFormFlyout to avoid Jest module resolution issues with Monaco dependencies
  • App change subscription to properly close the flyout when navigating away from Discover

Type Unification

Consolidated the RuleFormServices type definition into a single location (form/contexts/rule_form_services_context.tsx) and updated all consumers to use this unified type.

Test Utilities

Updated test utilities to support the new context pattern:

  • Added createMockServices() helper function
  • Updated createFormWrapper() to include RuleFormServicesProvider
  • All existing tests updated to use the new pattern

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

  • Low Risk: This is an internal refactor that doesn't change external APIs. The RuleFormServices type and exports remain backward compatible.
  • Low Risk: The Discover integration fix addresses a runtime error that would have been caught during testing.

@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Mar 2, 2026
@dominiqueclarke dominiqueclarke added release_note:skip Skip the PR/issue when compiling release notes and removed author:actionable-obs PRs authored by the actionable obs team release_note:skip Skip the PR/issue when compiling release notes labels Mar 2, 2026
@dominiqueclarke dominiqueclarke marked this pull request as ready for review March 2, 2026 03:47
@dominiqueclarke dominiqueclarke requested review from a team as code owners March 2, 2026 03:47
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 2, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #15 / DispatcherService integration tests when alert episodes have user actions (ack, snooze, deactivate) should dispatch fire actions for non-suppressed episodes and suppress actions for suppressed ones
  • [job] [logs] Jest Integration Tests #15 / DispatcherService integration tests when alert episodes have user actions (ack, snooze, deactivate) should dispatch fire actions for non-suppressed episodes and suppress actions for suppressed ones
  • [job] [logs] Jest Integration Tests #15 / DispatcherService integration tests when some episodes already have fires should only dispatch the new events
  • [job] [logs] Jest Integration Tests #15 / DispatcherService integration tests when some episodes already have fires should only dispatch the new events

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [7a52b28]

History

Copy link
Copy Markdown
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context provider changes are OK, but there is still a bug in closing the flyout.

Also, the flyout form looks broken on my screen, but that is a different issue 😅

});

// Listen for app changes (navigating away from Discover entirely)
const appChangeSubscription = core.application.currentAppId$.subscribe((appId) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flyout goes away if I move out of Discover, but it never closes if I change between tabs in Discover.

Image

If I:

  1. Open the flyout in tab 1
  2. Populate the fields
  3. Change to tab 2
  4. Click "save rule"

The query sent in the request is the one in tab1, even though I'm on tab 2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may need to handle this in a separate ticket. I talked to the Discover team about this and they didn't have a good answer for how to identify a changed tab at the time, though I'm sure now with all the refactoring to make their app state more tab focused there may not be a solution.

@dominiqueclarke dominiqueclarke merged commit 1af0e3e into elastic:alerting_v2 Mar 2, 2026
20 of 21 checks passed
@dominiqueclarke dominiqueclarke deleted the chore/alerting-v2-rule-form-services-context branch March 2, 2026 14:33
darnautov added a commit that referenced this pull request Mar 27, 2026
## Summary

### Key capabilities

- **ES|QL-native rule evaluation** — Rules are defined as ES|QL queries
with optional WHERE clause conditions, evaluated on a configurable
schedule
- **Alert lifecycle management** — Full episode tracking with pending →
active → recovering → inactive state transitions, including configurable
alert delay (consecutive breaches / duration)
- **Event-driven architecture** — Alert events and actions are stored in
dedicated data streams (`.alerting-events`, `.alerting-actions`) with
ES|QL views for querying
- **Notification dispatch pipeline** — A multi-step dispatcher that
matches alert episodes to notification policies, handles
throttling/suppression, and triggers Kibana Workflows using encrypted
API keys
- **Notification policies** — CRUD APIs and UI for creating notification
policies with KQL-based rule matching, workflow integration, and API key
management
- **Rule authoring UI** — A shared rule form package
(`@kbn/alerting-v2-rule-form`) usable standalone or embedded in
Discover, with ES|QL editor, WHERE clause condition editing, recovery
configuration, and live query preview
- **Rule management UI** — Full rule list with pagination,
enable/disable, clone, edit, and delete operations
- **APM instrumentation** — Middleware and decorators for tracing rule
execution and client operations

### Architecture highlights

- **InversifyJS DI** — All services use constructor injection with typed
tokens, scoped per-request or singleton as appropriate
- **Pipeline pattern** — Rule executor and dispatcher use composable
step-based pipelines
- **Saved Objects** — Rules stored as hidden saved objects; notification
policies stored as encrypted saved objects (for API key protection)
- **Feature privileges** — Dedicated Kibana feature with read/all
privileges for RBAC

---

## Contained PRs

<details>
<summary><strong>Core Engine & Plugin Init</strong> (12 PRs)</summary>

- #247283 — Init alerting v2 plugin (@cnasikas)
- #247452 — Add the alerting v2 feature privileges (@cnasikas)
- #247673 — Director (@cnasikas)
- #248306 — Create basic services (@cnasikas)
- #248696 — Initialize all resources (@cnasikas)
- #250023 — Schema package (@cnasikas)
- #250010 — YML Editor (@cnasikas)
- #251064 — Remove index.mode: lookup for RnA alert indices (@cnasikas)
- #251707 — Simplify task registration pattern (@kdelemme)
- #251876 — Dedicated user service (@cnasikas)
- #252073 — Use `kbn/data-streams` in alerting_v2 (@cnasikas)
- #255120 — Update alerting-v2 owner to new rna project team (@cnasikas)

</details>

<details>
<summary><strong>Rule Execution Pipeline</strong> (12 PRs)</summary>

- #247472 — Add alerting v2 Rule Executor (@darnautov)
- #248285 — Alerting v2 rule HTTP APIs (@darnautov)
- #248728 — Add basic alert actions route (@darnautov)
- #250161 — Refactor rule executor to use a pipeline pattern
(@darnautov)
- #252292 — Implement the CountTimeframeStrategy for the director
(@cnasikas)
- #252544 — Add support of streaming in the rule executor (@darnautov)
- #252754 — Update rule attributes (@kdelemme)
- #253355 — Add getRules client method (@kdelemme)
- #253668 — Make evaluation.query.condition optional (@kdelemme)
- #254031 — Add recovery event generation to rule execution pipeline
(@kdelemme)
- #255968 — ES&#124;QL views (@adcoelho)
- #256697 — Create episodes ES&#124;QL view (@adcoelho)

</details>

<details>
<summary><strong>Alert Suppression & Episodes</strong> (3 PRs)</summary>

- #252174 — Alert suppression (@kdelemme)
- #256486 — Fix suppression query (@kdelemme)
- #256527 — Store 'unmatched' action for unmatched alert episodes
(@kdelemme)

</details>

<details>
<summary><strong>Dispatcher & Notification Engine</strong> (6
PRs)</summary>

- #250822 — Alerting v2 dispatcher (@kdelemme)
- #251529 — Use query service in dispatcher (@kdelemme)
- #251679 — Dispatcher task (@kdelemme)
- #252758 — Dispatcher notification policy (@kdelemme)
- #255332 — Wait for resources before scheduling dispatcher task
(@kdelemme)
- #256536 — Use stored encrypted API keys from Notification Policy in
dispatcher step (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies (Server)</strong> (4
PRs)</summary>

- #251336 — Introduce notification policy CRUD APIs and client
(@cnasikas)
- #253134 — Update notification policy (@cnasikas)
- #254808 — Store API key owner on Notification Policy (@kdelemme)
- #256940 — Make notification policies global with optional rule-label
scoping (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies UI</strong> (1 PR)</summary>

- #255599 — Add notification policies UI and Storybook form story
(@adcoelho)

</details>

<details>
<summary><strong>Rule Authoring UI</strong> (13 PRs)</summary>

- #250961 — Add create rule flyout in Discover (@adcoelho)
- #255111 — Add activation configuration fields to alerting V2 rule form
(@yiannisnikolopoulos)
- #255427 — Rule form: provide services via context (@dominiqueclarke)
- #255876 — MVP rule form, Split evaluation condition, and Recovery
configuration (@dominiqueclarke)
- #256260 — Foundational rule list (@dominiqueclarke)
- #256756 — Wire up edit flow (@dominiqueclarke)
- #256801 — Move consecutive breaches max to shared constants
(@yiannisnikolopoulos)
- #256818 — Preview query and design parity (@dominiqueclarke)
- #256938 — Allow clearing number inputs in state transition fields
(@yiannisnikolopoulos)
- #257017 — Add enable/disable and clone rule to rule list
(@dominiqueclarke)
- #257246 — Remove all React.FC (@dominiqueclarke)
- #257415 — Rule form - fix test (@dominiqueclarke)
- #257454 — Block comma key in number input component
(@yiannisnikolopoulos)

</details>

<details>
<summary><strong>API Documentation & Schema</strong> (2 PRs)</summary>

- #254901 — Rename indexes for alert events and actions (@adcoelho)
- #255810 — OAS for alert action routes (@adcoelho)

</details>

<details>
<summary><strong>Observability & Monitoring</strong> (3 PRs)</summary>

- #254925 — Add ApmMiddleware to the rule executor (@adcoelho)
- #255115 — Add the withAPM decorator and apply it to the rules_client
(@adcoelho)
- #255999 — Fix linting problem in apm middleware (@adcoelho)

</details>

<details>
<summary><strong>CI & Maintenance</strong> (2 PRs)</summary>

- #257409 — Refactor SO services to use inversify DI for client
initialization (@darnautov)
- Fix alerting-v2-schema jest config (@darnautov)

</details>

---

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Antonio <antonio.coelho@elastic.co>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Co-authored-by: Yiannis Nikolopoulos <yiannis.nikolopoulos@elastic.co>
Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Co-authored-by: Anna Davydova <ana.davydova@elastic.co>
Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Joana Cardoso <169058851+joana-cps@users.noreply.github.com>
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 30, 2026
## Summary

### Key capabilities

- **ES|QL-native rule evaluation** — Rules are defined as ES|QL queries
with optional WHERE clause conditions, evaluated on a configurable
schedule
- **Alert lifecycle management** — Full episode tracking with pending →
active → recovering → inactive state transitions, including configurable
alert delay (consecutive breaches / duration)
- **Event-driven architecture** — Alert events and actions are stored in
dedicated data streams (`.alerting-events`, `.alerting-actions`) with
ES|QL views for querying
- **Notification dispatch pipeline** — A multi-step dispatcher that
matches alert episodes to notification policies, handles
throttling/suppression, and triggers Kibana Workflows using encrypted
API keys
- **Notification policies** — CRUD APIs and UI for creating notification
policies with KQL-based rule matching, workflow integration, and API key
management
- **Rule authoring UI** — A shared rule form package
(`@kbn/alerting-v2-rule-form`) usable standalone or embedded in
Discover, with ES|QL editor, WHERE clause condition editing, recovery
configuration, and live query preview
- **Rule management UI** — Full rule list with pagination,
enable/disable, clone, edit, and delete operations
- **APM instrumentation** — Middleware and decorators for tracing rule
execution and client operations

### Architecture highlights

- **InversifyJS DI** — All services use constructor injection with typed
tokens, scoped per-request or singleton as appropriate
- **Pipeline pattern** — Rule executor and dispatcher use composable
step-based pipelines
- **Saved Objects** — Rules stored as hidden saved objects; notification
policies stored as encrypted saved objects (for API key protection)
- **Feature privileges** — Dedicated Kibana feature with read/all
privileges for RBAC

---

## Contained PRs

<details>
<summary><strong>Core Engine & Plugin Init</strong> (12 PRs)</summary>

- elastic#247283 — Init alerting v2 plugin (@cnasikas)
- elastic#247452 — Add the alerting v2 feature privileges (@cnasikas)
- elastic#247673 — Director (@cnasikas)
- elastic#248306 — Create basic services (@cnasikas)
- elastic#248696 — Initialize all resources (@cnasikas)
- elastic#250023 — Schema package (@cnasikas)
- elastic#250010 — YML Editor (@cnasikas)
- elastic#251064 — Remove index.mode: lookup for RnA alert indices (@cnasikas)
- elastic#251707 — Simplify task registration pattern (@kdelemme)
- elastic#251876 — Dedicated user service (@cnasikas)
- elastic#252073 — Use `kbn/data-streams` in alerting_v2 (@cnasikas)
- elastic#255120 — Update alerting-v2 owner to new rna project team (@cnasikas)

</details>

<details>
<summary><strong>Rule Execution Pipeline</strong> (12 PRs)</summary>

- elastic#247472 — Add alerting v2 Rule Executor (@darnautov)
- elastic#248285 — Alerting v2 rule HTTP APIs (@darnautov)
- elastic#248728 — Add basic alert actions route (@darnautov)
- elastic#250161 — Refactor rule executor to use a pipeline pattern
(@darnautov)
- elastic#252292 — Implement the CountTimeframeStrategy for the director
(@cnasikas)
- elastic#252544 — Add support of streaming in the rule executor (@darnautov)
- elastic#252754 — Update rule attributes (@kdelemme)
- elastic#253355 — Add getRules client method (@kdelemme)
- elastic#253668 — Make evaluation.query.condition optional (@kdelemme)
- elastic#254031 — Add recovery event generation to rule execution pipeline
(@kdelemme)
- elastic#255968 — ES&elastic#124;QL views (@adcoelho)
- elastic#256697 — Create episodes ES&elastic#124;QL view (@adcoelho)

</details>

<details>
<summary><strong>Alert Suppression & Episodes</strong> (3 PRs)</summary>

- elastic#252174 — Alert suppression (@kdelemme)
- elastic#256486 — Fix suppression query (@kdelemme)
- elastic#256527 — Store 'unmatched' action for unmatched alert episodes
(@kdelemme)

</details>

<details>
<summary><strong>Dispatcher & Notification Engine</strong> (6
PRs)</summary>

- elastic#250822 — Alerting v2 dispatcher (@kdelemme)
- elastic#251529 — Use query service in dispatcher (@kdelemme)
- elastic#251679 — Dispatcher task (@kdelemme)
- elastic#252758 — Dispatcher notification policy (@kdelemme)
- elastic#255332 — Wait for resources before scheduling dispatcher task
(@kdelemme)
- elastic#256536 — Use stored encrypted API keys from Notification Policy in
dispatcher step (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies (Server)</strong> (4
PRs)</summary>

- elastic#251336 — Introduce notification policy CRUD APIs and client
(@cnasikas)
- elastic#253134 — Update notification policy (@cnasikas)
- elastic#254808 — Store API key owner on Notification Policy (@kdelemme)
- elastic#256940 — Make notification policies global with optional rule-label
scoping (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies UI</strong> (1 PR)</summary>

- elastic#255599 — Add notification policies UI and Storybook form story
(@adcoelho)

</details>

<details>
<summary><strong>Rule Authoring UI</strong> (13 PRs)</summary>

- elastic#250961 — Add create rule flyout in Discover (@adcoelho)
- elastic#255111 — Add activation configuration fields to alerting V2 rule form
(@yiannisnikolopoulos)
- elastic#255427 — Rule form: provide services via context (@dominiqueclarke)
- elastic#255876 — MVP rule form, Split evaluation condition, and Recovery
configuration (@dominiqueclarke)
- elastic#256260 — Foundational rule list (@dominiqueclarke)
- elastic#256756 — Wire up edit flow (@dominiqueclarke)
- elastic#256801 — Move consecutive breaches max to shared constants
(@yiannisnikolopoulos)
- elastic#256818 — Preview query and design parity (@dominiqueclarke)
- elastic#256938 — Allow clearing number inputs in state transition fields
(@yiannisnikolopoulos)
- elastic#257017 — Add enable/disable and clone rule to rule list
(@dominiqueclarke)
- elastic#257246 — Remove all React.FC (@dominiqueclarke)
- elastic#257415 — Rule form - fix test (@dominiqueclarke)
- elastic#257454 — Block comma key in number input component
(@yiannisnikolopoulos)

</details>

<details>
<summary><strong>API Documentation & Schema</strong> (2 PRs)</summary>

- elastic#254901 — Rename indexes for alert events and actions (@adcoelho)
- elastic#255810 — OAS for alert action routes (@adcoelho)

</details>

<details>
<summary><strong>Observability & Monitoring</strong> (3 PRs)</summary>

- elastic#254925 — Add ApmMiddleware to the rule executor (@adcoelho)
- elastic#255115 — Add the withAPM decorator and apply it to the rules_client
(@adcoelho)
- elastic#255999 — Fix linting problem in apm middleware (@adcoelho)

</details>

<details>
<summary><strong>CI & Maintenance</strong> (2 PRs)</summary>

- elastic#257409 — Refactor SO services to use inversify DI for client
initialization (@darnautov)
- Fix alerting-v2-schema jest config (@darnautov)

</details>

---

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Antonio <antonio.coelho@elastic.co>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Co-authored-by: Yiannis Nikolopoulos <yiannis.nikolopoulos@elastic.co>
Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Co-authored-by: Anna Davydova <ana.davydova@elastic.co>
Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Joana Cardoso <169058851+joana-cps@users.noreply.github.com>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
- **ES|QL-native rule evaluation** — Rules are defined as ES|QL queries
with optional WHERE clause conditions, evaluated on a configurable
schedule
- **Alert lifecycle management** — Full episode tracking with pending →
active → recovering → inactive state transitions, including configurable
alert delay (consecutive breaches / duration)
- **Event-driven architecture** — Alert events and actions are stored in
dedicated data streams (`.alerting-events`, `.alerting-actions`) with
ES|QL views for querying
- **Notification dispatch pipeline** — A multi-step dispatcher that
matches alert episodes to notification policies, handles
throttling/suppression, and triggers Kibana Workflows using encrypted
API keys
- **Notification policies** — CRUD APIs and UI for creating notification
policies with KQL-based rule matching, workflow integration, and API key
management
- **Rule authoring UI** — A shared rule form package
(`@kbn/alerting-v2-rule-form`) usable standalone or embedded in
Discover, with ES|QL editor, WHERE clause condition editing, recovery
configuration, and live query preview
- **Rule management UI** — Full rule list with pagination,
enable/disable, clone, edit, and delete operations
- **APM instrumentation** — Middleware and decorators for tracing rule
execution and client operations

- **InversifyJS DI** — All services use constructor injection with typed
tokens, scoped per-request or singleton as appropriate
- **Pipeline pattern** — Rule executor and dispatcher use composable
step-based pipelines
- **Saved Objects** — Rules stored as hidden saved objects; notification
policies stored as encrypted saved objects (for API key protection)
- **Feature privileges** — Dedicated Kibana feature with read/all
privileges for RBAC

---

<details>
<summary><strong>Core Engine & Plugin Init</strong> (12 PRs)</summary>

- elastic#247283 — Init alerting v2 plugin (@cnasikas)
- elastic#247452 — Add the alerting v2 feature privileges (@cnasikas)
- elastic#247673 — Director (@cnasikas)
- elastic#248306 — Create basic services (@cnasikas)
- elastic#248696 — Initialize all resources (@cnasikas)
- elastic#250023 — Schema package (@cnasikas)
- elastic#250010 — YML Editor (@cnasikas)
- elastic#251064 — Remove index.mode: lookup for RnA alert indices (@cnasikas)
- elastic#251707 — Simplify task registration pattern (@kdelemme)
- elastic#251876 — Dedicated user service (@cnasikas)
- elastic#252073 — Use `kbn/data-streams` in alerting_v2 (@cnasikas)
- elastic#255120 — Update alerting-v2 owner to new rna project team (@cnasikas)

</details>

<details>
<summary><strong>Rule Execution Pipeline</strong> (12 PRs)</summary>

- elastic#247472 — Add alerting v2 Rule Executor (@darnautov)
- elastic#248285 — Alerting v2 rule HTTP APIs (@darnautov)
- elastic#248728 — Add basic alert actions route (@darnautov)
- elastic#250161 — Refactor rule executor to use a pipeline pattern
(@darnautov)
- elastic#252292 — Implement the CountTimeframeStrategy for the director
(@cnasikas)
- elastic#252544 — Add support of streaming in the rule executor (@darnautov)
- elastic#252754 — Update rule attributes (@kdelemme)
- elastic#253355 — Add getRules client method (@kdelemme)
- elastic#253668 — Make evaluation.query.condition optional (@kdelemme)
- elastic#254031 — Add recovery event generation to rule execution pipeline
(@kdelemme)
- elastic#255968 — ES&elastic#124;QL views (@adcoelho)
- elastic#256697 — Create episodes ES&elastic#124;QL view (@adcoelho)

</details>

<details>
<summary><strong>Alert Suppression & Episodes</strong> (3 PRs)</summary>

- elastic#252174 — Alert suppression (@kdelemme)
- elastic#256486 — Fix suppression query (@kdelemme)
- elastic#256527 — Store 'unmatched' action for unmatched alert episodes
(@kdelemme)

</details>

<details>
<summary><strong>Dispatcher & Notification Engine</strong> (6
PRs)</summary>

- elastic#250822 — Alerting v2 dispatcher (@kdelemme)
- elastic#251529 — Use query service in dispatcher (@kdelemme)
- elastic#251679 — Dispatcher task (@kdelemme)
- elastic#252758 — Dispatcher notification policy (@kdelemme)
- elastic#255332 — Wait for resources before scheduling dispatcher task
(@kdelemme)
- elastic#256536 — Use stored encrypted API keys from Notification Policy in
dispatcher step (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies (Server)</strong> (4
PRs)</summary>

- elastic#251336 — Introduce notification policy CRUD APIs and client
(@cnasikas)
- elastic#253134 — Update notification policy (@cnasikas)
- elastic#254808 — Store API key owner on Notification Policy (@kdelemme)
- elastic#256940 — Make notification policies global with optional rule-label
scoping (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies UI</strong> (1 PR)</summary>

- elastic#255599 — Add notification policies UI and Storybook form story
(@adcoelho)

</details>

<details>
<summary><strong>Rule Authoring UI</strong> (13 PRs)</summary>

- elastic#250961 — Add create rule flyout in Discover (@adcoelho)
- elastic#255111 — Add activation configuration fields to alerting V2 rule form
(@yiannisnikolopoulos)
- elastic#255427 — Rule form: provide services via context (@dominiqueclarke)
- elastic#255876 — MVP rule form, Split evaluation condition, and Recovery
configuration (@dominiqueclarke)
- elastic#256260 — Foundational rule list (@dominiqueclarke)
- elastic#256756 — Wire up edit flow (@dominiqueclarke)
- elastic#256801 — Move consecutive breaches max to shared constants
(@yiannisnikolopoulos)
- elastic#256818 — Preview query and design parity (@dominiqueclarke)
- elastic#256938 — Allow clearing number inputs in state transition fields
(@yiannisnikolopoulos)
- elastic#257017 — Add enable/disable and clone rule to rule list
(@dominiqueclarke)
- elastic#257246 — Remove all React.FC (@dominiqueclarke)
- elastic#257415 — Rule form - fix test (@dominiqueclarke)
- elastic#257454 — Block comma key in number input component
(@yiannisnikolopoulos)

</details>

<details>
<summary><strong>API Documentation & Schema</strong> (2 PRs)</summary>

- elastic#254901 — Rename indexes for alert events and actions (@adcoelho)
- elastic#255810 — OAS for alert action routes (@adcoelho)

</details>

<details>
<summary><strong>Observability & Monitoring</strong> (3 PRs)</summary>

- elastic#254925 — Add ApmMiddleware to the rule executor (@adcoelho)
- elastic#255115 — Add the withAPM decorator and apply it to the rules_client
(@adcoelho)
- elastic#255999 — Fix linting problem in apm middleware (@adcoelho)

</details>

<details>
<summary><strong>CI & Maintenance</strong> (2 PRs)</summary>

- elastic#257409 — Refactor SO services to use inversify DI for client
initialization (@darnautov)
- Fix alerting-v2-schema jest config (@darnautov)

</details>

---

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Antonio <antonio.coelho@elastic.co>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Co-authored-by: Yiannis Nikolopoulos <yiannis.nikolopoulos@elastic.co>
Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Co-authored-by: Anna Davydova <ana.davydova@elastic.co>
Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Joana Cardoso <169058851+joana-cps@users.noreply.github.com>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
- **ES|QL-native rule evaluation** — Rules are defined as ES|QL queries
with optional WHERE clause conditions, evaluated on a configurable
schedule
- **Alert lifecycle management** — Full episode tracking with pending →
active → recovering → inactive state transitions, including configurable
alert delay (consecutive breaches / duration)
- **Event-driven architecture** — Alert events and actions are stored in
dedicated data streams (`.alerting-events`, `.alerting-actions`) with
ES|QL views for querying
- **Notification dispatch pipeline** — A multi-step dispatcher that
matches alert episodes to notification policies, handles
throttling/suppression, and triggers Kibana Workflows using encrypted
API keys
- **Notification policies** — CRUD APIs and UI for creating notification
policies with KQL-based rule matching, workflow integration, and API key
management
- **Rule authoring UI** — A shared rule form package
(`@kbn/alerting-v2-rule-form`) usable standalone or embedded in
Discover, with ES|QL editor, WHERE clause condition editing, recovery
configuration, and live query preview
- **Rule management UI** — Full rule list with pagination,
enable/disable, clone, edit, and delete operations
- **APM instrumentation** — Middleware and decorators for tracing rule
execution and client operations

- **InversifyJS DI** — All services use constructor injection with typed
tokens, scoped per-request or singleton as appropriate
- **Pipeline pattern** — Rule executor and dispatcher use composable
step-based pipelines
- **Saved Objects** — Rules stored as hidden saved objects; notification
policies stored as encrypted saved objects (for API key protection)
- **Feature privileges** — Dedicated Kibana feature with read/all
privileges for RBAC

---

<details>
<summary><strong>Core Engine & Plugin Init</strong> (12 PRs)</summary>

- elastic#247283 — Init alerting v2 plugin (@cnasikas)
- elastic#247452 — Add the alerting v2 feature privileges (@cnasikas)
- elastic#247673 — Director (@cnasikas)
- elastic#248306 — Create basic services (@cnasikas)
- elastic#248696 — Initialize all resources (@cnasikas)
- elastic#250023 — Schema package (@cnasikas)
- elastic#250010 — YML Editor (@cnasikas)
- elastic#251064 — Remove index.mode: lookup for RnA alert indices (@cnasikas)
- elastic#251707 — Simplify task registration pattern (@kdelemme)
- elastic#251876 — Dedicated user service (@cnasikas)
- elastic#252073 — Use `kbn/data-streams` in alerting_v2 (@cnasikas)
- elastic#255120 — Update alerting-v2 owner to new rna project team (@cnasikas)

</details>

<details>
<summary><strong>Rule Execution Pipeline</strong> (12 PRs)</summary>

- elastic#247472 — Add alerting v2 Rule Executor (@darnautov)
- elastic#248285 — Alerting v2 rule HTTP APIs (@darnautov)
- elastic#248728 — Add basic alert actions route (@darnautov)
- elastic#250161 — Refactor rule executor to use a pipeline pattern
(@darnautov)
- elastic#252292 — Implement the CountTimeframeStrategy for the director
(@cnasikas)
- elastic#252544 — Add support of streaming in the rule executor (@darnautov)
- elastic#252754 — Update rule attributes (@kdelemme)
- elastic#253355 — Add getRules client method (@kdelemme)
- elastic#253668 — Make evaluation.query.condition optional (@kdelemme)
- elastic#254031 — Add recovery event generation to rule execution pipeline
(@kdelemme)
- elastic#255968 — ES&elastic#124;QL views (@adcoelho)
- elastic#256697 — Create episodes ES&elastic#124;QL view (@adcoelho)

</details>

<details>
<summary><strong>Alert Suppression & Episodes</strong> (3 PRs)</summary>

- elastic#252174 — Alert suppression (@kdelemme)
- elastic#256486 — Fix suppression query (@kdelemme)
- elastic#256527 — Store 'unmatched' action for unmatched alert episodes
(@kdelemme)

</details>

<details>
<summary><strong>Dispatcher & Notification Engine</strong> (6
PRs)</summary>

- elastic#250822 — Alerting v2 dispatcher (@kdelemme)
- elastic#251529 — Use query service in dispatcher (@kdelemme)
- elastic#251679 — Dispatcher task (@kdelemme)
- elastic#252758 — Dispatcher notification policy (@kdelemme)
- elastic#255332 — Wait for resources before scheduling dispatcher task
(@kdelemme)
- elastic#256536 — Use stored encrypted API keys from Notification Policy in
dispatcher step (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies (Server)</strong> (4
PRs)</summary>

- elastic#251336 — Introduce notification policy CRUD APIs and client
(@cnasikas)
- elastic#253134 — Update notification policy (@cnasikas)
- elastic#254808 — Store API key owner on Notification Policy (@kdelemme)
- elastic#256940 — Make notification policies global with optional rule-label
scoping (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies UI</strong> (1 PR)</summary>

- elastic#255599 — Add notification policies UI and Storybook form story
(@adcoelho)

</details>

<details>
<summary><strong>Rule Authoring UI</strong> (13 PRs)</summary>

- elastic#250961 — Add create rule flyout in Discover (@adcoelho)
- elastic#255111 — Add activation configuration fields to alerting V2 rule form
(@yiannisnikolopoulos)
- elastic#255427 — Rule form: provide services via context (@dominiqueclarke)
- elastic#255876 — MVP rule form, Split evaluation condition, and Recovery
configuration (@dominiqueclarke)
- elastic#256260 — Foundational rule list (@dominiqueclarke)
- elastic#256756 — Wire up edit flow (@dominiqueclarke)
- elastic#256801 — Move consecutive breaches max to shared constants
(@yiannisnikolopoulos)
- elastic#256818 — Preview query and design parity (@dominiqueclarke)
- elastic#256938 — Allow clearing number inputs in state transition fields
(@yiannisnikolopoulos)
- elastic#257017 — Add enable/disable and clone rule to rule list
(@dominiqueclarke)
- elastic#257246 — Remove all React.FC (@dominiqueclarke)
- elastic#257415 — Rule form - fix test (@dominiqueclarke)
- elastic#257454 — Block comma key in number input component
(@yiannisnikolopoulos)

</details>

<details>
<summary><strong>API Documentation & Schema</strong> (2 PRs)</summary>

- elastic#254901 — Rename indexes for alert events and actions (@adcoelho)
- elastic#255810 — OAS for alert action routes (@adcoelho)

</details>

<details>
<summary><strong>Observability & Monitoring</strong> (3 PRs)</summary>

- elastic#254925 — Add ApmMiddleware to the rule executor (@adcoelho)
- elastic#255115 — Add the withAPM decorator and apply it to the rules_client
(@adcoelho)
- elastic#255999 — Fix linting problem in apm middleware (@adcoelho)

</details>

<details>
<summary><strong>CI & Maintenance</strong> (2 PRs)</summary>

- elastic#257409 — Refactor SO services to use inversify DI for client
initialization (@darnautov)
- Fix alerting-v2-schema jest config (@darnautov)

</details>

---

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Antonio <antonio.coelho@elastic.co>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Co-authored-by: Yiannis Nikolopoulos <yiannis.nikolopoulos@elastic.co>
Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Co-authored-by: Anna Davydova <ana.davydova@elastic.co>
Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Joana Cardoso <169058851+joana-cps@users.noreply.github.com>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
## Summary

### Key capabilities

- **ES|QL-native rule evaluation** — Rules are defined as ES|QL queries
with optional WHERE clause conditions, evaluated on a configurable
schedule
- **Alert lifecycle management** — Full episode tracking with pending →
active → recovering → inactive state transitions, including configurable
alert delay (consecutive breaches / duration)
- **Event-driven architecture** — Alert events and actions are stored in
dedicated data streams (`.alerting-events`, `.alerting-actions`) with
ES|QL views for querying
- **Notification dispatch pipeline** — A multi-step dispatcher that
matches alert episodes to notification policies, handles
throttling/suppression, and triggers Kibana Workflows using encrypted
API keys
- **Notification policies** — CRUD APIs and UI for creating notification
policies with KQL-based rule matching, workflow integration, and API key
management
- **Rule authoring UI** — A shared rule form package
(`@kbn/alerting-v2-rule-form`) usable standalone or embedded in
Discover, with ES|QL editor, WHERE clause condition editing, recovery
configuration, and live query preview
- **Rule management UI** — Full rule list with pagination,
enable/disable, clone, edit, and delete operations
- **APM instrumentation** — Middleware and decorators for tracing rule
execution and client operations

### Architecture highlights

- **InversifyJS DI** — All services use constructor injection with typed
tokens, scoped per-request or singleton as appropriate
- **Pipeline pattern** — Rule executor and dispatcher use composable
step-based pipelines
- **Saved Objects** — Rules stored as hidden saved objects; notification
policies stored as encrypted saved objects (for API key protection)
- **Feature privileges** — Dedicated Kibana feature with read/all
privileges for RBAC

---

## Contained PRs

<details>
<summary><strong>Core Engine & Plugin Init</strong> (12 PRs)</summary>

- elastic#247283 — Init alerting v2 plugin (@cnasikas)
- elastic#247452 — Add the alerting v2 feature privileges (@cnasikas)
- elastic#247673 — Director (@cnasikas)
- elastic#248306 — Create basic services (@cnasikas)
- elastic#248696 — Initialize all resources (@cnasikas)
- elastic#250023 — Schema package (@cnasikas)
- elastic#250010 — YML Editor (@cnasikas)
- elastic#251064 — Remove index.mode: lookup for RnA alert indices (@cnasikas)
- elastic#251707 — Simplify task registration pattern (@kdelemme)
- elastic#251876 — Dedicated user service (@cnasikas)
- elastic#252073 — Use `kbn/data-streams` in alerting_v2 (@cnasikas)
- elastic#255120 — Update alerting-v2 owner to new rna project team (@cnasikas)

</details>

<details>
<summary><strong>Rule Execution Pipeline</strong> (12 PRs)</summary>

- elastic#247472 — Add alerting v2 Rule Executor (@darnautov)
- elastic#248285 — Alerting v2 rule HTTP APIs (@darnautov)
- elastic#248728 — Add basic alert actions route (@darnautov)
- elastic#250161 — Refactor rule executor to use a pipeline pattern
(@darnautov)
- elastic#252292 — Implement the CountTimeframeStrategy for the director
(@cnasikas)
- elastic#252544 — Add support of streaming in the rule executor (@darnautov)
- elastic#252754 — Update rule attributes (@kdelemme)
- elastic#253355 — Add getRules client method (@kdelemme)
- elastic#253668 — Make evaluation.query.condition optional (@kdelemme)
- elastic#254031 — Add recovery event generation to rule execution pipeline
(@kdelemme)
- elastic#255968 — ES&elastic#124;QL views (@adcoelho)
- elastic#256697 — Create episodes ES&elastic#124;QL view (@adcoelho)

</details>

<details>
<summary><strong>Alert Suppression & Episodes</strong> (3 PRs)</summary>

- elastic#252174 — Alert suppression (@kdelemme)
- elastic#256486 — Fix suppression query (@kdelemme)
- elastic#256527 — Store 'unmatched' action for unmatched alert episodes
(@kdelemme)

</details>

<details>
<summary><strong>Dispatcher & Notification Engine</strong> (6
PRs)</summary>

- elastic#250822 — Alerting v2 dispatcher (@kdelemme)
- elastic#251529 — Use query service in dispatcher (@kdelemme)
- elastic#251679 — Dispatcher task (@kdelemme)
- elastic#252758 — Dispatcher notification policy (@kdelemme)
- elastic#255332 — Wait for resources before scheduling dispatcher task
(@kdelemme)
- elastic#256536 — Use stored encrypted API keys from Notification Policy in
dispatcher step (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies (Server)</strong> (4
PRs)</summary>

- elastic#251336 — Introduce notification policy CRUD APIs and client
(@cnasikas)
- elastic#253134 — Update notification policy (@cnasikas)
- elastic#254808 — Store API key owner on Notification Policy (@kdelemme)
- elastic#256940 — Make notification policies global with optional rule-label
scoping (@kdelemme)

</details>

<details>
<summary><strong>Notification Policies UI</strong> (1 PR)</summary>

- elastic#255599 — Add notification policies UI and Storybook form story
(@adcoelho)

</details>

<details>
<summary><strong>Rule Authoring UI</strong> (13 PRs)</summary>

- elastic#250961 — Add create rule flyout in Discover (@adcoelho)
- elastic#255111 — Add activation configuration fields to alerting V2 rule form
(@yiannisnikolopoulos)
- elastic#255427 — Rule form: provide services via context (@dominiqueclarke)
- elastic#255876 — MVP rule form, Split evaluation condition, and Recovery
configuration (@dominiqueclarke)
- elastic#256260 — Foundational rule list (@dominiqueclarke)
- elastic#256756 — Wire up edit flow (@dominiqueclarke)
- elastic#256801 — Move consecutive breaches max to shared constants
(@yiannisnikolopoulos)
- elastic#256818 — Preview query and design parity (@dominiqueclarke)
- elastic#256938 — Allow clearing number inputs in state transition fields
(@yiannisnikolopoulos)
- elastic#257017 — Add enable/disable and clone rule to rule list
(@dominiqueclarke)
- elastic#257246 — Remove all React.FC (@dominiqueclarke)
- elastic#257415 — Rule form - fix test (@dominiqueclarke)
- elastic#257454 — Block comma key in number input component
(@yiannisnikolopoulos)

</details>

<details>
<summary><strong>API Documentation & Schema</strong> (2 PRs)</summary>

- elastic#254901 — Rename indexes for alert events and actions (@adcoelho)
- elastic#255810 — OAS for alert action routes (@adcoelho)

</details>

<details>
<summary><strong>Observability & Monitoring</strong> (3 PRs)</summary>

- elastic#254925 — Add ApmMiddleware to the rule executor (@adcoelho)
- elastic#255115 — Add the withAPM decorator and apply it to the rules_client
(@adcoelho)
- elastic#255999 — Fix linting problem in apm middleware (@adcoelho)

</details>

<details>
<summary><strong>CI & Maintenance</strong> (2 PRs)</summary>

- elastic#257409 — Refactor SO services to use inversify DI for client
initialization (@darnautov)
- Fix alerting-v2-schema jest config (@darnautov)

</details>

---

---------

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Antonio <antonio.coelho@elastic.co>
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Co-authored-by: Yiannis Nikolopoulos <yiannis.nikolopoulos@elastic.co>
Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Co-authored-by: Anna Davydova <ana.davydova@elastic.co>
Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: Joana Cardoso <169058851+joana-cps@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants