Add metrics labels that describe agent state
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Feature Description
Currently, interpreting metrics about Consul's agents requires understanding the configuration and state of the agent based on the host it's running on. Adding more attributes about agent state, such as its mode: `client` or `server` and its leader status: `leader`, `candidate`, `follower` give operators more granular timeseries in their dashboards. While these two attributes will add cardinality (which is something to be wary of) the attributes are key to contextualizing the metrics that come from Consul. Therefore it should be worthwhile complexity to add.
The proposed attributes are: `agent_mode` and `leader_status` to be added to every metric about agents that we can add them too.
#### Use Case(s)
Additional attributes will export more granular timeseries and allow users to make better queries. Currently, creating an aggregate view of a metric for all servers means directly filtering to each host which contains an agent running in server mode. Attempting the same thing for each client would be even more fraught. In the case of `leader_status`, the leader may migrate to a consul server on a different host. Having a label to filter on makes it possible to have a single predictable query for tracking leader stats, even if it changes.
Contributor guide
Assessment
This issue has not been assessed yet.