Skip to main content

Consul collector

Consul is a service networking solution to connect and secure services across any runtime platform and public or private cloud.

This module collects the Key Metrics of the Consul Agent.

Requirements

Metrics

Depending on the mode, the collector collects a different number of metrics.

All metrics have "consul." prefix.

Labels per scope:

  • global: datacenter, node_name.
  • node check: datacenter, node_name, check_name.
  • service check: datacenter, node_name, check_name, service_name.
MetricScopeDimensionsUnitsServer LeaderServer FollowerClient
node_health_check_statusnode checkpassing, maintenance, warning, criticalstatusyesyesyes
service_health_check_statusservice checkpassing, maintenance, warning, criticalstatusyesyesyes
client_rpc_requests_rateglobalrpcrequests/syesyesyes
client_rpc_requests_exceeded_rateglobalexceededrequests/syesyesyes
client_rpc_requests_failed_rateglobalfailedrequests/syesyesyes
memory_allocatedglobalallocatedbytesyesyesyes
memory_sysglobalsysbytesyesyesyes
gc_pause_timeglobalgc_pausesecondsyesyesyes
kvs_apply_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msyesyesno
kvs_apply_operations_rateglobalkvs_applyops/syesyesno
txn_apply_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msyesyesno
txn_apply_operations_rateglobaltxn_applyops/syesyesno
autopilot_health_statusglobalhealthy, unhealthystatusyesyesno
autopilot_failure_toleranceglobalfailure_toleranceserversyesyesno
autopilot_server_health_statusglobalhealthy, unhealthystatusyesyesno
autopilot_server_stable_timeglobalstablesecondsyesyesno
autopilot_server_serf_statusglobalactive, failed, left, nonestatusyesyesno
autopilot_server_voter_statusglobalvoter, not_voterstatusyesyesno
network_lan_rttglobalmin, max, avgmsyesyesno
raft_commit_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msyesnono
raft_commits_rateglobalcommitscommits/syesnono
raft_leader_last_contact_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msyesnono
raft_leader_oldest_log_ageglobaloldest_log_agesecondsyesnono
raft_follower_last_contact_leader_timegloballeader_last_contactmsnoyesno
raft_rpc_install_snapshot_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msnoyesno
raft_leader_elections_rategloballeaderelections/syesyesno
raft_leadership_transitions_rategloballeadershiptransitions/syesyesno
server_leadership_statusgloballeader, not_leaderstatusyesyesno
raft_thread_main_saturation_percglobalquantile_0.5, quantile_0.9, quantile_0.99percentageyesyesno
raft_thread_fsm_saturation_percglobalquantile_0.5, quantile_0.9, quantile_0.99percentageyesyesno
raft_fsm_last_restore_durationgloballast_restore_durationmsyesyesno
raft_boltdb_freelist_bytesglobalfreelistbytesyesyesno
raft_boltdb_logs_per_batch_rateglobalwrittenlogs/syesyesno
raft_boltdb_store_logs_timeglobalquantile_0.5, quantile_0.9, quantile_0.99msyesyesno
license_expiration_timegloballicense_expirationsecondsyesyesyes

Configuration

Edit the go.d/consul.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/consul.conf

Here is an example for 2 servers:

jobs:
- name: local
url: http://127.0.0.1:8500
acl_token: "ec15675e-2999-d789-832e-8c4794daa8d7"

- name: remote
url: http://203.0.113.10:8500
acl_token: "ada7f751-f654-8872-7f93-498e799158b6"

For all available options please see module configuration file.

Troubleshooting

To troubleshoot issues with the consul collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m consul

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.