1---
2layout: "docs"
3page_title: "Telemetry"
4sidebar_current: "docs-agent-telemetry"
5description: |-
6  The Consul agent collects various runtime metrics about the performance of different libraries and subsystems. These metrics are aggregated on a ten second interval and are retained for one minute.
7---
8
9# Telemetry
10
11The Consul agent collects various runtime metrics about the performance of
12different libraries and subsystems. These metrics are aggregated on a ten
13second interval and are retained for one minute.
14
15To view this data, you must send a signal to the Consul process: on Unix,
16this is `USR1` while on Windows it is `BREAK`. Once Consul receives the signal,
17it will dump the current telemetry information to the agent's `stderr`.
18
19This telemetry information can be used for debugging or otherwise
20getting a better view of what Consul is doing.
21
22Additionally, if the [`telemetry` configuration options](/docs/agent/options.html#telemetry)
23are provided, the telemetry information will be streamed to a
24[statsite](http://github.com/armon/statsite) or [statsd](http://github.com/etsy/statsd) server where
25it can be aggregated and flushed to Graphite or any other metrics store. This
26information can also be viewed with the [metrics endpoint](/api/agent.html#view-metrics) in JSON
27format or using [Prometheus](https://prometheus.io/) format.
28
29Below is sample output of a telemetry dump:
30
31```text
32[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.num_goroutines': 19.000
33[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.alloc_bytes': 755960.000
34[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.malloc_count': 7550.000
35[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.free_count': 4387.000
36[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.heap_objects': 3163.000
37[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.total_gc_pause_ns': 1151002.000
38[2014-01-29 10:56:50 -0800 PST][G] 'consul-agent.runtime.total_gc_runs': 4.000
39[2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.agent.ipc.accept': Count: 5 Sum: 5.000
40[2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.agent.ipc.command': Count: 10 Sum: 10.000
41[2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events': Count: 5 Sum: 5.000
42[2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events.foo': Count: 4 Sum: 4.000
43[2014-01-29 10:56:50 -0800 PST][C] 'consul-agent.serf.events.baz': Count: 1 Sum: 1.000
44[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
45[2014-01-29 10:56:50 -0800 PST][S] 'consul-agent.serf.queue.Intent': Count: 10 Sum: 0.000
46[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
47```
48
49# Key Metrics
50
51These are some metrics emitted that can help you understand the health of your cluster at a glance. For a full list of metrics emitted by Consul, see [Metrics Reference](#metrics-reference)
52
53### Transaction timing
54
55| Metric Name              | Description |
56| :----------------------- | :---------- |
57| `consul.kvs.apply`       | This measures the time it takes to complete an update to the KV store. |
58| `consul.txn.apply`       | This measures the time spent applying a transaction operation. |
59| `consul.raft.apply`      | This counts the number of Raft transactions occurring over the interval. |
60| `consul.raft.commitTime` | This measures the time it takes to commit a new entry to the Raft log on the leader. |
61
62**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.
63
64**What to look for:** Deviations (in any of these metrics) of more than 50% from baseline over the previous hour.
65
66### Leadership changes
67
68| Metric Name | Description |
69| :---------- | :---------- |
70| `consul.raft.leader.lastContact` | Measures the time since the leader was last able to contact the follower nodes when checking its leader lease. |
71| `consul.raft.state.candidate` | This increments whenever a Consul server starts an election. |
72| `consul.raft.state.leader` | This increments whenever a Consul server becomes a leader. |
73
74**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.
75
76**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.
77
78### Autopilot
79
80| Metric Name | Description |
81| :---------- | :---------- |
82| `consul.autopilot.healthy` | This tracks 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. |
83
84**Why it's important:** Obviously, you want your cluster to be healthy.
85
86**What to look for:** Alert if `healthy` is 0.
87
88### Memory usage
89
90| Metric Name | Description |
91| :---------- | :---------- |
92| `consul.runtime.alloc_bytes` | This measures the number of bytes allocated by the Consul process. |
93| `consul.runtime.sys_bytes`   | This is the total number of bytes of memory obtained from the OS.  |
94
95**Why they're important:** Consul keeps all of its data in memory. If Consul consumes all available memory, it will crash.
96
97**What to look for:** If `consul.runtime.sys_bytes` exceeds 90% of total avaliable system memory.
98
99### Garbage collection
100
101| Metric Name | Description |
102| :---------- | :---------- |
103| `consul.runtime.total_gc_pause_ns` | Number of nanoseconds consumed by stop-the-world garbage collection (GC) pauses since Consul started. |
104
105**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.
106
107**What to look for:** Warning if `total_gc_pause_ns` exceeds 2 seconds/minute, critical if it exceeds 5 seconds/minute.
108
109**NOTE:** `total_gc_pause_ns` is a cumulative counter, so in order to calculate rates (such as GC/minute),
110you will need to apply a function such as InfluxDB's [`non_negative_difference()`](https://docs.influxdata.com/influxdb/v1.5/query_language/functions/#non-negative-difference).
111
112### Network activity - RPC Count
113
114| Metric Name | Description |
115| :---------- | :---------- |
116| `consul.client.rpc` | Increments whenever a Consul agent in client mode makes an RPC request to a Consul server |
117| `consul.client.rpc.exceeded` | Increments whenever a Consul agent in client mode makes an RPC request to a Consul server gets rate limited by that agent's [`limits`](/docs/agent/options.html#limits) configuration.  |
118| `consul.client.rpc.failed` | Increments whenever a Consul agent in client mode makes an RPC request to a Consul server and fails.  |
119
120**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.
121
122**What to look for:**
123Sudden large changes to the `consul.client.rpc` metrics (greater than 50% deviation from baseline).
124`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
125
126When telemetry is being streamed to an external metrics store, the interval is defined to
127be that store's flush interval. Otherwise, the interval can be assumed to be 10 seconds
128when retrieving metrics from the built-in store using the above described signals.
129
130## Metrics Reference
131
132This is a full list of metrics emitted by Consul.
133
134<table class="table table-bordered table-striped">
135  <tr>
136    <th>Metric</th>
137    <th>Description</th>
138    <th>Unit</th>
139    <th>Type</th>
140  </tr>
141  <tr>
142    <td>`consul.acl.blocked.service.registration`</td>
143    <td>This increments whenever a deregistration fails for a service (blocked by an ACL)</td>
144    <td>requests</td>
145    <td>counter</td>
146  </tr>
147  <tr>
148    <td>`consul.acl.blocked.&lt;check|node|service&gt;.registration`</td>
149    <td>This increments whenever a registration fails for an entity (check, node or service) is blocked by an ACL</td>
150    <td>requests</td>
151    <td>counter</td>
152  </tr>
153  <tr>
154    <td>`consul.client.rpc`</td>
155    <td>This increments whenever a Consul agent in client mode 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.</td>
156    <td>requests</td>
157    <td>counter</td>
158  </tr>
159  <tr>
160    <td>`consul.client.rpc.exceeded`</td>
161    <td>This increments whenever a Consul agent in client mode makes an RPC request to a Consul server gets rate limited by that agent's [`limits`](/docs/agent/options.html#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.</td>
162    <td>rejected requests</td>
163    <td>counter</td>
164  </tr>
165  <tr>
166    <td>`consul.client.rpc.failed`</td>
167    <td>This increments whenever a Consul agent in client mode makes an RPC request to a Consul server and fails.</td>
168    <td>requests</td>
169    <td>counter</td>
170  </tr>
171  <tr>
172    <td>`consul.client.api.catalog_register.<node>`</td>
173    <td>This increments whenever a Consul agent receives a catalog register request.</td>
174    <td>requests</td>
175    <td>counter</td>
176  </tr>
177  <tr>
178    <td>`consul.client.api.success.catalog_register.<node>`</td>
179    <td>This increments whenever a Consul agent successfully responds to a catalog register request.</td>
180    <td>requests</td>
181    <td>counter</td>
182  </tr>
183  <tr>
184    <td>`consul.client.rpc.error.catalog_register.<node>`</td>
185    <td>This increments whenever a Consul agent receives an RPC error for a catalog register request.</td>
186    <td>errors</td>
187    <td>counter</td>
188  </tr>
189  <tr>
190    <td>`consul.client.api.catalog_deregister.<node>`</td>
191    <td>This increments whenever a Consul agent receives a catalog de-register request.</td>
192    <td>requests</td>
193    <td>counter</td>
194  </tr>
195  <tr>
196    <td>`consul.client.api.success.catalog_deregister.<node>`</td>
197    <td>This increments whenever a Consul agent successfully responds to a catalog de-register request.</td>
198    <td>requests</td>
199    <td>counter</td>
200  </tr>
201  <tr>
202    <td>`consul.client.rpc.error.catalog_deregister.<node>`</td>
203    <td>This increments whenever a Consul agent receives an RPC error for a catalog de-register request.</td>
204    <td>errors</td>
205    <td>counter</td>
206  </tr>
207  <tr>
208    <td>`consul.client.api.catalog_datacenters.<node>`</td>
209    <td>This increments whenever a Consul agent receives a request to list datacenters in the catalog.</td>
210    <td>requests</td>
211    <td>counter</td>
212  </tr>
213  <tr>
214    <td>`consul.client.api.success.catalog_datacenters.<node>`</td>
215    <td>This increments whenever a Consul agent successfully responds to a request to list datacenters.</td>
216    <td>requests</td>
217    <td>counter</td>
218  </tr>
219  <tr>
220    <td>`consul.client.rpc.error.catalog_datacenters.<node>`</td>
221    <td>This increments whenever a Consul agent receives an RPC error for a request to list datacenters.</td>
222    <td>errors</td>
223    <td>counter</td>
224  </tr>
225  <tr>
226    <td>`consul.client.api.catalog_nodes.<node>`</td>
227    <td>This increments whenever a Consul agent receives a request to list nodes from the catalog.</td>
228    <td>requests</td>
229    <td>counter</td>
230  </tr>
231  <tr>
232    <td>`consul.client.api.success.catalog_nodes.<node>`</td>
233    <td>This increments whenever a Consul agent successfully responds to a request to list nodes.</td>
234    <td>requests</td>
235    <td>counter</td>
236  </tr>
237  <tr>
238    <td>`consul.client.rpc.error.catalog_nodes.<node>`</td>
239    <td>This increments whenever a Consul agent receives an RPC error for a request to list nodes.</td>
240    <td>errors</td>
241    <td>counter</td>
242  </tr>
243  <tr>
244    <td>`consul.client.api.catalog_services.<node>`</td>
245    <td>This increments whenever a Consul agent receives a request to list services from the catalog.</td>
246    <td>requests</td>
247    <td>counter</td>
248  </tr>
249  <tr>
250    <td>`consul.client.api.success.catalog_services.<node>`</td>
251    <td>This increments whenever a Consul agent successfully responds to a request to list services.</td>
252    <td>requests</td>
253    <td>counter</td>
254  </tr>
255  <tr>
256    <td>`consul.client.rpc.error.catalog_services.<node>`</td>
257    <td>This increments whenever a Consul agent receives an RPC error for a request to list services.</td>
258    <td>errors</td>
259    <td>counter</td>
260  </tr>
261  <tr>
262    <td>`consul.client.api.catalog_service_nodes.<node>`</td>
263    <td>This increments whenever a Consul agent receives a request to list nodes offering a service.</td>
264    <td>requests</td>
265    <td>counter</td>
266  </tr>
267  <tr>
268    <td>`consul.client.api.success.catalog_service_nodes.<node>`</td>
269    <td>This increments whenever a Consul agent successfully responds to a request to list nodes offering a service.</td>
270    <td>requests</td>
271    <td>counter</td>
272  </tr>
273  <tr>
274    <td>`consul.client.rpc.error.catalog_service_nodes.<node>`</td>
275    <td>This increments whenever a Consul agent receives an RPC error for a request to list nodes offering a service.</td>
276    <td>errors</td>
277    <td>counter</td>
278  </tr>
279  <tr>
280    <td>`consul.client.api.catalog_node_services.<node>`</td>
281    <td>This increments whenever a Consul agent receives a request to list services registered in a node.</td>
282    <td>requests</td>
283    <td>counter</td>
284  </tr>
285  <tr>
286    <td>`consul.client.api.success.catalog_node_services.<node>`</td>
287    <td>This increments whenever a Consul agent successfully responds to a request to list services in a service.</td>
288    <td>requests</td>
289    <td>counter</td>
290  </tr>
291  <tr>
292    <td>`consul.client.rpc.error.catalog_node_services.<node>`</td>
293    <td>This increments whenever a Consul agent receives an RPC error for a request to list services in a service.</td>
294    <td>errors</td>
295    <td>counter</td>
296  </tr>
297  <tr>
298    <td>`consul.runtime.num_goroutines`</td>
299    <td>This tracks 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.</td>
300    <td>number of goroutines</td>
301    <td>gauge</td>
302  </tr>
303  <tr>
304    <td>`consul.runtime.alloc_bytes`</td>
305    <td>This measures the number of bytes allocated by the Consul process. This may burst from time to time but should return to a steady state value.</td>
306    <td>bytes</td>
307    <td>gauge</td>
308  </tr>
309  <tr>
310    <td>`consul.runtime.heap_objects`</td>
311    <td>This measures 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.</td>
312    <td>number of objects</td>
313    <td>gauge</td>
314  </tr>
315  <tr>
316    <td>`consul.acl.cache_hit`</td>
317    <td>The number of ACL cache hits.</td>
318    <td>hits</td>
319    <td>counter</td>
320  </tr>
321  <tr>
322    <td>`consul.acl.cache_miss`</td>
323    <td>The number of ACL cache misses.</td>
324    <td>misses</td>
325    <td>counter</td>
326  </tr>
327  <tr>
328    <td>`consul.acl.replication_hit`</td>
329    <td>The number of ACL replication cache hits (when not running in the ACL datacenter).</td>
330    <td>hits</td>
331    <td>counter</td>
332  </tr>
333  <tr>
334    <td>`consul.dns.stale_queries`</td>
335    <td>This increments when an agent serves a query within the allowed stale threshold.</td>
336    <td>queries</td>
337    <td>counter</td>
338  </tr>
339  <tr>
340    <td>`consul.dns.ptr_query.<node>`</td>
341    <td>This measures the time spent handling a reverse DNS query for the given node.</td>
342    <td>ms</td>
343    <td>timer</td>
344  </tr>
345  <tr>
346    <td>`consul.dns.domain_query.<node>`</td>
347    <td>This measures the time spent handling a domain query for the given node.</td>
348    <td>ms</td>
349    <td>timer</td>
350  </tr>
351  <tr>
352    <td>`consul.http.<verb>.<path>`</td>
353    <td>This tracks how long it takes to service the given HTTP request for the given verb and path. Paths do not include details like service or key names, for these an underscore will be present as a placeholder (eg. `consul.http.GET.v1.kv._`)</td>
354    <td>ms</td>
355    <td>timer</td>
356  </tr>
357</table>
358
359## Server Health
360
361These metrics are used to monitor the health of the Consul servers.
362
363<table class="table table-bordered table-striped">
364  <tr>
365    <th>Metric</th>
366    <th>Description</th>
367    <th>Unit</th>
368    <th>Type</th>
369  </tr>
370  <tr>
371    <td>`consul.raft.fsm.snapshot`</td>
372    <td>This metric measures the time taken by the FSM to record the current state for the snapshot.</td>
373    <td>ms</td>
374    <td>timer</td>
375  </tr>
376  <tr>
377    <td>`consul.raft.fsm.apply`</td>
378    <td>This metric gives the number of logs committed since the last interval. </td>
379    <td>commit logs / interval</td>
380    <td>counter</td>
381  </tr>
382  <tr>
383    <td>`consul.raft.fsm.restore`</td>
384    <td>This metric measures the time taken by the FSM to restore its state from a snapshot.</td>
385    <td>ms</td>
386    <td>timer</td>
387  </tr>
388  <tr>
389    <td>`consul.raft.snapshot.create`</td>
390    <td>This metric measures the time taken to initialize the snapshot process.</td>
391    <td>ms</td>
392    <td>timer</td>
393  </tr>
394  <tr>
395    <td>`consul.raft.snapshot.persist`</td>
396    <td>This metric measures the time taken to dump the current snapshot taken by the Consul agent to the disk.</td>
397    <td>ms</td>
398    <td>timer</td>
399  </tr>
400  <tr>
401    <td>`consul.raft.snapshot.takeSnapshot`</td>
402    <td>This metric measures the total time involved in taking the current snapshot (creating one and persisting it) by the Consul agent.</td>
403    <td>ms</td>
404    <td>timer</td>
405  </tr>
406  <tr>
407    <td>`consul.raft.replication.heartbeat`</td>
408    <td>This metric measures the time taken to invoke appendEntries on a peer, so that it doesn’t timeout on a periodic basis.</td>
409    <td>ms</td>
410    <td>timer</td>
411  </tr>
412  <tr>
413    <td>`consul.serf.snapshot.appendLine`</td>
414    <td>This metric measures the time taken by the Consul agent to append an entry into the existing log.</td>
415    <td>ms</td>
416    <td>timer</td>
417  </tr>
418  <tr>
419    <td>`consul.serf.snapshot.compact`</td>
420    <td>This metric measures 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 .</td>
421    <td>ms</td>
422    <td>timer</td>
423  </tr>
424  <tr>
425    <td>`consul.raft.state.leader`</td>
426    <td>This increments 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.</td>
427    <td>leadership transitions / interval</td>
428    <td>counter</td>
429  </tr>
430  <tr>
431    <td>`consul.raft.state.candidate`</td>
432    <td>This increments 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.</td>
433    <td>election attempts / interval</td>
434    <td>counter</td>
435  </tr>
436  <tr>
437    <td>`consul.raft.apply`</td>
438    <td>This counts the number of Raft transactions occurring over the interval, which is a general indicator of the write load on the Consul servers.</td>
439    <td>raft transactions / interval</td>
440    <td>counter</td>
441  </tr>
442  <tr>
443    <td>`consul.raft.barrier`</td>
444    <td>This metric counts the number of times the agent has started the barrier i.e the number of times it has
445    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.</td>
446    <td>blocks / interval</td>
447    <td>counter</td>
448  </tr>
449  <tr>
450    <td>`consul.raft.verify_leader`</td>
451    <td>This metric counts the number of times an agent checks whether it is still the leader or not</td>
452    <td>checks / interval</td>
453    <td>Counter</td>
454  </tr>
455  <tr>
456    <td>`consul.raft.restore`</td>
457    <td>This metric counts 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.</td>
458    <td>operation invoked / interval</td>
459    <td>counter</td>
460  </tr>
461  <tr>
462    <td>`consul.raft.commitTime`</td>
463    <td>This measures the time it takes to commit a new entry to the Raft log on the leader.</td>
464    <td>ms</td>
465    <td>timer</td>
466  </tr>
467  <tr>
468    <td>`consul.raft.leader.dispatchLog`</td>
469    <td>This measures the time it takes for the leader to write log entries to disk.</td>
470    <td>ms</td>
471    <td>timer</td>
472  </tr>
473  <tr>
474    <td>`consul.raft.replication.appendEntries`</td>
475    <td>This measures 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.</td>
476    <td>ms</td>
477    <td>timer</td>
478  </tr>
479  <tr>
480    <td>`consul.raft.state.follower`</td>
481    <td>This metric counts 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.</td>
482    <td> follower state entered / interval</td>
483    <td>counter</td>
484  </tr>
485  <tr>
486    <td>`consul.raft.transistion.heartbeat_timeout`</td>
487    <td>This metric gives the number of times an agent has transitioned to the Candidate state, after receive no heartbeat messages from the last known leader.</td>
488    <td>timeouts / interval</td>
489    <td>counter</td>
490  </tr>
491  <tr>
492    <td>`consul.raft.restoreUserSnapshot`</td>
493    <td>This metric measures the time taken by the agent to restore the FSM state from a user's snapshot</td>
494    <td>ms</td>
495    <td>timer</td>
496  </tr>
497  <tr>
498    <td>`consul.raft.rpc.processHeartBeat`</td>
499    <td>This metric measures the time taken to process a heartbeat request.</td>
500    <td>ms</td>
501    <td>timer</td>
502  </tr>
503  <tr>
504    <td>`consul.raft.rpc.appendEntries`</td>
505    <td>This metric measures the time taken to process an append entries RPC call from an agent.</td>
506    <td>ms</td>
507    <td>timer</td>
508  </tr>
509  <tr>
510    <td>`consul.raft.rpc.appendEntries.storeLogs`</td>
511    <td>This metric measures the time taken to add any outstanding logs for an agent, since the last appendEntries was invoked</td>
512    <td>ms</td>
513    <td>timer</td>
514  </tr>
515  <tr>
516    <td>`consul.raft.rpc.appendEntries.processLogs`</td>
517    <td>This metric measures the time taken to process the outstanding log entries of an agent.</td>
518    <td>ms</td>
519    <td>timer</td>
520  </tr>
521  <tr>
522    <td>`consul.raft.rpc.requestVote`</td>
523    <td>This metric measures the time taken to process the request vote RPC call.</td>
524    <td>ms</td>
525    <td>timer</td>
526  </tr>
527  <tr>
528    <td>`consul.raft.rpc.installSnapshot`</td>
529    <td>This metric measures the time taken to process the installSnapshot RPC call. This metric should only be seen on agents which are currently in the follower state.</td>
530    <td>ms</td>
531    <td>timer</td>
532  </tr>
533  <tr>
534    <td>`consul.raft.replication.appendEntries.rpc`</td>
535    <td>This metric measures the time taken by the append entries RFC, to replicate the log entries of a leader agent onto its follower agent(s)</td>
536    <td>ms</td>
537    <td>timer</td>
538  </tr>
539  <tr>
540    <td>`consul.raft.replication.appendEntries.logs`</td>
541    <td>This metric measures the number of logs replicated to an agent, to bring it upto speed with the leader's logs.</td>
542    <td>logs appended/ interval</td>
543    <td>counter</td>
544  </tr>
545  <tr>
546    <td><a name="last-contact"></a>`consul.raft.leader.lastContact`</td>
547    <td>This will only be emitted by the Raft leader and measures 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.<br><br>The lease timeout is 500 ms times the [`raft_multiplier` configuration](/docs/agent/options.html#raft_multiplier), 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](/docs/guides/performance.html) guide for more details.</td>
548    <td>ms</td>
549    <td>timer</td>
550  </tr>
551  <tr>
552    <td>`consul.acl.apply`</td>
553    <td>This measures the time it takes to complete an update to the ACL store.</td>
554    <td>ms</td>
555    <td>timer</td>
556  </tr>
557  <tr>
558    <td>`consul.acl.fault`</td>
559    <td>This measures the time it takes to fault in the rules for an ACL during a cache miss.</td>
560    <td>ms</td>
561    <td>timer</td>
562  </tr>
563  <tr>
564    <td>`consul.acl.fetchRemoteACLs`</td>
565    <td>This measures the time it takes to fetch remote ACLs during replication.</td>
566    <td>ms</td>
567    <td>timer</td>
568  </tr>
569  <tr>
570    <td>`consul.acl.updateLocalACLs`</td>
571    <td>This measures the time it takes to apply replication changes to the local ACL store.</td>
572    <td>ms</td>
573    <td>timer</td>
574  </tr>
575  <tr>
576    <td>`consul.acl.replicateACLs`</td>
577    <td>This measures the time it takes to do one pass of the ACL replication algorithm.</td>
578    <td>ms</td>
579    <td>timer</td>
580  </tr>
581  <tr>
582    <td>`consul.acl.resolveToken`</td>
583    <td>This measures the time it takes to resolve an ACL token.</td>
584    <td>ms</td>
585    <td>timer</td>
586  </tr>
587  <tr>
588    <td>`consul.rpc.accept_conn`</td>
589    <td>This increments when a server accepts an RPC connection.</td>
590    <td>connections</td>
591    <td>counter</td>
592  </tr>
593  <tr>
594    <td>`consul.catalog.register`</td>
595    <td>This measures the time it takes to complete a catalog register operation.</td>
596    <td>ms</td>
597    <td>timer</td>
598  </tr>
599  <tr>
600    <td>`consul.catalog.deregister`</td>
601    <td>This measures the time it takes to complete a catalog deregister operation.</td>
602    <td>ms</td>
603    <td>timer</td>
604  </tr>
605  <tr>
606    <td>`consul.fsm.register`</td>
607    <td>This measures the time it takes to apply a catalog register operation to the FSM.</td>
608    <td>ms</td>
609    <td>timer</td>
610  </tr>
611  <tr>
612    <td>`consul.fsm.deregister`</td>
613    <td>This measures the time it takes to apply a catalog deregister operation to the FSM.</td>
614    <td>ms</td>
615    <td>timer</td>
616  </tr>
617  <tr>
618    <td>`consul.fsm.acl.<op>`</td>
619    <td>This measures the time it takes to apply the given ACL operation to the FSM.</td>
620    <td>ms</td>
621    <td>timer</td>
622  </tr>
623  <tr>
624    <td>`consul.fsm.session.<op>`</td>
625    <td>This measures the time it takes to apply the given session operation to the FSM.</td>
626    <td>ms</td>
627    <td>timer</td>
628  </tr>
629  <tr>
630    <td>`consul.fsm.kvs.<op>`</td>
631    <td>This measures the time it takes to apply the given KV operation to the FSM.</td>
632    <td>ms</td>
633    <td>timer</td>
634  </tr>
635  <tr>
636    <td>`consul.fsm.tombstone.<op>`</td>
637    <td>This measures the time it takes to apply the given tombstone operation to the FSM.</td>
638    <td>ms</td>
639    <td>timer</td>
640  </tr>
641  <tr>
642    <td>`consul.fsm.coordinate.batch-update`</td>
643    <td>This measures the time it takes to apply the given batch coordinate update to the FSM.</td>
644    <td>ms</td>
645    <td>timer</td>
646  </tr>
647  <tr>
648    <td>`consul.fsm.prepared-query.<op>`</td>
649    <td>This measures the time it takes to apply the given prepared query update operation to the FSM.</td>
650    <td>ms</td>
651    <td>timer</td>
652  </tr>
653  <tr>
654    <td>`consul.fsm.txn`</td>
655    <td>This measures the time it takes to apply the given transaction update to the FSM.</td>
656    <td>ms</td>
657    <td>timer</td>
658  </tr>
659  <tr>
660    <td>`consul.fsm.autopilot`</td>
661    <td>This measures the time it takes to apply the given autopilot update to the FSM.</td>
662    <td>ms</td>
663    <td>timer</td>
664  </tr>
665  <tr>
666    <td>`consul.fsm.persist`</td>
667    <td>This measures the time it takes to persist the FSM to a raft snapshot.</td>
668    <td>ms</td>
669    <td>timer</td>
670  </tr>
671  <tr>
672    <td>`consul.kvs.apply`</td>
673    <td>This measures the time it takes to complete an update to the KV store.</td>
674    <td>ms</td>
675    <td>timer</td>
676  </tr>
677  <tr>
678    <td>`consul.leader.barrier`</td>
679    <td>This measures the time spent waiting for the raft barrier upon gaining leadership.</td>
680    <td>ms</td>
681    <td>timer</td>
682  </tr>
683  <tr>
684    <td>`consul.leader.reconcile`</td>
685    <td>This measures the time spent updating the raft store from the serf member information.</td>
686    <td>ms</td>
687    <td>timer</td>
688  </tr>
689  <tr>
690    <td>`consul.leader.reconcileMember`</td>
691    <td>This measures the time spent updating the raft store for a single serf member's information.</td>
692    <td>ms</td>
693    <td>timer</td>
694  </tr>
695  <tr>
696    <td>`consul.leader.reapTombstones`</td>
697    <td>This measures the time spent clearing tombstones.</td>
698    <td>ms</td>
699    <td>timer</td>
700  </tr>
701  <tr>
702    <td>`consul.prepared-query.apply`</td>
703    <td>This measures the time it takes to apply a prepared query update.</td>
704    <td>ms</td>
705    <td>timer</td>
706  </tr>
707  <tr>
708    <td>`consul.prepared-query.explain`</td>
709    <td>This measures the time it takes to process a prepared query explain request.</td>
710    <td>ms</td>
711    <td>timer</td>
712  </tr>
713  <tr>
714    <td>`consul.prepared-query.execute`</td>
715    <td>This measures the time it takes to process a prepared query execute request.</td>
716    <td>ms</td>
717    <td>timer</td>
718  </tr>
719  <tr>
720    <td>`consul.prepared-query.execute_remote`</td>
721    <td>This measures the time it takes to process a prepared query execute request that was forwarded to another datacenter.</td>
722    <td>ms</td>
723    <td>timer</td>
724  </tr>
725  <tr>
726    <td>`consul.rpc.raft_handoff`</td>
727    <td>This increments when a server accepts a Raft-related RPC connection.</td>
728    <td>connections</td>
729    <td>counter</td>
730  </tr>
731  <tr>
732    <td>`consul.rpc.request_error`</td>
733    <td>This increments when a server returns an error from an RPC request.</td>
734    <td>errors</td>
735    <td>counter</td>
736  </tr>
737  <tr>
738    <td>`consul.rpc.request`</td>
739    <td>This increments when a server receives a Consul-related RPC request.</td>
740    <td>requests</td>
741    <td>counter</td>
742  </tr>
743  <tr>
744    <td>`consul.rpc.query`</td>
745    <td>This increments when a server sends a (potentially blocking) RPC query.</td>
746    <td>queries</td>
747    <td>counter</td>
748  </tr>
749  <tr>
750    <td>`consul.rpc.cross-dc`</td>
751    <td>This increments when a server sends a (potentially blocking) cross datacenter RPC query.</td>
752    <td>queries</td>
753    <td>counter</td>
754  </tr>
755  <tr>
756    <td>`consul.rpc.consistentRead`</td>
757    <td>This measures the time spent confirming that a consistent read can be performed.</td>
758    <td>ms</td>
759    <td>timer</td>
760  </tr>
761  <tr>
762    <td>`consul.session.apply`</td>
763    <td>This measures the time spent applying a session update.</td>
764    <td>ms</td>
765    <td>timer</td>
766  </tr>
767  <tr>
768    <td>`consul.session.renew`</td>
769    <td>This measures the time spent renewing a session.</td>
770    <td>ms</td>
771    <td>timer</td>
772  </tr>
773  <tr>
774    <td>`consul.session_ttl.invalidate`</td>
775    <td>This measures the time spent invalidating an expired session.</td>
776    <td>ms</td>
777    <td>timer</td>
778  </tr>
779  <tr>
780    <td>`consul.txn.apply`</td>
781    <td>This measures the time spent applying a transaction operation.</td>
782    <td>ms</td>
783    <td>timer</td>
784  </tr>
785  <tr>
786    <td>`consul.txn.read`</td>
787    <td>This measures the time spent returning a read transaction.</td>
788    <td>ms</td>
789    <td>timer</td>
790  </tr>
791</table>
792
793## Cluster Health
794
795These metrics give insight into the health of the cluster as a whole.
796
797<table class="table table-bordered table-striped">
798  <tr>
799    <th>Metric</th>
800    <th>Description</th>
801    <th>Unit</th>
802    <th>Type</th>
803  </tr>
804  <tr>
805    <td>`consul.memberlist.degraded.probe`</td>
806    <td>This metric counts the number of times the agent has performed failure detection on an other 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.)</td>
807    <td>probes / interval</td>
808    <td>counter</td>
809  </tr>
810  <tr>
811    <td>`consul.memberlist.degraded.timeout`</td>
812    <td>This metric counts 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.</td>
813    <td>occurrence / interval</td>
814    <td>counter</td>
815  </tr>
816  <tr>
817    <td>`consul.memberlist.msg.dead`</td>
818    <td>This metric counts the number of times an agent has marked another agent to be a dead node.</td>
819    <td>messages / interval</td>
820    <td>counter</td>
821  </tr>
822  <tr>
823    <td>`consul.memberlist.health.score`</td>
824    <td>This metric describes 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.pdf</td>
825    <td>score</td>
826    <td>gauge</td>
827  </tr>
828  <tr>
829    <td>`consul.memberlist.msg.suspect`</td>
830    <td>This increments 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](/docs/agent/options.html#ports).</td>
831    <td>suspect messages received / interval</td>
832    <td>counter</td>
833  </tr>
834  <tr>
835    <td>`consul.memberlist.tcp.accept`</td>
836    <td>This metric counts the number of times an agent has accepted an incoming TCP stream connection.</td>
837    <td>connections accepted / interval</td>
838    <td>counter</td>
839  </tr>
840  <tr>
841    <td>`consul.memberlist.udp.sent/received`</td>
842    <td>This metric measures the total number of bytes sent/received by an agent through the UDP protocol.</td>
843    <td>bytes sent or bytes received / interval</td>
844    <td>counter</td>
845  </tr>
846  <tr>
847    <td>`consul.memberlist.tcp.connect`</td>
848    <td>This metric counts the number of times an agent has initiated a push/pull sync with an other agent.</td>
849    <td>push/pull initiated / interval</td>
850    <td>counter</td>
851  </tr>
852  <tr>
853    <td>`consul.memberlist.tcp.sent`</td>
854    <td>This metric measures the total number of bytes sent by an agent through the TCP protocol</td>
855    <td>bytes sent / interval</td>
856    <td>counter</td>
857  </tr>
858  <tr>
859    <td>`consul.memberlist.gossip`</td>
860    <td>This metric gives the number of gossips (messages) broadcasted to a set of randomly selected nodes.</td>
861    <td>messages / Interval</td>
862    <td>counter</td>
863  </tr>
864  <tr>
865    <td>`consul.memberlist.msg_alive`</td>
866    <td>This metric counts the number of alive agents, that the agent has mapped out so far, based on the message information given by the network layer.</td>
867    <td>nodes / Interval</td>
868    <td>counter</td>
869  </tr>
870  <tr>
871    <td>`consul.memberlist.msg_dead`</td>
872    <td>This metric gives the number of dead agents, that the agent has mapped out so far, based on the message information given by the network layer.</td>
873    <td>nodes / Interval</td>
874    <td>counter</td>
875  </tr>
876  <tr>
877    <td>`consul.memberlist.msg_suspect`</td>
878    <td>This metric gives the number of suspect nodes, that the agent has mapped out so far, based on the message information given by the network layer.</td>
879    <td>nodes / Interval</td>
880    <td>counter</td>
881  </tr>
882  <tr>
883    <td>`consul.memberlist.probeNode`</td>
884    <td>This metric measures the time taken to perform a single round of failure detection on a select agent.</td>
885    <td>nodes / Interval</td>
886    <td>counter</td>
887  </tr>
888  <tr>
889    <td>`consul.memberlist.pushPullNode`</td>
890    <td>This metric measures the number of agents that have exchanged state with this agent.</td>
891    <td>nodes / Interval</td>
892    <td>counter</td>
893  </tr>
894  <tr>
895    <td>`consul.serf.member.flap`</td>
896    <td>Available 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 can not connect to each other on the [required ports](/docs/agent/options.html#ports).</td>
897    <td>flaps / interval</td>
898    <td>counter</td>
899  </tr>
900  <tr>
901    <td>`consul.serf.events`</td>
902    <td>This increments when an agent processes an [event](/docs/commands/event.html). 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.<event name>`.</td>
903    <td>events / interval</td>
904    <td>counter</td>
905  </tr>
906  <tr>
907    <td>`consul.autopilot.failure_tolerance`</td>
908    <td>This tracks the number of voting servers that the cluster can lose while continuing to function.</td>
909    <td>servers</td>
910    <td>gauge</td>
911  </tr>
912  <tr>
913    <td>`consul.autopilot.healthy`</td>
914    <td>This tracks 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.</td>
915    <td>boolean</td>
916    <td>gauge</td>
917  </tr>
918  <tr>
919    <td>`consul.session_ttl.active`</td>
920    <td>This tracks the active number of sessions being tracked.</td>
921    <td>sessions</td>
922    <td>gauge</td>
923  </tr>
924  <tr>
925    <td>`consul.catalog.service.query.<service>`</td>
926    <td>This increments for each catalog query for the given service.</td>
927    <td>queries</td>
928    <td>counter</td>
929  </tr>
930  <tr>
931    <td>`consul.catalog.service.query-tag.<service>.<tag>`</td>
932    <td>This increments for each catalog query for the given service with the given tag.</td>
933    <td>queries</td>
934    <td>counter</td>
935  </tr>
936  <tr>
937    <td>`consul.catalog.service.query-tags.<service>.<tags>`</td>
938    <td>This increments for each catalog query for the given service with the given tags.</td>
939    <td>queries</td>
940    <td>counter</td>
941  </tr>
942  <tr>
943    <td>`consul.catalog.service.not-found.<service>`</td>
944    <td>This increments for each catalog query where the given service could not be found.</td>
945    <td>queries</td>
946    <td>counter</td>
947  </tr>
948  <tr>
949    <td>`consul.health.service.query.<service>`</td>
950    <td>This increments for each health query for the given service.</td>
951    <td>queries</td>
952    <td>counter</td>
953  </tr>
954  <tr>
955    <td>`consul.health.service.query-tag.<service>.<tag>`</td>
956    <td>This increments for each health query for the given service with the given tag.</td>
957    <td>queries</td>
958    <td>counter</td>
959  </tr>
960  <tr>
961    <td>`consul.health.service.query-tags.<service>.<tags>`</td>
962    <td>This increments for each health query for the given service with the given tags.</td>
963    <td>queries</td>
964    <td>counter</td>
965  </tr>
966  <tr>
967    <td>`consul.health.service.not-found.<service>`</td>
968    <td>This increments for each health query where the given service could not be found.</td>
969    <td>queries</td>
970    <td>counter</td>
971  </tr>
972</table>
973
974
975## Connect Built-in Proxy Metrics
976
977Consul Connect's built-in proxy is by default configured to log metrics to the
978same sink as the agent that starts it when running as a [managed
979proxy](/docs/connect/proxies.html#managed-proxies).
980
981When running in this mode it emits some basic metrics. These will be expanded
982upon in the future.
983
984All metrics are prefixed with `consul.proxy.<proxied-service-id>` to distinguish
985between multiple proxies on a given host. The table below use `web` as an
986example service name for brevity.
987
988### Labels
989
990Most labels have a `dst` label and some have a `src` label. When using metrics
991sinks and timeseries stores that support labels or tags, these allow aggregating
992the connections by service name.
993
994Assuming all services are using a managed built-in proxy, you can get a complete
995overview of both number of open connections and bytes sent and recieved between
996all services by aggregating over these metrics.
997
998For example aggregating over all `upstream` (i.e. outbound) connections which
999have both `src` and `dst` labels, you can get a sum of all the bandwidth in and
1000out of a given service or the total number of connections between two services.
1001
1002
1003### Metrics Reference
1004
1005The standard go runtime metrics are exported by `go-metrics` as with Consul
1006agent. The table below describes the additional metrics exported by the proxy.
1007
1008<table class="table table-bordered table-striped">
1009  <tr>
1010    <th>Metric</th>
1011    <th>Description</th>
1012    <th>Unit</th>
1013    <th>Type</th>
1014  </tr>
1015  <tr>
1016    <td>`consul.proxy.web.runtime.*`</td>
1017    <td>The same go runtime metrics as documented for the agent above.</td>
1018    <td>mixed</td>
1019    <td>mixed</td>
1020  </tr>
1021  <tr>
1022    <td>`consul.proxy.web.inbound.conns`</td>
1023    <td>Shows the current number of connections open from inbound requests to
1024    the proxy. Where supported a `dst` label is added indicating the
1025    service name the proxy represents.</td>
1026    <td>connections</td>
1027    <td>gauge</td>
1028  </tr>
1029  <tr>
1030    <td>`consul.proxy.web.inbound.rx_bytes`</td>
1031    <td>This increments by the number of bytes received from an inbound client
1032    connection. Where supported a `dst` label is added indicating the
1033    service name the proxy represents.</td>
1034    <td>bytes</td>
1035    <td>counter</td>
1036  </tr>
1037  <tr>
1038    <td>`consul.proxy.web.inbound.tx_bytes`</td>
1039    <td>This increments by the number of bytes transfered to an inbound client
1040    connection. Where supported a `dst` label is added indicating the
1041    service name the proxy represents.</td>
1042    <td>bytes</td>
1043    <td>counter</td>
1044  </tr>
1045  <tr>
1046    <td>`consul.proxy.web.upstream.conns`</td>
1047    <td>Shows the current number of connections open from a proxy instance to an
1048    upstream. Where supported a `src` label is added indicating the
1049    service name the proxy represents, and a `dst` label is added indicating the
1050    service name the upstream is connecting to.</td>
1051    <td>connections</td>
1052    <td>gauge</td>
1053  </tr>
1054  <tr>
1055    <td>`consul.proxy.web.inbound.rx_bytes`</td>
1056    <td>This increments by the number of bytes received from an upstream
1057    connection. Where supported a `src` label is added indicating the
1058    service name the proxy represents, and a `dst` label is added indicating the
1059    service name the upstream is connecting to.</td>
1060    <td>bytes</td>
1061    <td>counter</td>
1062  </tr>
1063  <tr>
1064    <td>`consul.proxy.web.inbound.tx_bytes`</td>
1065    <td>This increments by the number of bytes transfered to an upstream
1066    connection. Where supported a `src` label is added indicating the
1067    service name the proxy represents, and a `dst` label is added indicating the
1068    service name the upstream is connecting to.</td>
1069    <td>bytes</td>
1070    <td>counter</td>
1071  </tr>
1072</table>
1073