Add documentation for existing TLS settings in consul input (#3931)

This commit is contained in:
Daniel Nelson 2018-03-26 19:22:17 -07:00 committed by GitHub
parent 9146bbd78a
commit b187ffc55f
2 changed files with 57 additions and 39 deletions

View File

@ -1,43 +1,54 @@
# Telegraf Input Plugin: Consul # Consul Input Plugin
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: "")
## Data centre to query the health checks from
# datacentre = "" # datacentre = ""
## SSL Config
# ssl_ca = "/etc/telegraf/ca.pem"
# ssl_cert = "/etc/telegraf/cert.pem"
# ssl_key = "/etc/telegraf/key.pem"
## If false, skip chain & host verification
# insecure_skip_verify = true
``` ```
## Measurements: ### Metrics:
### Consul: - consul_health_checks
Tags: - tags:
- node: on which node check/service is registered on - node (node that check/service is registred on)
- service_name: name of the service (this is the service name not the service ID) - service_name
- check_id - check_id
- fields:
Fields: - check_name
- check_name - service_id
- service_id - status
- status - passing (integer)
- passing - critical (integer)
- critical - warning (integer)
- warning
`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.
## 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
* Plugin: consul, Collection 1 consul_health_checks,host=wolfpit,node=consul-server-node,service_name=www.example.com,check_id="service:www-example-com.test01" check_name="Service 'www.example.com' check",service_id="www-example-com.test01",status="critical",passing=0i,critical=1i,warning=0i 1464698464486519036
> 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
> consul_health_checks,host=wolfpit,node=consul-server-node,service_name=www.example.com,check_id="service:www-example-com.test01" check_name="Service 'www.example.com' check",service_id="www-example-com.test01",status="critical",passing=0i,critical=1i,warning=0i 1464698464486519036
``` ```

View File

@ -31,19 +31,28 @@ type Consul struct {
} }
var sampleConfig = ` var sampleConfig = `
## Most of these values defaults to the one configured on a Consul's agent level. ## Consul server address
## Optional Consul server address (default: "localhost")
# address = "localhost" # address = "localhost"
## Optional URI scheme for the Consul server (default: "http")
## URI scheme for the Consul server, one of "http", "https"
# scheme = "http" # 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: "")
## Data centre to query the health checks from
# datacentre = "" # datacentre = ""
## SSL Config
# ssl_ca = "/etc/telegraf/ca.pem"
# ssl_cert = "/etc/telegraf/cert.pem"
# ssl_key = "/etc/telegraf/key.pem"
## If false, skip chain & host verification
# insecure_skip_verify = true
` `
func (c *Consul) Description() string { func (c *Consul) Description() string {