Agent Telemetry

The Consul agent collects various runtime metrics about the performance of different libraries and subsystems. These metrics are aggregated on a ten second (10s) interval and are retained for one minute. An interval is the period of time between instances of data being collected and aggregated.

When telemetry is being streamed to an external metrics store, the interval is defined to be that store’s flush interval.

External StoreInterval (seconds)
dogstatsd10s
Prometheus60s
statsd10s

To view this data, you must send a signal to the Consul process: on Unix, this is USR1 while on Windows it is BREAK. Once Consul receives the signal, it will dump the current telemetry information to the agent’s stderr.

This telemetry information can be used for debugging or otherwise getting a better view of what Consul is doing. Review the Monitoring and Metrics tutorial to learn how collect and interpret Consul data.

By default, all metric names of gauge type are prefixed with the hostname of the consul agent, e.g., consul.hostname.server.isLeader. To disable prefixing the hostname, set telemetry.disable_hostname=true in the agent configuration.

Additionally, if the telemetry configuration options are provided, the telemetry information will be streamed to a statsite or statsd server where it can be aggregated and flushed to Graphite or any other metrics store. For a configuration example for Telegraf, review the Monitoring with Telegraf tutorial.

This information can also be viewed with the metrics endpoint in JSON format or using Prometheus format.

