1.0.2 • Published 5 years ago
statscloud.io-plugin-healthcheck v1.0.2
statscloud.io-nodejs-plugin-healthcheck
Installation
You can install plugin as npm package:
npm install --save statscloud.io-nodejs-plugin-healthcheck
Usage
To use this plugin, just add it to plugins
section in .statscloud.json
file:
{
...
"plugins": [
{
"name": "healthcheck",
"settings": {
"healthChecks": [
{
"name": "health-check-name", // health check name, we recommend kebab-case names
"url": "example.com" // health check url
}
]
}
}
]
}
You can customize plugin settings as well:
{
...
"plugins": [
{
"name": "healthcheck", // plugin name
"settings": {
"flushIntervalInSeconds": 60, // how often to capture the metric values, default value is specified in .statscloud.json on top level
"retention": [ // how long to store metrics for and at which granularity, default value is specified in .statscloud.json on top level
{
"frequency": "1m",
"keep": "3d"
}
],
"healthChecks": [ // array which contains urls to check
{
"name": "", // health check name, we recommend kebab-case names
"url": "", // health check url
"intervals": ["10m"], // interval to count metrics during, default value is ["10m"]
"successStatuses" : [], // array which contains successful response statuses from server, default is 2xx
"successRegexp": "", // regexp response body should match in order for request to be considered successful, default is empty value meaning that this check is skipped
"uptimeIntervals": ["1w", "1d"], // intervals for uptime metrics, default values are 1 week and 1 day
"collectIntervalInSeconds": 60, // interval to check url in seconds, default 60 seconds
"alertsEnabled": false, // if healthcheck alerts are enabled, default value is specified by top-level alertsEnabled setting (see below)
"admins": [], // list of admin names no notify about this alert. Required when alertsEnabled set to true.
"channels": [], // list of channels to send notifications via. Required when alertsEnabled set to true.
"alertsRepeatInterval": "15m", // how often to repeat the alerts, default value is 15 minutes
"alertsUnhealthyDelay": "1m", // how much time the metric is allowed to stay in unhealthy zone before alert is raised, default value is 1 minute
"alertsHealthyDelay": "2m", // how much time the metric should stay in healthy zone before alert is removed, default value is 2 minutes
"alertThreshold": 2, // how many failures within interval to consider failure an incident, default value is 2
"uptimeAlertsRepeatInterval": "15m", // how often to repeat uptime alerts, default value is 15 minutes
"uptimeAlertsUnhealthyDelay": "1m", // how much time the uptime metric is allowed to stay in unhealthy zone before alert is raised, default value is 1 minute
"uptimeAlertsHealthyDelay": "2m", // how much time the uptime metric should stay in healthy zone before alert is removed, default value is 2 minutes
"uptimeAlertThreshold": 60 // minimum percentage of successful checks to consider an incident closed, default value is 60%
}
],
"alertsEnabled": false, // you can enable or disable alerts, default value is false
"dashboardTags": [], // you can define tags dashboards would be created for
"alertTags": [] // you can define tags alerts would be tracked for
}
}
]
}