Skip to content

Commit 75b492a

Browse files
update dispatcher readme to use new terminology
1 parent 7cfd09f commit 75b492a

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

  • x-pack/platform/plugins/shared/alerting_v2/server/lib/dispatcher

x-pack/platform/plugins/shared/alerting_v2/server/lib/dispatcher/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It runs on its own Task Manager schedule, separate from per-rule execution.
1010

1111
- Loading candidate alert episodes for the current execution window
1212
- Applying suppression semantics from alert actions
13-
- Matching episodes to notification policies
13+
- Matching episodes to action policies
1414
- Grouping matched episodes
1515
- Throttling repeated delivery
1616
- Dispatching to destinations
@@ -55,7 +55,7 @@ The pipeline then moves through these phases:
5555
2. Fetch suppression facts
5656
3. Split into dispatchable vs suppressed episodes
5757
4. Load rule metadata for dispatchable episodes
58-
5. Load enabled notification policies
58+
5. Load enabled action policies
5959
6. Evaluate policy matchers
6060
7. Build notification groups
6161
8. Apply throttling
@@ -71,7 +71,7 @@ By the end of a dispatcher run, every episode that reached the later pipeline st
7171
| `dispatch` | The episode matched a policy, survived suppression and throttling, and was selected for delivery. | `fire` per episode, plus `notified` per notification group |
7272
| `throttled` | The episode matched a policy, but the notification group was held back by throttling. | `suppress` with a throttle-related reason |
7373
| `suppressed` | The episode was explicitly filtered out by suppression logic such as ack, snooze, or deactivate semantics. | `suppress` with the suppression reason |
74-
| `unmatched` | The episode remained dispatchable but matched no enabled notification policy. | `unmatched` |
74+
| `unmatched` | The episode remained dispatchable but matched no enabled action policy. | `unmatched` |
7575

7676
The full action taxonomy, including user-written actions such as `ack` and `snooze`, is documented in [`../../resources/README.md`](../../resources/README.md).
7777

@@ -113,9 +113,9 @@ Unlike the rule executor, the dispatcher is not streaming. Each step receives on
113113
- `continue` with a partial state merge, or
114114
- `halt` with a `DispatcherHaltReason`
115115

116-
## Notification policy model
116+
## Action policy model
117117

118-
A notification policy is a saved object scoped to a Kibana space. Policies are not embedded into the rule. Instead, the dispatcher loads enabled policies for the space and evaluates each policy against the candidate episodes.
118+
An action policy is a saved object scoped to a Kibana space. Policies are not embedded into the rule. Instead, the dispatcher loads enabled policies for the space and evaluates each policy against the candidate episodes.
119119

120120
Each policy defines:
121121

@@ -148,7 +148,7 @@ The dispatcher carries state forward through `DispatcherPipelineState` in `types
148148
| `suppressions` | `FetchSuppressionsStep` | Suppression facts from `.alert-actions`. |
149149
| `dispatchable` / `suppressed` | `ApplySuppressionStep` | Split of episodes that may continue vs those that must not notify. |
150150
| `rules` | `FetchRulesStep` | Rule metadata keyed by rule id. |
151-
| `policies` | `FetchPoliciesStep` | Enabled notification policies keyed by id. |
151+
| `policies` | `FetchPoliciesStep` | Enabled action policies keyed by id. |
152152
| `matched` | `EvaluateMatchersStep` | Concrete `(episode, policy)` matches. |
153153
| `groups` | `BuildGroupsStep` | Notification groups to consider for delivery. |
154154
| `dispatch` / `throttled` | `ApplyThrottlingStep` | Groups that may send now vs groups held back. |
@@ -163,9 +163,9 @@ Step order is defined in `setup/bind_dispatcher_executor.ts`.
163163
| 2 | `FetchSuppressionsStep` | Load alert-action facts needed for suppression decisions. |
164164
| 3 | `ApplySuppressionStep` | Mark each episode as dispatchable or suppressed, preserving reasons. |
165165
| 4 | `FetchRulesStep` | Load rule metadata for the remaining dispatchable set. |
166-
| 5 | `FetchPoliciesStep` | Load enabled notification policies for the space. |
166+
| 5 | `FetchPoliciesStep` | Load enabled action policies for the space. |
167167
| 6 | `EvaluateMatchersStep` | Evaluate each policy matcher against each episode context. |
168-
| 7 | `BuildGroupsStep` | Build `NotificationGroup` objects based on policy grouping settings. |
168+
| 7 | `BuildGroupsStep` | Build `ActionGroup` objects based on policy grouping settings. |
169169
| 8 | `ApplyThrottlingStep` | Compare candidate groups with notification history and split them into dispatch vs throttled. |
170170
| 9 | `DispatchStep` | Perform delivery side effects for eligible groups. |
171171
| 10 | `StoreActionsStep` | Persist the execution outcome to `.alert-actions`. |
@@ -256,11 +256,11 @@ export interface DispatcherPipelineState {
256256
readonly dispatchable?: AlertEpisode[];
257257
readonly suppressed?: Array<AlertEpisode & { reason: string }>;
258258
readonly rules?: Map<RuleId, Rule>;
259-
readonly policies?: Map<NotificationPolicyId, NotificationPolicy>;
259+
readonly policies?: Map<ActionPolicyId, ActionPolicy>;
260260
readonly matched?: MatchedPair[];
261-
readonly groups?: NotificationGroup[];
262-
readonly dispatch?: NotificationGroup[];
263-
readonly throttled?: NotificationGroup[];
261+
readonly groups?: ActionGroup[];
262+
readonly dispatch?: ActionGroup[];
263+
readonly throttled?: ActionGroup[];
264264
readonly myNewMetadata?: string;
265265
}
266266
```
@@ -311,7 +311,7 @@ describe('MyNewStep', () => {
311311

312312
If you are not adding a new pipeline phase, but instead want to support a new delivery target, start with:
313313

314-
- `types.ts` to extend `NotificationPolicyDestination`
314+
- `types.ts` to extend `ActionPolicyDestination`
315315
- `steps/dispatch_step.ts` to add the new dispatch branch
316316
- any saved object / route validation that defines allowed destinations
317317

0 commit comments

Comments
 (0)