Sample output of telemetry dump

  1. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.num_goroutines': 19.000
  2. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.alloc_bytes': 755960.000
  3. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.malloc_count': 7550.000
  4. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.free_count': 4387.000
  5. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.heap_objects': 3163.000
  6. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.total_gc_pause_ns': 1151002.000
  7. [2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.total_gc_runs': 4.000
  8. [2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.agent.ipc.accept': Count: 5 Sum: 5.000
  9. [2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.agent.ipc.command': Count: 10 Sum: 10.000
  10. [2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events': Count: 5 Sum: 5.000
  11. [2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events.foo': Count: 4 Sum: 4.000
  12. [2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events.baz': Count: 1 Sum: 1.000
  13. [2014-01-29 10:56:50 -0800 PST][S] 'consul-agent.memberlist.gossip': Count: 50 Min: 0.007 Mean: 0.020 Max: 0.041 Stddev: 0.007 Sum: 0.989
  14. [2014-01-29 10:56:50 -0800 PST][S] 'consul-agent.serf.queue.Intent': Count: 10 Sum: 0.000
  15. [2014-01-29 10:56:50 -0800 PST][S] 'consul-agent.serf.queue.Event': Count: 10 Min: 0.000 Mean: 2.500 Max: 5.000 Stddev: 2.121 Sum: 25.000

Key Metrics

These are some metrics emitted that can help you understand the health of your cluster at a glance. A Grafana dashboard is also available, which is maintained by the Consul team and displays these metrics for easy visualization. For a full list of metrics emitted by Consul, see Metrics Reference

Transaction timing

Metric NameDescriptionUnitType
consul.kvs.applyMeasures the time it takes to complete an update to the KV store.mstimer
consul.txn.applyMeasures the time spent applying a transaction operation.mstimer
consul.raft.applyCounts the number of Raft transactions applied during the interval. This metric is only reported on the leader.raft transactions / intervalcounter
consul.raft.commitTimeMeasures the time it takes to commit a new entry to the Raft log on the leader.mstimer

Why they’re important: Taken together, these metrics indicate how long it takes to complete write operations in various parts of the Consul cluster. Generally these should all be fairly consistent and no more than a few milliseconds. Sudden changes in any of the timing values could be due to unexpected load on the Consul servers, or due to problems on the servers themselves.

What to look for: Deviations (in any of these metrics) of more than 50% from baseline over the previous hour.

Leadership changes

Metric NameDescriptionUnitType
consul.raft.leader.lastContactMeasures the time since the leader was last able to contact the follower nodes when checking its leader lease.mstimer
consul.raft.state.candidateIncrements whenever a Consul server starts an election.electionscounter
consul.raft.state.leaderIncrements whenever a Consul server becomes a leader.leaderscounter
consul.server.isLeaderTrack if a server is a leader(1) or not(0).1 or 0gauge

Why they’re important: Normally, your Consul cluster should have a stable leader. If there are frequent elections or leadership changes, it would likely indicate network issues between the Consul servers, or that the Consul servers themselves are unable to keep up with the load.

What to look for: For a healthy cluster, you’re looking for a lastContact lower than 200ms, leader > 0 and candidate == 0. Deviations from this might indicate flapping leadership.

Certificate Authority Expiration

Metric NameDescriptionUnitType
consul.mesh.active-root-ca.expiryThe number of seconds until the root CA expires, updated every hour.secondsgauge
consul.mesh.active-signing-ca.expiryThe number of seconds until the signing CA expires, updated every hour.secondsgauge
consul.agent.tls.cert.expiryThe number of seconds until the server agent’s TLS certificate expires, updated every hour.secondsgauge

Why they’re important: Consul Mesh requires a CA to sign all certificates used to connect the mesh and the mesh network ceases to work if they expire and become invalid. The Root is particularly important to monitor as Consul does not automatically rotate it. The TLS certificate metric monitors the certificate that the server’s agent uses to connect with the other agents in the cluster.

What to look for: The Root CA should be monitored for an approaching expiration, to indicate it is time for you to rotate the “root” CA either manually or with external automation. Consul should rotate the signing (intermediate) certificate automatically, but we recommend monitoring the rotation. When the certificate does not rotate, check the server agent logs for messages related to the CA system. The agent TLS certificate’s rotation handling varies based on the configuration.

Autopilot

Metric NameDescriptionUnitType
consul.autopilot.healthyTracks the overall health of the local server cluster. If all servers are considered healthy by Autopilot, this will be set to 1. If any are unhealthy, this will be 0.health stategauge

Why it’s important: Autopilot can expose the overall health of your cluster with a simple boolean.

What to look for: Alert if healthy is 0. Some other indicators of an unhealthy cluster would be:

  • consul.raft.commitTime - This can help reflect the speed of state store changes being performed by the agent. If this number is rising, the server may be experiencing an issue due to degraded resources on the host.
  • Leadership change metrics - Check for deviation from the recommended values. This can indicate failed leadership elections or flapping nodes.

Memory usage

Metric NameDescriptionUnitType
consul.runtime.alloc_bytesMeasures the number of bytes allocated by the Consul process.bytesgauge
consul.runtime.sys_bytesMeasures the total number of bytes of memory obtained from the OS.bytesgauge

Why they’re important: Consul keeps all of its data in memory. If Consul consumes all available memory, it will crash.

What to look for: If consul.runtime.sys_bytes exceeds 90% of total available system memory.

NOTE: This metric is calculated using Go’s runtime package MemStats. This will have a different output than using information gathered from top. For more information, see GH-4734.

Garbage collection

Metric NameDescriptionUnitType
consul.runtime.total_gc_pause_nsNumber of nanoseconds consumed by stop-the-world garbage collection (GC) pauses since Consul started.nsgauge

Why it’s important: GC pause is a “stop-the-world” event, meaning that all runtime threads are blocked until GC completes. Normally these pauses last only a few nanoseconds. But if memory usage is high, the Go runtime may GC so frequently that it starts to slow down Consul.

What to look for: Warning if total_gc_pause_ns exceeds 2 seconds/minute, critical if it exceeds 5 seconds/minute.

NOTE: total_gc_pause_ns is a cumulative counter, so in order to calculate rates (such as GC/minute), you will need to apply a function such as InfluxDB’s non_negative_difference().

Network activity - RPC Count

Metric NameDescriptionUnitType
consul.client.rpcIncrements whenever a Consul agent makes an RPC request to a Consul serverrequestscounter
consul.client.rpc.exceededIncrements whenever a Consul agent makes an RPC request to a Consul server gets rate limited by that agent’s limits configuration.requestscounter
consul.client.rpc.failedIncrements whenever a Consul agent makes an RPC request to a Consul server and fails.requestscounter

Why they’re important: These measurements indicate the current load created from a Consul agent, including when the load becomes high enough to be rate limited. A high RPC count, especially from consul.client.rpcexceeded meaning that the requests are being rate-limited, could imply a misconfigured Consul agent.

What to look for: Sudden large changes to the consul.client.rpc metrics (greater than 50% deviation from baseline). consul.client.rpc.exceeded or consul.client.rpc.failed count > 0, as it implies that an agent is being rate-limited or fails to make an RPC request to a Consul server

Raft Thread Saturation

Metric NameDescriptionUnitType
consul.raft.thread.main.saturationAn approximate measurement of the proportion of time the main Raft goroutine is busy and unavailable to accept new work.percentagesample
consul.raft.thread.fsm.saturationAn approximate measurement of the proportion of time the Raft FSM goroutine is busy and unavailable to accept new work.percentagesample

Why they’re important: These measurements are a useful proxy for how much capacity a Consul server has to accept additional write load. High saturation of the Raft goroutines can lead to elevated latency in the rest of the system and cause cluster instability.

What to look for: Generally, a server’s steady-state saturation should be less than 50%.

NOTE: These metrics are approximate and under extremely heavy load won’t give a perfect fine-grained view of how much headroom a server has available. Instead, treat them as an early warning sign.

Requirements:

  • Consul 1.13.0+

Raft Replication Capacity Issues

Metric NameDescriptionUnitType
consul.raft.fsm.lastRestoreDurationMeasures the time taken to restore the FSM from a snapshot on an agent restart or from the leader calling installSnapshot. This is a gauge that holds it’s value since most servers only restore during restarts which are typically infrequent.msgauge
consul.raft.leader.oldestLogAgeThe number of milliseconds since the oldest log in the leader’s log store was written. This can be important for replication health where write rate is high and the snapshot is large as followers may be unable to recover from a restart if restoring takes longer than the minimum value for the current leader. Compare this with consul.raft.fsm.lastRestoreDuration and consul.raft.rpc.installSnapshot to monitor. In normal usage this gauge value will grow linearly over time until a snapshot completes on the leader and the log is truncated.msgauge
consul.raft.rpc.installSnapshotMeasures the time taken to process the installSnapshot RPC call. This metric should only be seen on agents which are currently in the follower state.mstimer

Why they’re important: These metrics allow operators to monitor the health and capacity of raft replication on servers. When Consul is handling large amounts of data and high write throughput it is possible for the cluster to get into the following state:

  • Write throughput is high (say 500 commits per second or more) and constant
  • The leader is writing out a large snapshot every minute or so
  • The snapshot is large enough that it takes considerable time to restore from disk on a restart or from the leader if a follower gets behind
  • Disk IO available allows the leader to write a snapshot faster than it can be restored from disk on a follower

Under these conditions, a follower after a restart may be unable to catch up on replication and become a voter again since it takes longer to restore from disk or the leader than the leader takes to write a new snapshot and truncate its logs. Servers retain raft_trailing_logs (default 10240) log entries even if their snapshot was more recent. On a leader processing 500 commits/second, that is only about 20 seconds worth of logs. Assuming the leader is able to write out a snapshot and truncate the logs in less than 20 seconds, there will only be 20 seconds worth of “recent” logs available on the leader right after the leader has taken a snapshot and never more than about 80 seconds worth assuming it is taking a snapshot and truncating logs every 60 seconds.

In this state, followers must be able to restore a snapshot into memory and resume replication in under 80 seconds otherwise they will never be able to rejoin the cluster until write rates reduce. If they take more than 20 seconds then there will be a chance that they are unlucky with timing when they restart and have to download a snapshot again from the servers one or more times. If they take 50 seconds or more then they will likely fail to catch up more often than they succeed and will remain non-voters for some time until they happen to complete the restore just before the leader truncates its logs.

In the worst case, the follower will be left continually downloading snapshots from the leader which are always too old to use by the time they are restored. This can put additional strain on the leader transferring large snapshots repeatedly as well as reduce the fault tolerance and serving capacity of the cluster.

Since Consul 1.5.3 raft_trailing_logs has been configurable. Increasing it allows the leader to retain more logs and give followers more time to restore and catch up. The tradeoff is potentially slower appends which eventually might affect write throughput and latency negatively so setting it arbitrarily high is not recommended. Before Consul 1.10.0 it required a rolling restart to change this configuration on the leader though and since no followers could restart without loosing health this could mean loosing cluster availability and needing to recover the cluster from a loss of quorum.

Since Consul 1.10.0 raft_trailing_logs is now reloadable with consul reload or SIGHUP allowing operators to increase this without the leader restarting or loosing leadership allowing the cluster to be recovered gracefully.

Monitoring these metrics can help avoid or diagnose this state.

What to look for:

consul.raft.leader.oldestLogAge should look like a saw-tooth wave increasing linearly with time until the leader takes a snapshot and then jumping down as the oldest logs are truncated. The lowest point on that line should remain comfortably higher (i.e. 2x or more) than the time it takes to restore a snapshot.

There are two ways a snapshot can be restored on a follower: from disk on startup or from the leader during an installSnapshot RPC. The leader only sends an installSnapshot RPC if the follower is new and has no state, or if it’s state is too old for it to catch up with the leaders logs.

consul.raft.fsm.lastRestoreDuration shows the time it took to restore from either source the last time it happened. Most of the time this is when the server was started. It’s a gauge that will always show the last restore duration (in Consul 1.10.0 and later) however long ago that was.

consul.raft.rpc.installSnapshot is the timing information from the leader’s perspective when it installs a new snapshot on a follower. It includes the time spent transferring the data as well as the follower restoring it. Since these events are typically infrequent, you may need to graph the last value observed, for example using max_over_time with a large range in Prometheus. While the restore part will also be reflected in lastRestoreDuration, it can be useful to observe this too since the logs need to be able to cover this entire operation including the snapshot delivery to ensure followers can always catch up safely.

Graphing consul.raft.leader.oldestLogAge on the same axes as the other two metrics here can help see at a glance if restore times are creeping dangerously close to the limit of what the leader is retaining at the current write rate.

Note that if servers don’t restart often, then the snapshot could have grown significantly since the last restore happened so last restore times might not reflect what would happen if an agent restarts now.

License Expiration EnterpriseTelemetry - 图1Enterprise

Metric NameDescriptionUnitType
consul.system.licenseExpirationNumber of hours until the Consul Enterprise license will expire.hoursgauge

Why they’re important:

This measurement indicates how many hours are left before the Consul Enterprise license expires. When the license expires some Consul Enterprise features will cease to work. An example of this is that after expiration, it is no longer possible to create or modify resources in non-default namespaces or to manage namespace definitions themselves even though reads of namespaced resources will still work.

What to look for:

This metric should be monitored to ensure that the license doesn’t expire to prevent degradation of functionality.

Bolt DB Performance

Metric NameDescriptionUnitType
consul.raft.boltdb.freelistBytesRepresents the number of bytes necessary to encode the freelist metadata. When raft_logstore.boltdb.no_freelist_sync is set to false these metadata bytes must also be written to disk for each committed log.bytesgauge
consul.raft.boltdb.logsPerBatchMeasures the number of logs being written per batch to the db.logssample
consul.raft.boltdb.storeLogsMeasures the amount of time spent writing logs to the db.mstimer
consul.raft.boltdb.writeCapacityTheoretical write capacity in terms of the number of logs that can be written per second. Each sample outputs what the capacity would be if future batched log write operations were similar to this one. This similarity encompasses 4 things: batch size, byte size, disk performance and boltdb performance. While none of these will be static and its highly likely individual samples of this metric will vary, aggregating this metric over a larger time window should provide a decent picture into how this BoltDB store can performlogs/secondsample

Requirements:

  • Consul 1.11.0+

Why they’re important:

The consul.raft.boltdb.storeLogs metric is a direct indicator of disk write performance of a Consul server. If there are issues with the disk or performance degradations related to Bolt DB, these metrics will show the issue and potentially the cause as well.

What to look for:

The primary thing to look for are increases in the consul.raft.boltdb.storeLogs times. Its value will directly govern an upper limit to the throughput of write operations within Consul.

In Consul each write operation will turn into a single Raft log to be committed. Raft will process these logs and store them within Bolt DB in batches. Each call to store logs within Bolt DB is measured to record how long it took as well as how many logs were contained in the batch. Writing logs in this fashion is serialized so that a subsequent log storage operation can only be started after the previous one completed. The maximum number of log storage operations that can be performed each second is represented with the consul.raft.boltdb.writeCapacity metric. When log storage operations are becoming slower you may not see an immediate decrease in write capacity due to increased batch sizes of the each operation. However, the max batch size allowed is 64 logs. Therefore if the logsPerBatch metric is near 64 and the storeLogs metric is seeing increased time to write each batch to disk, then it is likely that increased write latencies and other errors may occur.

There can be a number of potential issues that can cause this. Often times it could be performance of the underlying disks that is the issue. Other times it may be caused by Bolt DB behavior. Bolt DB keeps track of free space within the raft.db file. When needing to allocate data it will use existing free space first before further expanding the file. By default, Bolt DB will write a data structure containing metadata about free pages within the DB to disk for every log storage operation. Therefore if the free space within the database grows excessively large, such as after a large spike in writes beyond the normal steady state and a subsequent slow down in the write rate, then Bolt DB could end up writing a large amount of extra data to disk for each log storage operation. This has the potential to drastically increase disk write throughput, potentially beyond what the underlying disks can keep up with. To detect this situation you can look at the consul.raft.boltdb.freelistBytes metric. This metric is a count of the extra bytes that are being written for each log storage operation beyond the log data itself. While not a clear indicator of an actual issue, this metric can be used to diagnose why the consul.raft.boltdb.storeLogs metric is high.

If Bolt DB log storage performance becomes an issue and is caused by free list management then setting raft_logstore.boltdb.no_freelist_sync to true in the server’s configuration may help to reduce disk IO and log storage operation times. Disabling free list syncing will however increase the startup time for a server as it must scan the raft.db file for free space instead of loading the already populated free list structure.

Consul includes an experiment backend configuration that you can use instead of BoldDB. Refer to Experimental WAL LogStore backend for more information.

Metrics Reference

This is a full list of metrics emitted by Consul.

MetricDescriptionUnitType
consul.acl.blocked.{check,service}.deregistrationIncrements whenever a deregistration fails for an entity (check or service) is blocked by an ACL.requestscounter
consul.acl.blocked.{check,node,service}.registrationIncrements whenever a registration fails for an entity (check, node or service) is blocked by an ACL.requestscounter
consul.api.httpThis samples how long it takes to service the given HTTP request for the given verb and path. Includes labels for path and method. path does not include details like service or key names, for these an underscore will be present as a placeholder (eg. path=v1.kv._)mstimer
consul.client.rpcIncrements whenever a Consul agent makes an RPC request to a Consul server. This gives a measure of how much a given agent is loading the Consul servers. Currently, this is only generated by agents in client mode, not Consul servers.requestscounter
consul.client.rpc.exceededIncrements whenever a Consul agent makes an RPC request to a Consul server gets rate limited by that agent’s limits configuration. This gives an indication that there’s an abusive application making too many requests on the agent, or that the rate limit needs to be increased. Currently, this only applies to agents in client mode, not Consul servers.rejected requestscounter
consul.client.rpc.failedIncrements whenever a Consul agent makes an RPC request to a Consul server and fails.requestscounter
consul.client.api.catalog_registerIncrements whenever a Consul agent receives a catalog register request.requestscounter
consul.client.api.success.catalog_registerIncrements whenever a Consul agent successfully responds to a catalog register request.requestscounter
consul.client.rpc.error.catalog_registerIncrements whenever a Consul agent receives an RPC error for a catalog register request.errorscounter
consul.client.api.catalog_deregisterIncrements whenever a Consul agent receives a catalog deregister request.requestscounter
consul.client.api.success.catalog_deregisterIncrements whenever a Consul agent successfully responds to a catalog deregister request.requestscounter
consul.client.rpc.error.catalog_deregisterIncrements whenever a Consul agent receives an RPC error for a catalog deregister request.errorscounter
consul.client.api.catalog_datacentersIncrements whenever a Consul agent receives a request to list datacenters in the catalog.requestscounter
consul.client.api.success.catalog_datacentersIncrements whenever a Consul agent successfully responds to a request to list datacenters.requestscounter
consul.client.rpc.error.catalog_datacentersIncrements whenever a Consul agent receives an RPC error for a request to list datacenters.errorscounter
consul.client.api.catalog_nodesIncrements whenever a Consul agent receives a request to list nodes from the catalog.requestscounter
consul.client.api.success.catalog_nodesIncrements whenever a Consul agent successfully responds to a request to list nodes.requestscounter
consul.client.rpc.error.catalog_nodesIncrements whenever a Consul agent receives an RPC error for a request to list nodes.errorscounter
consul.client.api.catalog_servicesIncrements whenever a Consul agent receives a request to list services from the catalog.requestscounter
consul.client.api.success.catalog_servicesIncrements whenever a Consul agent successfully responds to a request to list services.requestscounter
consul.client.rpc.error.catalog_servicesIncrements whenever a Consul agent receives an RPC error for a request to list services.errorscounter
consul.client.api.catalog_service_nodesIncrements whenever a Consul agent receives a request to list nodes offering a service.requestscounter
consul.client.api.success.catalog_service_nodesIncrements whenever a Consul agent successfully responds to a request to list nodes offering a service.requestscounter
consul.client.api.error.catalog_service_nodesIncrements whenever a Consul agent receives an RPC error for request to list nodes offering a service.requestscounter
consul.client.rpc.error.catalog_service_nodesIncrements whenever a Consul agent receives an RPC error for a request to list nodes offering a service.  errorscounter
consul.client.api.catalog_node_servicesIncrements whenever a Consul agent receives a request to list services registered in a node.  requestscounter
consul.client.api.success.catalog_node_servicesIncrements whenever a Consul agent successfully responds to a request to list services in a node.  requestscounter
consul.client.rpc.error.catalog_node_servicesIncrements whenever a Consul agent receives an RPC error for a request to list services in a node.  errorscounter
consul.client.api.catalog_node_service_listIncrements whenever a Consul agent receives a request to list a node’s registered services.requestscounter
consul.client.rpc.error.catalog_node_service_listIncrements whenever a Consul agent receives an RPC error for request to list a node’s registered services.errorscounter
consul.client.api.success.catalog_node_service_listIncrements whenever a Consul agent successfully responds to a request to list a node’s registered services.requestscounter
consul.client.api.catalog_gateway_servicesIncrements whenever a Consul agent receives a request to list services associated with a gateway.requestscounter
consul.client.api.success.catalog_gateway_servicesIncrements whenever a Consul agent successfully responds to a request to list services associated with a gateway.requestscounter
consul.client.rpc.error.catalog_gateway_servicesIncrements whenever a Consul agent receives an RPC error for a request to list services associated with a gateway.errorscounter
consul.runtime.num_goroutinesTracks the number of running goroutines and is a general load pressure indicator. This may burst from time to time but should return to a steady state value.number of goroutinesgauge
consul.runtime.alloc_bytesMeasures the number of bytes allocated by the Consul process. This may burst from time to time but should return to a steady state value.bytesgauge
consul.runtime.heap_objectsMeasures the number of objects allocated on the heap and is a general memory pressure indicator. This may burst from time to time but should return to a steady state value.number of objectsgauge
consul.state.nodesMeasures the current number of nodes registered with Consul. It is only emitted by Consul servers. Added in v1.9.0.number of objectsgauge
consul.state.peeringsMeasures the current number of peerings registered with Consul. It is only emitted by Consul servers. Added in v1.13.0.number of objectsgauge
consul.state.servicesMeasures the current number of unique services registered with Consul, based on service name. It is only emitted by Consul servers. Added in v1.9.0.number of objectsgauge
consul.state.service_instancesMeasures the current number of unique service instances registered with Consul. It is only emitted by Consul servers. Added in v1.9.0.number of objectsgauge
consul.state.kv_entriesMeasures the current number of entries in the Consul KV store. It is only emitted by Consul servers. Added in v1.10.3.number of objectsgauge
consul.state.connect_instancesMeasures the current number of unique mesh service instances registered with Consul labeled by Kind (e.g. connect-proxy, connect-native, etc). Added in v1.10.4number of objectsgauge
consul.state.config_entriesMeasures the current number of configuration entries registered with Consul labeled by Kind (e.g. service-defaults, proxy-defaults, etc). See Configuration Entries for more information. Added in v1.10.4number of objectsgauge
consul.members.clientsMeasures the current number of client agents registered with Consul. It is only emitted by Consul servers. Added in v1.9.6.number of clientsgauge
consul.members.serversMeasures the current number of server agents registered with Consul. It is only emitted by Consul servers. Added in v1.9.6.number of serversgauge
consul.dns.stale_queriesIncrements when an agent serves a query within the allowed stale threshold.queriescounter
consul.dns.ptr_queryMeasures the time spent handling a reverse DNS query for the given node.mstimer
consul.dns.domain_queryMeasures the time spent handling a domain query for the given node.mstimer
consul.system.licenseExpirationEnterprise This measures the number of hours remaining on the agents license.hoursgauge
consul.versionRepresents the Consul version.agentsgauge

Server Health

These metrics are used to monitor the health of the Consul servers.

MetricDescriptionUnitType
consul.acl.ResolveTokenMeasures the time it takes to resolve an ACL token.mstimer
consul.acl.ResolveTokenToIdentityMeasures the time it takes to resolve an ACL token to an Identity. This metric was removed in Consul 1.12. The time will now be reflected in consul.acl.ResolveToken.mstimer
consul.acl.token.cache_hitIncrements if Consul is able to resolve a token’s identity from the cache.cache read opcounter
consul.acl.token.cache_missIncrements if Consul cannot resolve a token’s identity from the cache.cache read opcounter
consul.cache.bypassCounts how many times a request bypassed the cache because no cache-key was provided.countercounter
consul.cache.fetch_successCounts the number of successful fetches by the cache.countercounter
consul.cache.fetch_errorCounts the number of failed fetches by the cache.countercounter
consul.cache.evict_expiredCounts the number of expired entries that are evicted.countercounter
consul.raft.applied_indexRepresents the raft applied index.indexgauge
consul.raft.applyCounts the number of Raft transactions occurring over the interval, which is a general indicator of the write load on the Consul servers.raft transactions / intervalcounter
consul.raft.barrierCounts the number of times the agent has started the barrier i.e the number of times it has issued a blocking call, to ensure that the agent has all the pending operations that were queued, to be applied to the agent’s FSM.blocks / intervalcounter
consul.raft.boltdb.freelistBytesRepresents the number of bytes necessary to encode the freelist metadata. When raft_logstore.boltdb.no_freelist_sync is set to false these metadata bytes must also be written to disk for each committed log.bytesgauge
consul.raft.boltdb.freePageBytesRepresents the number of bytes of free space within the raft.db file.bytesgauge
consul.raft.boltdb.getLogMeasures the amount of time spent reading logs from the db.mstimer
consul.raft.boltdb.logBatchSizeMeasures the total size in bytes of logs being written to the db in a single batch.bytessample
consul.raft.boltdb.logsPerBatchMeasures the number of logs being written per batch to the db.logssample
consul.raft.boltdb.logSizeMeasures the size of logs being written to the db.bytessample
consul.raft.boltdb.numFreePagesRepresents the number of free pages within the raft.db file.pagesgauge
consul.raft.boltdb.numPendingPagesRepresents the number of pending pages within the raft.db that will soon become free.pagesgauge
consul.raft.boltdb.openReadTxnRepresents the number of open read transactions against the dbtransactionsgauge
consul.raft.boltdb.totalReadTxnRepresents the total number of started read transactions against the dbtransactionsgauge
consul.raft.boltdb.storeLogsMeasures the amount of time spent writing logs to the db.mstimer
consul.raft.boltdb.txstats.cursorCountCounts the number of cursors created since Consul was started.cursorscounter
consul.raft.boltdb.txstats.nodeCountCounts the number of node allocations within the db since Consul was started.allocationscounter
consul.raft.boltdb.txstats.nodeDerefCounts the number of node dereferences in the db since Consul was started.dereferencescounter
consul.raft.boltdb.txstats.pageAllocRepresents the number of bytes allocated within the db since Consul was started. Note that this does not take into account space having been freed and reused. In that case, the value of this metric will still increase.bytesgauge
consul.raft.boltdb.txstats.pageCountRepresents the number of pages allocated since Consul was started. Note that this does not take into account space having been freed and reused. In that case, the value of this metric will still increase.pagesgauge
consul.raft.boltdb.txstats.rebalanceCounts the number of node rebalances performed in the db since Consul was started.rebalancescounter
consul.raft.boltdb.txstats.rebalanceTimeMeasures the time spent rebalancing nodes in the db.mstimer
consul.raft.boltdb.txstats.spillCounts the number of nodes spilled in the db since Consul was started.spillscounter
consul.raft.boltdb.txstats.spillTimeMeasures the time spent spilling nodes in the db.mstimer
consul.raft.boltdb.txstats.splitCounts the number of nodes split in the db since Consul was started.splitscounter
consul.raft.boltdb.txstats.writeCounts the number of writes to the db since Consul was started.writescounter
consul.raft.boltdb.txstats.writeTimeMeasures the amount of time spent performing writes to the db.mstimer
consul.raft.boltdb.writeCapacityTheoretical write capacity in terms of the number of logs that can be written per second. Each sample outputs what the capacity would be if future batched log write operations were similar to this one. This similarity encompasses 4 things: batch size, byte size, disk performance and boltdb performance. While none of these will be static and its highly likely individual samples of this metric will vary, aggregating this metric over a larger time window should provide a decent picture into how this BoltDB store can performlogs/secondsample
consul.raft.commitNumLogsMeasures the count of logs processed for application to the FSM in a single batch.logsgauge
consul.raft.commitTimeMeasures the time it takes to commit a new entry to the Raft log on the leader.mstimer
consul.raft.fsm.lastRestoreDurationMeasures the time taken to restore the FSM from a snapshot on an agent restart or from the leader calling installSnapshot. This is a gauge that holds it’s value since most servers only restore during restarts which are typically infrequent.msgauge
consul.raft.fsm.snapshotMeasures the time taken by the FSM to record the current state for the snapshot.mstimer
consul.raft.fsm.applyMeasures the time to apply a log to the FSM.mstimer
consul.raft.fsm.enqueueMeasures the amount of time to enqueue a batch of logs for the FSM to apply.mstimer
consul.raft.fsm.restoreMeasures the time taken by the FSM to restore its state from a snapshot.mstimer
consul.raft.last_indexRepresents the raft applied index.indexgauge
consul.raft.leader.dispatchLogMeasures the time it takes for the leader to write log entries to disk.mstimer
consul.raft.leader.dispatchNumLogsMeasures the number of logs committed to disk in a batch.logsgauge
consul.raft.logstore.verifier.checkpoints_writtenCounts the number of checkpoint entries written to the LogStore.checkpointscounter
consul.raft.logstore.verifier.dropped_reportsCounts how many times the verifier routine was still busy when the next checksum came in and so verification for a range was skipped. If you see this happen, consider increasing the interval between checkpoints with raft_logstore.verification.intervalreports droppedcounter
consul.raft.logstore.verifier.ranges_verifiedCounts the number of log ranges for which a verification report has been completed. Refer to Monitor Raft metrics and logs for WAL for more information.log ranges verificationscounter
consul.raft.logstore.verifier.read_checksum_failuresCounts the number of times a range of logs between two check points contained at least one disk corruption. Refer to Monitor Raft metrics and logs for WAL for more information.disk corruptionscounter
consul.raft.logstore.verifier.write_checksum_failuresCounts the number of times a follower has a different checksum to the leader at the point where it writes to the log. This could be caused by either a disk-corruption on the leader (unlikely) or some other corruption of the log entries in-flight.in-flight corruptionscounter
consul.raft.leader.lastContactMeasures the time since the leader was last able to contact the follower nodes when checking its leader lease. It can be used as a measure for how stable the Raft timing is and how close the leader is to timing out its lease.The lease timeout is 500 ms times the raft_multiplier configuration, so this telemetry value should not be getting close to that configured value, otherwise the Raft timing is marginal and might need to be tuned, or more powerful servers might be needed. See the Server Performance guide for more details.mstimer
consul.raft.leader.oldestLogAgeThe number of milliseconds since the oldest log in the leader’s log store was written. This can be important for replication health where write rate is high and the snapshot is large as followers may be unable to recover from a restart if restoring takes longer than the minimum value for the current leader. Compare this with consul.raft.fsm.lastRestoreDuration and consul.raft.rpc.installSnapshot to monitor. In normal usage this gauge value will grow linearly over time until a snapshot completes on the leader and the log is truncated. Note: this metric won’t be emitted until the leader writes a snapshot. After an upgrade to Consul 1.10.0 it won’t be emitted until the oldest log was written after the upgrade.msgauge
consul.raft.replication.heartbeatMeasures the time taken to invoke appendEntries on a peer, so that it doesn’t timeout on a periodic basis.mstimer
consul.raft.replication.appendEntriesMeasures the time it takes to replicate log entries to followers. This is a general indicator of the load pressure on the Consul servers, as well as the performance of the communication between the servers.mstimer
consul.raft.replication.appendEntries.rpcMeasures the time taken by the append entries RPC to replicate the log entries of a leader agent onto its follower agent(s).mstimer
consul.raft.replication.appendEntries.logsCounts the number of logs replicated to an agent to bring it up to speed with the leader’s logs.logs appended/ intervalcounter
consul.raft.restoreCounts the number of times the restore operation has been performed by the agent. Here, restore refers to the action of raft consuming an external snapshot to restore its state.operation invoked / intervalcounter
consul.raft.restoreUserSnapshotMeasures the time taken by the agent to restore the FSM state from a user’s snapshotmstimer
consul.raft.rpc.appendEntriesMeasures the time taken to process an append entries RPC call from an agent.mstimer
consul.raft.rpc.appendEntries.storeLogsMeasures the time taken to add any outstanding logs for an agent, since the last appendEntries was invokedmstimer
consul.raft.rpc.appendEntries.processLogsMeasures the time taken to process the outstanding log entries of an agent.mstimer
consul.raft.rpc.installSnapshotMeasures the time taken to process the installSnapshot RPC call. This metric should only be seen on agents which are currently in the follower state.mstimer
consul.raft.rpc.processHeartBeatMeasures the time taken to process a heartbeat request.mstimer
consul.raft.rpc.requestVoteMeasures the time taken to process the request vote RPC call.mstimer
consul.raft.snapshot.createMeasures the time taken to initialize the snapshot process.mstimer
consul.raft.snapshot.persistMeasures the time taken to dump the current snapshot taken by the Consul agent to the disk.mstimer
consul.raft.snapshot.takeSnapshotMeasures the total time involved in taking the current snapshot (creating one and persisting it) by the Consul agent.mstimer
consul.serf.snapshot.appendLineMeasures the time taken by the Consul agent to append an entry into the existing log.mstimer
consul.serf.snapshot.compactMeasures the time taken by the Consul agent to compact a log. This operation occurs only when the snapshot becomes large enough to justify the compaction .mstimer
consul.raft.state.candidateIncrements whenever a Consul server starts an election. If this increments without a leadership change occurring it could indicate that a single server is overloaded or is experiencing network connectivity issues.election attempts / intervalcounter
consul.raft.state.leaderIncrements whenever a Consul server becomes a leader. If there are frequent leadership changes this may be indication that the servers are overloaded and aren’t meeting the soft real-time requirements for Raft, or that there are networking problems between the servers.leadership transitions / intervalcounter
consul.raft.state.followerCounts the number of times an agent has entered the follower mode. This happens when a new agent joins the cluster or after the end of a leader election.follower state entered / intervalcounter
consul.raft.transition.heartbeat_timeoutThe number of times an agent has transitioned to the Candidate state, after receive no heartbeat messages from the last known leader.timeouts / intervalcounter
consul.raft.verify_leaderThis metric doesn’t have a direct correlation to the leader change. It just counts the number of times an agent checks if it is still the leader or not. For example, during every consistent read, the check is done. Depending on the load in the system, this metric count can be high as it is incremented each time a consistent read is completed.checks / intervalCounter
consul.raft.wal.head_truncationsCounts how many log entries have been truncated from the head - i.e. the oldest entries. by graphing the rate of change over time you can see individual truncate calls as spikes.logs entries truncatedcounter
consul.raft.wal.last_segment_age_secondsA gauge that is set each time we rotate a segment and describes the number of seconds between when that segment file was first created and when it was sealed. this gives a rough estimate how quickly writes are filling the disk.secondsgauge
consul.raft.wal.log_appendsCounts the number of calls to StoreLog(s) i.e. number of batches of entries appended.callscounter
consul.raft.wal.log_entries_readCounts the number of log entries read.log entries readcounter
consul.raft.wal.log_entries_writtenCounts the number of log entries written.log entries writtencounter
consul.raft.wal.log_entry_bytes_readCounts the bytes of log entry read from segments before decoding. actual bytes read from disk might be higher as it includes headers and index entries and possible secondary reads for large entries that don’t fit in buffers.bytescounter
consul.raft.wal.log_entry_bytes_writtenCounts the bytes of log entry after encoding with Codec. Actual bytes written to disk might be slightly higher as it includes headers and index entries.bytescounter
consul.raft.wal.segment_rotationsCounts how many times we move to a new segment file.rotationscounter
consul.raft.wal.stable_getsCounts how many calls to StableStore.Get or GetUint64.callscounter
consul.raft.wal.stable_setsCounts how many calls to StableStore.Set or SetUint64.callscounter
consul.raft.wal.tail_truncationsCounts how many log entries have been truncated from the head - i.e. the newest entries. by graphing the rate of change over time you can see individual truncate calls as spikes.logs entries truncatedcounter
consul.rpc.accept_connIncrements when a server accepts an RPC connection.connectionscounter
consul.rpc.rate_limit.exceededIncrements whenever an RPC is over a configured rate limit. In permissive mode, the RPC is still allowed to proceed.RPCscounter
consul.rpc.rate_limit.log_droppedIncrements whenever a log that is emitted because an RPC exceeded a rate limit gets dropped because the output buffer is full.log messages droppedcounter
consul.catalog.registerMeasures the time it takes to complete a catalog register operation.mstimer
consul.catalog.deregisterMeasures the time it takes to complete a catalog deregister operation.mstimer
consul.server.isLeaderTrack if a server is a leader(1) or not(0)1 or 0gauge
consul.fsm.registerMeasures the time it takes to apply a catalog register operation to the FSM.mstimer
consul.fsm.deregisterMeasures the time it takes to apply a catalog deregister operation to the FSM.mstimer
consul.fsm.sessionMeasures the time it takes to apply the given session operation to the FSM.mstimer
consul.fsm.kvsMeasures the time it takes to apply the given KV operation to the FSM.mstimer
consul.fsm.tombstoneMeasures the time it takes to apply the given tombstone operation to the FSM.mstimer
consul.fsm.coordinate.batch-updateMeasures the time it takes to apply the given batch coordinate update to the FSM.mstimer
consul.fsm.prepared-queryMeasures the time it takes to apply the given prepared query update operation to the FSM.mstimer
consul.fsm.txnMeasures the time it takes to apply the given transaction update to the FSM.mstimer
consul.fsm.autopilotMeasures the time it takes to apply the given autopilot update to the FSM.mstimer
consul.fsm.persistMeasures the time it takes to persist the FSM to a raft snapshot.mstimer
consul.fsm.intentionMeasures the time it takes to apply an intention operation to the state store.mstimer
consul.fsm.caMeasures the time it takes to apply CA configuration operations to the FSM.mstimer
consul.fsm.ca.leafMeasures the time it takes to apply an operation while signing a leaf certificate.mstimer
consul.fsm.acl.tokenMeasures the time it takes to apply an ACL token operation to the FSM.mstimer
consul.fsm.acl.policyMeasures the time it takes to apply an ACL policy operation to the FSM.mstimer
consul.fsm.acl.bindingruleMeasures the time it takes to apply an ACL binding rule operation to the FSM.mstimer
consul.fsm.acl.authmethodMeasures the time it takes to apply an ACL authmethod operation to the FSM.mstimer
consul.fsm.system_metadataMeasures the time it takes to apply a system metadata operation to the FSM.mstimer
consul.kvs.applyMeasures the time it takes to complete an update to the KV store.mstimer
consul.leader.barrierMeasures the time spent waiting for the raft barrier upon gaining leadership.mstimer
consul.leader.reconcileMeasures the time spent updating the raft store from the serf member information.mstimer
consul.leader.reconcileMemberMeasures the time spent updating the raft store for a single serf member’s information.mstimer
consul.leader.reapTombstonesMeasures the time spent clearing tombstones.mstimer
consul.leader.replication.acl-policies.statusThis will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of ACL policy replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.acl-policies.indexThis will only be emitted by the leader in a secondary datacenter. Increments to the index of ACL policies in the primary datacenter that have been successfully replicated.indexgauge
consul.leader.replication.acl-roles.statusThis will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of ACL role replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.acl-roles.indexThis will only be emitted by the leader in a secondary datacenter. Increments to the index of ACL roles in the primary datacenter that have been successfully replicated.indexgauge
consul.leader.replication.acl-tokens.statusThis will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of ACL token replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.acl-tokens.indexThis will only be emitted by the leader in a secondary datacenter. Increments to the index of ACL tokens in the primary datacenter that have been successfully replicated.indexgauge
consul.leader.replication.config-entries.statusThis will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of config entry replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.config-entries.indexThis will only be emitted by the leader in a secondary datacenter. Increments to the index of config entries in the primary datacenter that have been successfully replicated.indexgauge
consul.leader.replication.federation-state.statusThis will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of federation state replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.federation-state.indexThis will only be emitted by the leader in a secondary datacenter. Increments to the index of federation states in the primary datacenter that have been successfully replicated.indexgauge
consul.leader.replication.namespaces.statusEnterprise This will only be emitted by the leader in a secondary datacenter. The value will be a 1 if the last round of namespace replication was successful or 0 if there was an error.healthygauge
consul.leader.replication.namespaces.indexEnterprise This will only be emitted by the leader in a secondary datacenter. Increments to the index of namespaces in the primary datacenter that have been successfully replicated.indexgauge
consul.prepared-query.applyMeasures the time it takes to apply a prepared query update.mstimer
consul.prepared-query.execute_remoteMeasures the time it takes to process a prepared query execute request that was forwarded to another datacenter.mstimer
consul.prepared-query.executeMeasures the time it takes to process a prepared query execute request.mstimer
consul.prepared-query.explainMeasures the time it takes to process a prepared query explain request.mstimer
consul.rpc.raft_handoffIncrements when a server accepts a Raft-related RPC connection.connectionscounter
consul.rpc.requestIncrements when a server receives a Consul-related RPC request.requestscounter
consul.rpc.request_errorIncrements when a server returns an error from an RPC request.errorscounter
consul.rpc.queryIncrements when a server receives a read RPC request, indicating the rate of new read queries. See consul.rpc.queries_blocking for the current number of in-flight blocking RPC calls. This metric changed in 1.7.0 to only increment on the the start of a query. The rate of queries will appear lower, but is more accurate.queriescounter
consul.rpc.queries_blockingThe current number of in-flight blocking queries the server is handling.queriesgauge
consul.rpc.cross-dcIncrements when a server sends a (potentially blocking) cross datacenter RPC query.queriescounter
consul.rpc.consistentReadMeasures the time spent confirming that a consistent read can be performed.mstimer
consul.session.applyMeasures the time spent applying a session update.mstimer
consul.session.renewMeasures the time spent renewing a session.mstimer
consul.session_ttl.invalidateMeasures the time spent invalidating an expired session.mstimer
consul.txn.applyMeasures the time spent applying a transaction operation.mstimer
consul.txn.readMeasures the time spent returning a read transaction.mstimer
consul.grpc.client.request.countCounts the number of gRPC requests made by the client agent to a Consul server. Includes a server_type label indicating either the internal or external gRPC server.requestscounter
consul.grpc.client.connection.countCounts the number of new gRPC connections opened by the client agent to a Consul server. Includes a server_type label indicating either the internal or external gRPC server.connectionscounter
consul.grpc.client.connectionsMeasures the number of active gRPC connections open from the client agent to any Consul servers. Includes a server_type label indicating either the internal or external gRPC server.connectionsgauge
consul.grpc.server.request.countCounts the number of gRPC requests received by the server. Includes a server_type label indicating either the internal or external gRPC server.requestscounter
consul.grpc.server.connection.countCounts the number of new gRPC connections received by the server. Includes a server_type label indicating either the internal or external gRPC server.connectionscounter
consul.grpc.server.connectionsMeasures the number of active gRPC connections open on the server. Includes a server_type label indicating either the internal or external gRPC server.connectionsgauge
consul.grpc.server.stream.countCounts the number of new gRPC streams received by the server. Includes a server_type label indicating either the internal or external gRPC server.streamscounter
consul.grpc.server.streamsMeasures the number of active gRPC streams handled by the server. Includes a server_type label indicating either the internal or external gRPC server.streamsgauge
consul.xds.server.streamsMeasures the number of active xDS streams handled by the server split by protocol version.streamsgauge
consul.xds.server.streamsUnauthenticatedMeasures the number of active xDS streams handled by the server that are unauthenticated because ACLs are not enabled or ACL tokens were missing.streamsgauge
consul.xds.server.idealStreamsMaxThe maximum number of xDS streams per server, chosen to achieve a roughly even spread of load across servers.streamsgauge
consul.xds.server.streamDrainedCounts the number of xDS streams that are drained when rebalancing the load between servers.streamscounter
consul.xds.server.streamStartMeasures the time taken to first generate xDS resources after an xDS stream is opened.mstimer

Server Workload

Requirements:

  • Consul 1.12.0+

Label based RPC metrics were added in Consul 1.12.0 as a Beta feature to better understand the workload on a Consul server and, where that workload is coming from. The following metric(s) provide that insight

MetricDescriptionUnitType
consul.rpc.server.callMeasures the elapsed time taken to complete an RPC call.mssummary

Labels

The the server workload metrics above come with the following labels:

Label NameDescriptionPossible values
methodThe name of the RPC method.The value of any RPC request in Consul.
erroredIndicates whether the RPC call errored.true or false.
request_typeWhether it is a read or write request.read, write or unreported.
rpc_typeThe RPC implementation.net/rpc or internal.
leaderWhether the server was a leader or not at the time of the request.true, false or unreported.

Label Explanations

The internal value for the rpc_type in the table above refers to leader and cluster management RPC operations that Consul performs. Historically, internal RPC operation metrics were accounted under the same metric names.

The unreported value for the request_type in the table above refers to RPC requests within Consul where it is difficult to ascertain whether a request is read or write type.

The unreported value for the leader label in the table above refers to RPC requests where Consul cannot determine the leadership status for a server.

Read Request Labels

In addition to the labels above, for read requests, the following may be populated:

Label NameDescriptionPossible values
blockingWhether the read request passed in a MinQueryIndex.true if a MinQueryIndex was passed, false otherwise.
target_datacenterThe target datacenter for the read request.The string value of the target datacenter for the request.
localityGives an indication of whether the RPC request is local or has been forwarded.local if current server data center is the same as target_datacenter, otherwise forwarded.

Here is a Prometheus style example of an RPC metric and its labels:

Sample output of telemetry dump

  1. ...
  2. consul_rpc_server_call{errored="false",method="Catalog.ListNodes",request_type="read",rpc_type="net/rpc",quantile="0.5"} 255
  3. ...

Any metric in this section can be turned off with the prefix_filter.

Cluster Health

These metrics give insight into the health of the cluster as a whole. Query for the consul.memberlist.* and consul.serf.* metrics can be appended with certain labels to further distinguish data between different gossip pools. The supported label for OSS is network, while segment, partition, area are allowed for EnterpriseTelemetry - 图5Enterprise.

MetricDescriptionUnitType
consul.memberlist.degraded.probeCounts the number of times the agent has performed failure detection on another agent at a slower probe rate. The agent uses its own health metric as an indicator to perform this action. (If its health score is low, means that the node is healthy, and vice versa.)probes / intervalcounter
consul.memberlist.degraded.timeoutCounts the number of times an agent was marked as a dead node, whilst not getting enough confirmations from a randomly selected list of agent nodes in an agent’s membership.occurrence / intervalcounter
consul.memberlist.msg.deadCounts the number of times an agent has marked another agent to be a dead node.messages / intervalcounter
consul.memberlist.health.scoreDescribes a node’s perception of its own health based on how well it is meeting the soft real-time requirements of the protocol. This metric ranges from 0 to 8, where 0 indicates “totally healthy”. This health score is used to scale the time between outgoing probes, and higher scores translate into longer probing intervals. For more details see section IV of the Lifeguard paper: https://arxiv.org/pdf/1707.00788.pdfscoregauge
consul.memberlist.msg.suspectIncrements when an agent suspects another as failed when executing random probes as part of the gossip protocol. These can be an indicator of overloaded agents, network problems, or configuration errors where agents can not connect to each other on the required ports.suspect messages received / intervalcounter
consul.memberlist.tcp.acceptCounts the number of times an agent has accepted an incoming TCP stream connection.connections accepted / intervalcounter
consul.memberlist.udp.sent/receivedMeasures the total number of bytes sent/received by an agent through the UDP protocol.bytes sent or bytes received / intervalcounter
consul.memberlist.tcp.connectCounts the number of times an agent has initiated a push/pull sync with an other agent.push/pull initiated / intervalcounter
consul.memberlist.tcp.sentMeasures the total number of bytes sent by an agent through the TCP protocolbytes sent / intervalcounter
consul.memberlist.gossipMeasures the time taken for gossip messages to be broadcasted to a set of randomly selected nodes.mstimer
consul.memberlist.msg_aliveCounts the number of alive messages, that the agent has processed so far, based on the message information given by the network layer.messages / Intervalcounter
consul.memberlist.msg_deadThe number of dead messages that the agent has processed so far, based on the message information given by the network layer.messages / Intervalcounter
consul.memberlist.msg_suspectThe number of suspect messages that the agent has processed so far, based on the message information given by the network layer.messages / Intervalcounter
consul.memberlist.node.instancesTracks the number of instances in each of the node states: alive, dead, suspect, and left.nodesgauge
consul.memberlist.probeNodeMeasures the time taken to perform a single round of failure detection on a select agent.nodes / Intervalcounter
consul.memberlist.pushPullNodeMeasures the number of agents that have exchanged state with this agent.nodes / Intervalcounter
consul.memberlist.queue.broadcastsMeasures the number of messages waiting to be broadcast to other gossip participants.messagessample
consul.memberlist.size.localMeasures the size in bytes of the memberlist before it is sent to another gossip recipient.bytesgauge
consul.memberlist.size.remoteMeasures the size in bytes of incoming memberlists from other gossip participants.bytesgauge
consul.serf.member.failedIncrements when an agent is marked dead. This can be an indicator of overloaded agents, network problems, or configuration errors where agents cannot connect to each other on the required ports.failures / intervalcounter
consul.serf.member.flapAvailable in Consul 0.7 and later, this increments when an agent is marked dead and then recovers within a short time period. This can be an indicator of overloaded agents, network problems, or configuration errors where agents cannot connect to each other on the required ports.flaps / intervalcounter
consul.serf.member.joinIncrements when an agent joins the cluster. If an agent flapped or failed this counter also increments when it re-joins.joins / intervalcounter
consul.serf.member.leftIncrements when an agent leaves the cluster.leaves / intervalcounter
consul.serf.eventsIncrements when an agent processes an event. Consul uses events internally so there may be additional events showing in telemetry. There are also a per-event counters emitted as consul.serf.events..events / intervalcounter
consul.serf.events.<type>Breakdown of consul.serf.events by type of event.events / intervalcounter
consul.serf.msgs.sentThis metric is sample of the number of bytes of messages broadcast to the cluster. In a given time interval, the sum of this metric is the total number of bytes sent and the count is the number of messages sent.message bytes / intervalcounter
consul.autopilot.failure_toleranceTracks the number of voting servers that the cluster can lose while continuing to function.serversgauge
consul.autopilot.healthyTracks the overall health of the local server cluster. If all servers are considered healthy by Autopilot, this will be set to 1. If any are unhealthy, this will be 0.booleangauge
consul.session_ttl.activeTracks the active number of sessions being tracked.sessionsgauge
consul.catalog.service.queryIncrements for each catalog query for the given service.queriescounter
consul.catalog.service.query-tagIncrements for each catalog query for the given service with the given tag.queriescounter
consul.catalog.service.query-tagsIncrements for each catalog query for the given service with the given tags.queriescounter
consul.catalog.service.not-foundIncrements for each catalog query where the given service could not be found.queriescounter
consul.catalog.connect.queryIncrements for each mesh-based catalog query for the given service.queriescounter
consul.catalog.connect.query-tagIncrements for each mesh-based catalog query for the given service with the given tag.queriescounter
consul.catalog.connect.query-tagsIncrements for each mesh-based catalog query for the given service with the given tags.queriescounter
consul.catalog.connect.not-foundIncrements for each mesh-based catalog query where the given service could not be found.queriescounter

Service Mesh Built-in Proxy Metrics

Consul service mesh’s built-in proxy is by default configured to log metrics to the same sink as the agent that starts it.

When running in this mode it emits some basic metrics. These will be expanded upon in the future.

All metrics are prefixed with consul.proxy.<proxied-service-id> to distinguish between multiple proxies on a given host. The table below use web as an example service name for brevity.

Labels

Most labels have a dst label and some have a src label. When using metrics sinks and timeseries stores that support labels or tags, these allow aggregating the connections by service name.

Assuming all services are using a managed built-in proxy, you can get a complete overview of both number of open connections and bytes sent and received between all services by aggregating over these metrics.

For example aggregating over all upstream (i.e. outbound) connections which have both src and dst labels, you can get a sum of all the bandwidth in and out of a given service or the total number of connections between two services.

Metrics Reference

The standard go runtime metrics are exported by go-metrics as with Consul agent. The table below describes the additional metrics exported by the proxy.

MetricDescriptionUnitType
consul.proxy.web.runtime.*The same go runtime metrics as documented for the agent above.mixedmixed
consul.proxy.web.inbound.connsShows the current number of connections open from inbound requests to the proxy. Where supported a dst label is added indicating the service name the proxy represents.connectionsgauge
consul.proxy.web.inbound.rx_bytesIncrements by the number of bytes received from an inbound client connection. Where supported a dst label is added indicating the service name the proxy represents.bytescounter
consul.proxy.web.inbound.tx_bytesIncrements by the number of bytes transferred to an inbound client connection. Where supported a dst label is added indicating the service name the proxy represents.bytescounter
consul.proxy.web.upstream.connsShows the current number of connections open from a proxy instance to an upstream. Where supported a src label is added indicating the service name the proxy represents, and a dst label is added indicating the service name the upstream is connecting to.connectionsgauge
consul.proxy.web.inbound.rx_bytesIncrements by the number of bytes received from an upstream connection. Where supported a src label is added indicating the service name the proxy represents, and a dst label is added indicating the service name the upstream is connecting to.bytescounter
consul.proxy.web.inbound.tx_bytesIncrements by the number of bytes transferred to an upstream connection. Where supported a src label is added indicating the service name the proxy represents, and a dst label is added indicating the service name the upstream is connecting to.bytescounter

Peering metrics

Requirements:

  • Consul 1.13.0+

Cluster peering refers to Consul clusters that communicate through a peer connection, as opposed to a federated connection. Consul collects metrics that describe the number of services exported to a peered cluster. Peering metrics are only emitted by the leader server. These metrics are emitted every 9 seconds.

MetricDescriptionUnitType
consul.peering.exported_servicesCounts the number of services exported with exported service configuration entries to a peer cluster.countgauge
consul.peering.healthyTracks the health of a peering connection as reported by the server. If Consul detects errors while sending or receiving from a peer which do not recover within a reasonable time, this metric returns 0. Healthy connections return 1.healthgauge

Labels

Consul attaches the following labels to metric values.

Label NameDescriptionPossible values
peer_nameThe name of the peering on the reporting cluster or leader.Any defined peer name in the cluster
peer_idThe ID of a peer connected to the reporting cluster or leader.Any UUID
partitionEnterprise Name of the partition that the peering is created in.Any defined partition name in the cluster

Server Host Metrics

Consul servers can report the following metrics about the host’s system resources. This feature must be enabled in the agent telemetry configuration. Note that if the Consul server is operating inside a container these metrics still report host resource usage and do not report any resource limits placed on the container.

Requirements:

  • Consul 1.15.3+
MetricDescriptionUnitType
consul.host.memory.totalThe total physical memory in bytesmixedmixed
consul.host.memory.availableThe available physical memory in bytesmixedmixed
consul.host.memory.freeThe free physical memory in bytesmixedmixed
consul.host.memory.usedThe used physical memory in bytesmixedmixed
consul.host.memory.used_percentThe used physical memory as a percentage of total physical memorymixedmixed
consul.host.cpu.totalThe host’s total cpu utilization
consul.host.cpu.userThe cpu utilization in user space
consul.host.cpu.idleThe cpu utilization in idle state
consul.host.cpu.iowaitThe cpu utilization in iowait state
consul.host.cpu.systemThe cpu utilization in system space
consul.host.disk.sizeThe size in bytes of the data_dir disk
consul.host.disk.usedThe number of bytes used on the data_dir disk
consul.host.disk.availableThe number of bytes available on the data_dir disk
consul.host.disk.used_percentThe percentage of disk space used on the data_dir disk
consul.host.disk.inodes_percentThe percentage of inode usage on the data_dir disk
consul.host.uptimeThe uptime of the host in seconds