Skip to content
Snippets Groups Projects
Unverified Commit 4cefe3ea authored by Daniel Nelson's avatar Daniel Nelson Committed by GitHub
Browse files

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

parent b63073de
No related branches found
No related tags found
No related merge requests found
# 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: "")
# 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
* 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
``` ```
...@@ -31,19 +31,28 @@ type Consul struct { ...@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment