telegraf/plugins/inputs/consul
Łukasz Harasimowicz 48ae105a11 Fixing consul with multiple health checks per service (#1994)
* plugins/input/consul: moved check_id from regular fields to tags.

When service has more than one check sending data for both would overwrite each other
resulting only in one check being written (the last one). Adding check_id as a tag
ensures we will get info for all unique checks per service.

* plugins/inputs/consul: updated tests
2016-12-20 13:03:31 +00:00
..
README.md Fixing consul with multiple health checks per service (#1994) 2016-12-20 13:03:31 +00:00
consul.go Fixing consul with multiple health checks per service (#1994) 2016-12-20 13:03:31 +00:00
consul_test.go Fixing consul with multiple health checks per service (#1994) 2016-12-20 13:03:31 +00:00

README.md

Telegraf Input Plugin: Consul

This plugin will collect statistics about all helath checks registered in the Consul. It uses Consul API to query the data. It will not report the telemetry but Consul can report those stats already using StatsD protocol if needed.

Configuration:

# Gather health check statuses from services registered in Consul
[[inputs.consul]]
  ## Most of these values defaults to the one configured on a Consul's agent level.
  ## Optional Consul server address (default: "")
  # address = ""
  ## Optional URI scheme for the Consul server (default: "")
  # scheme = ""
  ## Optional ACL token used in every request (default: "")
  # token = ""
  ## Optional username used for request HTTP Basic Authentication (default: "")
  # username = ""
  ## Optional password used for HTTP Basic Authentication (default: "")
  # password = ""
  ## Optional data centre to query the health checks from (default: "")
  # datacentre = ""

Measurements:

Consul:

Tags:

  • node: on which node check/service is registered on
  • service_name: name of the service (this is the service name not the service ID)
  • check_id

Fields:

  • check_name
  • service_id
  • status

Example output

$ telegraf --config ./telegraf.conf -input-filter consul -test
* Plugin: consul, Collection 1
> consul_health_checks,host=wolfpit,node=consul-server-node,check_id="serfHealth" check_name="Serf Health Status",service_id="",status="passing" 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" 1464698464486519036