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)
There could be more, that was just a quick review ...
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):
kibana/x-pack/legacy/plugins/alerting/README.md
Lines 122 to 130 in fd193fd
The description of the executor arguments should include
services.alertInstanceFactory()with a link into the section describing it.kibana/x-pack/legacy/plugins/alerting/README.md
Lines 96 to 102 in fd193fd
The description for
scheduleActions()should indicate theidof the actionGroup is to be used here, not the{id, name}version of the action group. (see comments PR #57606)kibana/x-pack/legacy/plugins/alerting/README.md
Line 382 in fd193fd
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)kibana/x-pack/legacy/plugins/alerting/README.md
Line 385 in fd193fd
There could be more, that was just a quick review ...