Skip to content

[alerting] update README #57853

@pmuellr

Description

@pmuellr

The alerting readme could use some updates

From the example alert type definition, the action groups array is not used (it's a fairly new parameter):

server.plugins.alerting.setup.registerType({
id: 'my-alert-type',
name: 'My alert type',
validate: {
params: schema.object({
server: schema.string(),
threshold: schema.number({ min: 0, max: 1 }),
}),
},

The description of the executor arguments should include services.alertInstanceFactory() with a link into the section describing it.

**executor(options)**
|Property|Description|
|---|---|
|services.callCluster(path, opts)|Use this to do Elasticsearch queries on the cluster Kibana connects to. This function is the same as any other `callCluster` in Kibana but in the context of the user who created the alert when security is enabled.|
|services.savedObjectsClient|This is an instance of the saved objects client. This provides the ability to do CRUD on any saved objects within the same space the alert lives in.<br><br>The scope of the saved objects client is tied to the user who created the alert (only when security isenabled).|
|services.log(tags, [data], [timestamp])|Use this to create server logs. (This is the same function as server.log)|

The description for scheduleActions() should indicate the id of the actionGroup is to be used here, not the {id, name} version of the action group. (see comments PR #57606)

|scheduleActions(actionGroup, context)|Called to schedule the execution of actions. The actionGroup relates to the group of alert `actions` to execute and the context will be used for templating purposes. This should only be called once per alert instance.|

The description of "Templating actions" should provide a pointer to our templating engine used (I believe mustache) along with a note about use of double-brace {{}}/ triple-brace {{{}}} to deal with HTML escaping. (see: issue. #57146)

## Templating actions

There could be more, that was just a quick review ...

Metadata

Metadata

Assignees

Labels

Feature:AlertingTeam:ResponseOpsPlatform ResponseOps team (formerly the Cases and Alerting teams) t//bugFixes for quality problems that affect the customer experience

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions