@pomby/consolealerts
A library for use with pomby to add alerts to the console
Configuring
const elasticAlerts = require('@pomby/elasticalerts');
const eaPlugin = elasticAlerts({
index: 'pombyalerts',
node: 'http://localhost:9200',
});
pomby({
//...
plugins: [eaPlugin],
});
Options
- index - can be a string or a function, if a function the runtime of the monitor will be passed
- node - node or array of nodes to connect to
- timestampField (optional) - defaults to '@timestamp'
- more - You can send in most options available to the elastic search client connect
Sample Config
In your config you can add something like the following to your config:
{
"elasticAlerts": [
{
"type": ["fail"],
"template": "[{runTimeISO}] There was an error: {statusCode} with monitor: {title} in category {category}"
}
]
}
The type is the only required portion, output will default to info and template will default to "Console Alert Triggered for: {title}"
Template Variables
- title - Title of the monitor
- runTime - Date of the run
- runTimeISO - Date fo the run but formatted in ISO format
- timing - Time in ms the run took
- statusCode - Status code of the run (only on error)
- type - Monitor Type used
- category - Monitor Category
Types:
- success
- fail
- noResponse
- error
- slow
- testFail
- badConfig