Back to Nightingale

Consul Input Plugin

integrations/Consul/markdown/README.md

8.5.16.0 KB
Original Source

Consul Input Plugin

This plugin will collect statistics about all health 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

toml
# Gather health check statuses from services registered in Consul
[[instances]]
  ## Consul server address
  # address = "localhost:8500"

  ## URI scheme for the Consul server, one of "http", "https"
  # scheme = "http"

  ## ACL token used in every request
  # token = ""

  ## HTTP Basic Authentication username and password.
  # username = ""
  # password = ""

  ## Data center to query the health checks from
  # datacenter = ""

  ## Optional TLS Config
  # tls_ca = "/etc/categraf/ca.pem"
  # tls_cert = "/etc/categraf/cert.pem"
  # tls_key = "/etc/categraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = true

Metrics

namehelp
consul_upWas the last query of Consul successful.
consul_scrape_use_secondsscrape use seconds.
consul_raft_peersHow many peers (servers) are in the Raft cluster.
consul_raft_leaderDoes Raft cluster have a leader (according to this node).
consul_serf_lan_membersHow many members are in the cluster.
consul_serf_lan_member_statusStatus of member in the cluster. 1=Alive, 2=Leaving, 3=Left, 4=Failed.
consul_serf_wan_member_statusStatus of member in the wan cluster. 1=Alive, 2=Leaving, 3=Left, 4=Failed.
consul_catalog_servicesHow many services are in the cluster.
consul_service_tagTags of a service.
consul_health_node_statusStatus of health checks associated with a node.
consul_health_service_statusStatus of health checks associated with a service.
consul_service_checksLink the service id and check name if available.
consul_catalog_kvThe values for selected keys in Consul's key/value catalog. Keys with non-numeric values are omitted.
And some metrics with uncertain names, See the Agent Metrics for more details

Example Output

text
consul_up address=localhost:8500 agent_hostname=hostname 1

consul_scrape_use_seconds address=localhost:8500 agent_hostname=hostname 0.015674053

consul_raft_peers address=localhost:8500 agent_hostname=hostname 1

consul_raft_leader address=localhost:8500 agent_hostname=hostname 1

consul_serf_lan_members address=localhost:8500 agent_hostname=hostname 1

consul_serf_lan_member_status address=localhost:8500 agent_hostname=hostname member=localhost.localdomain 1

consul_serf_wan_member_status address=localhost:8500 agent_hostname=hostname dc=dc1 member=localhost.localdomain.dc1 1

consul_catalog_services address=localhost:8500 agent_hostname=hostname 1

consul_health_node_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain status=passing 1
consul_health_node_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain status=warning 0
consul_health_node_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain status=critical 0
consul_health_node_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain status=maintenance 0

consul_health_service_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo status=passing 1
consul_health_service_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo status=warning 0
consul_health_service_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo status=critical 0
consul_health_service_status address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo status=maintenance 0

consul_service_checks address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo status=critical 1

consul_service_tag address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo tag=tag1 1
consul_service_tag address=localhost:8500 agent_hostname=hostname check_id=service:demo check_name=Service 'demo' check node=localhost.localdomain service_id=demo service_name=demo tag=tag2 1