Project: Netdata (Observability and Analysis / Observability)
File: consul.md

<!--startmeta customediturl: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/consul/README.md" meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/consul/metadata.yaml" sidebar_label: "Consul" learn_status: "Published" learnrelpath: "Collecting Metrics/Service Discovery / Registry" most_popular: True message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> <img src="https://netdata.cloud/img/consul.svg" width="150"/> Plugin: go.d.plugin Module: consul <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> This collector monitors of Consul Agents: transaction timings, leadership changes, memory usage and more. It periodically sends HTTP requests to . Used endpoints: This collector is supported on all platforms. This collector supports collecting metrics from multiple instances of this integration, including remote instances. This collector discovers instances running on the local host, that provide metrics on port 8500. On startup, it tries to collect metrics from: http://localhost:8500 http://127.0.0.1:8500 The default configuration for this integration does not impose any limits on data collection. The default configuration for this integration is not expected to impose a significant performance impact on the system. Metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. The set of metrics depends on the . These metrics refer to the entire monitored application. This scope has no labels. Metrics: | Metric | Dimensions | Unit | Leader | Follower | Client | |:|:-|:-|::|::|::| | consul.clientrpcrequests_rate | rpc | requests/s | | | | | consul.clientrpcrequestsexceededrate | exceeded | requests/s | | | | | consul.clientrpcrequestsfailedrate | failed | requests/s | | | | | consul.memory_allocated | allocated | bytes | | | | | consul.memory_sys | sys | bytes | | | | | consul.gcpausetime | gc_pause | seconds | | | | | consul.kvsapplytime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.kvsapplyoperationsrate | kvsapply | ops/s | | | | | consul.txnapplytime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.txnapplyoperationsrate | txnapply | ops/s | | | | | consul.autopilothealthstatus | healthy, unhealthy | status | | | | | consul.autopilotfailuretolerance | failure_tolerance | servers | | | | | consul.autopilotserverhealth_status | healthy, unhealthy | status | | | | | consul.autopilotserverstable_time | stable | seconds | | | | | consul.autopilotserverserf_status | active, failed, left, none | status | | | | | consul.autopilotservervoterstatus | voter, notvoter | status | | | | | consul.networklanrtt | min, max, avg | ms | | | | | consul.raftcommittime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.raftcommitsrate | commits | commits/s | | | | | consul.raftleaderlastcontacttime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.raftleaderoldestlogage | oldestlogage | seconds | | | | | consul.raftfollowerlastcontactleadertime | leaderlast_contact | ms | | | | | consul.raftrpcinstallsnapshottime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.raftleaderelections_rate | leader | elections/s | | | | |

| leadership | transitions/s | | | | | consul.serverleadershipstatus | leader, not_leader | status | | | | | consul.raftthreadmainsaturationperc | quantile0.5, quantile0.9, quantile_0.99 | percentage | | | | | consul.raftthreadfsmsaturationperc | quantile0.5, quantile0.9, quantile_0.99 | percentage | | | | | consul.raftfsmlastrestoreduration | lastrestoreduration | ms | | | | | consul.raftboltdbfreelist_bytes | freelist | bytes | | | | | consul.raftboltdblogsperbatch_rate | written | logs/s | | | | | consul.raftboltdbstorelogstime | quantile0.5, quantile0.9, quantile_0.99 | ms | | | | | consul.licenseexpirationtime | license_expiration | seconds | | | | Metrics about checks on Node level. Labels: | Label | Description | |:--|:-| | datacenter | Datacenter Identifier | | node_name | The node's name | | check_name | The check's name | Metrics: | Metric | Dimensions | Unit | Leader | Follower | Client | |:|:-|:-|::|::|::| | consul.nodehealthcheck_status | passing, maintenance, warning, critical | status | | | | Metrics about checks at a Service level. Labels: | Label | Description | |:--|:-| | datacenter | Datacenter Identifier | | node_name | The node's name | | check_name | The check's name | | service_name | The service's name | Metrics: | Metric | Dimensions | Unit | Leader | Follower | Client | |:|:-|:-|::|::|::| | consul.servicehealthcheck_status | passing, maintenance, warning, critical | status | | | | The following alerts are available: | Alert name | On metric | Description | |:|:-|:| | | consul.nodehealthcheckstatus | node health check ${label:checkname} has failed on server ${label:node_name} datacenter ${label:datacenter} | | | consul.servicehealthcheckstatus | service health check ${label:checkname} for service ${label:servicename} has failed on server ${label:nodename} datacenter ${label:datacenter} | | | consul.clientrpcrequestsexceededrate | number of rate-limited RPC requests made by server ${label:node_name} datacenter ${label:datacenter} | | | consul.clientrpcrequestsfailedrate | number of failed RPC requests made by server ${label:node_name} datacenter ${label:datacenter} | | | consul.gcpausetime | time spent in stop-the-world garbage collection pauses on server ${label:node_name} datacenter ${label:datacenter} | | | consul.autopilothealthstatus | datacenter ${label:datacenter} cluster is unhealthy as reported by server ${label:node_name} | | | consul.autopilotserverhealthstatus | server ${label:nodename} from datacenter ${label:datacenter} is unhealthy | | | consul.raftleaderlastcontacttime | median time elapsed since leader server ${label:node_name} datacenter ${label:datacenter} was last able to contact the follower nodes | | | consul.raftleadershiptransitionsrate | there has been a leadership change and server ${label:nodename} datacenter ${label:datacenter} has become the leader | | | consul.raftthreadmainsaturationperc | average saturation of the main Raft goroutine on server ${label:node_name} datacenter ${label:datacenter} | | | consul.raftthreadfsmsaturationperc | average saturation of the FSM Raft goroutine on server ${label:node_name} datacenter ${label:datacenter} | | | consul.licenseexpirationtime | Consul Enterprise licence expiration time on node ${label:node_name} datacenter ${label:datacenter} | telemetry on your Consul agent, by increasing the value of `prometheusretentiontime` from `0`. Required only if authentication is

| ACL | Endpoint | |::|| | `operator:read` | | | `node:read` | | | `agent:read` | , , and | The configuration file name for this integration is `go.d/consul.conf`. You can edit the configuration file using the `edit-config` script from the Netdata . ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata sudo ./edit-config go.d/consul.conf ``` The following options can be defined globally: updateevery, autodetectionretry. <details><summary>All options</summary> | Name | Description | Default | Required | |:-|:--|:-|:--:| | update_every | Data collection frequency. | 1 | no | | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | | url | Server URL. | http://localhost:8500 | yes | | acl_token | ACL token used in every request. | | no | | max_checks | Checks processing/charting limit. | | no | | max_filter | Checks processing/charting filter. Uses . | | no | | username | Username for basic HTTP authentication. | | no | | password | Password for basic HTTP authentication. | | no | | proxy_url | Proxy URL. | | no | | proxy_username | Username for proxy basic HTTP authentication. | | no | | proxy_password | Password for proxy basic HTTP authentication. | | no | | timeout | HTTP request timeout. | 1 | no | | method | HTTP request method. | GET | no | | body | HTTP request body. | | no | | headers | HTTP request headers. | | no | | notfollowredirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | | tlsskipverify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | | tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | | tls_cert | Client tls certificate. | | no | | tls_key | Client tls key. | | no | </details> An example configuration. ```yaml jobs: name: local url: http://127.0.0.1:8500 acl_token: "ec15675e-2999-d789-832e-8c4794daa8d7" ``` Local server with basic HTTP authentication. <details><summary>Config</summary> ```yaml jobs: name: local url: http://127.0.0.1:8500 acl_token: "ec15675e-2999-d789-832e-8c4794daa8d7" username: foo password: bar ``` </details> Note: When you define multiple jobs, their names must be unique. Collecting metrics from local and remote instances. <details><summary>Config</summary> ```yaml 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" ``` </details> 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]`. ```bash cd /usr/libexec/netdata/plugins.d/ ``` Switch to the `netdata` user. ```bash sudo -u netdata -s ``` Run the `go.d.plugin` to debug the collector: ```bash ./go.d.plugin -d -m consul ```