This plugin will collect statistics about all health checks registered in the Consul. It uses [Consul API](https://www.consul.io/docs/agent/http/health.html#health_state)
This plugin will collect statistics about all health checks registered in the
to query the data. It will not report the [telemetry](https://www.consul.io/docs/agent/telemetry.html) but Consul can report those stats already using StatsD protocol if needed.
Consul. It uses [Consul API](https://www.consul.io/docs/agent/http/health.html#health_state)
to query the data. It will not report the
[telemetry](https://www.consul.io/docs/agent/telemetry.html) but Consul can
report those stats already using StatsD protocol if needed.
## Configuration:
### Configuration:
```
```toml
# Gather health check statuses from services registered in Consul
# Gather health check statuses from services registered in Consul
[[inputs.consul]]
[[inputs.consul]]
## Most of these values defaults to the one configured on a Consul's agent level.
## Consul server address
## Optional Consul server address (default: "")
# address = "localhost"
# address = ""
## Optional URI scheme for the Consul server (default: "")
## URI scheme for the Consul server, one of "http", "https"
# scheme = ""
# scheme = "http"
## Optional ACL token used in every request (default: "")
## ACL token used in every request
# token = ""
# token = ""
## Optional username used for request HTTP Basic Authentication (default: "")
## HTTP Basic Authentication username and password.
# username = ""
# username = ""
## Optional password used for HTTP Basic Authentication (default: "")
# password = ""
# password = ""
## Optional data centre to query the health checks from (default: "")
# datacentre = ""
```
## Measurements:
## Data centre to query the health checks from
# datacentre = ""
### Consul:
## SSL Config
Tags:
# ssl_ca = "/etc/telegraf/ca.pem"
- node: on which node check/service is registered on
# ssl_cert = "/etc/telegraf/cert.pem"
- service_name: name of the service (this is the service name not the service ID)
# ssl_key = "/etc/telegraf/key.pem"
- check_id
## If false, skip chain & host verification
# insecure_skip_verify = true
```
Fields:
### Metrics:
- check_name
- service_id
- consul_health_checks
- status
- tags:
- passing
- node (node that check/service is registred on)
- critical
- service_name
- warning
- check_id
- fields:
- check_name
- service_id
- status
- passing (integer)
- critical (integer)
- warning (integer)
`passing`, `critical`, and `warning` are integer representations of the health
`passing`, `critical`, and `warning` are integer representations of the health
check state. A value of `1` represents that the status was the state of the
check state. A value of `1` represents that the status was the state of the
...
@@ -46,8 +57,6 @@ the health check at this sample.
...
@@ -46,8 +57,6 @@ the health check at this sample.
## Example output
## Example output
```
```
$ telegraf --config ./telegraf.conf --input-filter consul --test
consul_health_checks,host=wolfpit,node=consul-server-node,check_id="serfHealth" check_name="Serf Health Status",service_id="",status="passing",passing=1i,critical=0i,warning=0i 1464698464486439902