From 25f9e232af86d3ffc2e5238bf5ab5a618585ab25 Mon Sep 17 00:00:00 2001 From: Hans Hasselberg Date: Mon, 23 Nov 2020 22:06:30 +0100 Subject: [PATCH] add missing descriptions for metrics --- agent/cache/cache.go | 10 +++++----- agent/consul/catalog_endpoint.go | 8 ++++---- agent/consul/session_ttl.go | 6 +++--- website/pages/docs/agent/telemetry.mdx | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/agent/cache/cache.go b/agent/cache/cache.go index 62dc8619b..b8d77f7a3 100644 --- a/agent/cache/cache.go +++ b/agent/cache/cache.go @@ -37,7 +37,7 @@ import ( var Gauges = []prometheus.GaugeDefinition{ { Name: []string{"consul", "cache", "entries_count"}, - Help: "", + Help: "Represents the number of entries in this cache.", }, } @@ -45,19 +45,19 @@ var Gauges = []prometheus.GaugeDefinition{ var Counters = []prometheus.CounterDefinition{ { Name: []string{"consul", "cache", "bypass"}, - Help: "", + Help: "Counts how many times a request bypassed the cache because no cache-key was provided.", }, { Name: []string{"consul", "cache", "fetch_success"}, - Help: "", + Help: "Counts the number of successful fetches by the cache.", }, { Name: []string{"consul", "cache", "fetch_error"}, - Help: "", + Help: "Counts the number of failed fetches by the cache.", }, { Name: []string{"consul", "cache", "evict_expired"}, - Help: "", + Help: "Counts the number of expired entries that are evicted.", }, } diff --git a/agent/consul/catalog_endpoint.go b/agent/consul/catalog_endpoint.go index f5d5b5633..4641db2d9 100644 --- a/agent/consul/catalog_endpoint.go +++ b/agent/consul/catalog_endpoint.go @@ -25,7 +25,7 @@ var CatalogCounters = []prometheus.CounterDefinition{ }, { Name: []string{"catalog", "connect", "query"}, - Help: "", + Help: "Increments for each connect-based catalog query for the given service.", }, { Name: []string{"catalog", "service", "query-tag"}, @@ -33,7 +33,7 @@ var CatalogCounters = []prometheus.CounterDefinition{ }, { Name: []string{"catalog", "connect", "query-tag"}, - Help: "", + Help: "Increments for each connect-based catalog query for the given service with the given tag.", }, { Name: []string{"catalog", "service", "query-tags"}, @@ -41,7 +41,7 @@ var CatalogCounters = []prometheus.CounterDefinition{ }, { Name: []string{"catalog", "connect", "query-tags"}, - Help: "", + Help: "Increments for each connect-based catalog query for the given service with the given tags.", }, { Name: []string{"catalog", "service", "not-found"}, @@ -49,7 +49,7 @@ var CatalogCounters = []prometheus.CounterDefinition{ }, { Name: []string{"catalog", "connect", "not-found"}, - Help: "", + Help: "Increments for each connect-based catalog query where the given service could not be found.", }, } diff --git a/agent/consul/session_ttl.go b/agent/consul/session_ttl.go index 15c77a24a..27f7d79d4 100644 --- a/agent/consul/session_ttl.go +++ b/agent/consul/session_ttl.go @@ -16,11 +16,11 @@ var SessionGauges = []prometheus.GaugeDefinition{ }, { Name: []string{"raft", "applied_index"}, - Help: "", + Help: "Represents the raft applied index.", }, { Name: []string{"raft", "last_index"}, - Help: "", + Help: "Represents the raft last index.", }, } @@ -153,7 +153,7 @@ func (s *Server) clearAllSessionTimers() { s.sessionTimers.StopAll() } -// updateMetrics is a long running routine used to uddate a +// updateMetrics is a long running routine used to update a // number of server periodic metrics func (s *Server) updateMetrics() { for { diff --git a/website/pages/docs/agent/telemetry.mdx b/website/pages/docs/agent/telemetry.mdx index a05222143..3fb3b3505 100644 --- a/website/pages/docs/agent/telemetry.mdx +++ b/website/pages/docs/agent/telemetry.mdx @@ -194,8 +194,12 @@ These metrics are used to monitor the health of the Consul servers. | `consul.acl.resolveTokenLegacy` | This measures the time it takes to resolve an ACL token using the legacy ACL system. | ms | timer | | `consul.acl.ResolveToken` | This measures the time it takes to resolve an ACL token. | ms | timer | | `consul.acl.ResolveTokenToIdentity` | This measures the time it takes to resolve an ACL token to an Identity. | ms | timer | -| `consul.acl.token.cache_hit` | Increments if Consul is able to resolve a token's identity, or a legacy token, from the cache. | cache read op | counter | -| `consul.acl.token.cache_miss` | Increments if Consul cannot resolve a token's identity, or a legacy token, from the cache. | cache read op | counter | +| `consul.acl.token.cache_hit` | Increments if Consul is able to resolve a token's identity, or a legacy token, from the cache. | cache read op | counter | +| `consul.acl.token.cache_miss` | Increments if Consul cannot resolve a token's identity, or a legacy token, from the cache. | cache read op | counter | +| `consul.cache.bypass` | Counts how many times a request bypassed the cache because no cache-key was provided. | counter | counter | +| `consul.cache.fetch_success` | Counts the number of successful fetches by the cache. | counter | counter | +| `consul.cache.fetch_error` | Counts the number of failed fetches by the cache. | counter | counter | +| `consul.cache.evict_expired` | Counts the number of expired entries that are evicted. | counter | counter | | `consul.raft.fsm.snapshot` | This metric measures the time taken by the FSM to record the current state for the snapshot. | ms | timer | | `consul.raft.fsm.apply` | This metric gives the number of logs committed since the last interval. | commit logs / interval | counter | | `consul.raft.commitNumLogs` | This metric measures the count of logs processed for application to the FSM in a single batch. | logs | gauge | @@ -207,6 +211,8 @@ These metrics are used to monitor the health of the Consul servers. | `consul.raft.replication.heartbeat` | This metric measures the time taken to invoke appendEntries on a peer, so that it doesn’t timeout on a periodic basis. | ms | timer | | `consul.serf.snapshot.appendLine` | This metric measures the time taken by the Consul agent to append an entry into the existing log. | ms | timer | | `consul.serf.snapshot.compact` | 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 . | ms | timer | +| `consul.raft.applied_index` | Represents the raft applied index. | index | gauge | +| `consul.raft.last_index` | Represents the raft applied index. | index | gauge | | `consul.raft.state.leader` | 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. | leadership transitions / interval | counter | | `consul.raft.state.candidate` | 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. | election attempts / interval | counter | | `consul.raft.apply` | This counts the number of Raft transactions occurring over the interval, which is a general indicator of the write load on the Consul servers. | raft transactions / interval | counter | @@ -314,6 +320,10 @@ These metrics give insight into the health of the cluster as a whole. | `consul.catalog.service.query-tag..` | This increments for each catalog query for the given service with the given tag. | queries | counter | | `consul.catalog.service.query-tags..` | This increments for each catalog query for the given service with the given tags. | queries | counter | | `consul.catalog.service.not-found.` | This increments for each catalog query where the given service could not be found. | queries | counter | +| `consul.catalog.connect.query.` | This increments for each connect-based catalog query for the given service. | queries | counter | +| `consul.catalog.connect.query-tag..` | This increments for each connect-based catalog query for the given service with the given tag. | queries | counter | +| `consul.catalog.connect.query-tags..` | This increments for each connect-based catalog query for the given service with the given tags. | queries | counter | +| `consul.catalog.connect.not-found.` | This increments for each connect-based catalog query where the given service could not be found. | queries | counter | ## Connect Built-in Proxy Metrics