From fcec25de4047d86a220de0eaa18a112b9969c256 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Mon, 23 Nov 2020 12:42:51 -0800 Subject: [PATCH] add entries for missing fsm operations and mark duplicated metrics prefixes as deprecated --- agent/consul/fsm/commands_oss.go | 31 +++++++++++++++----------- website/pages/docs/agent/telemetry.mdx | 8 +++++++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/agent/consul/fsm/commands_oss.go b/agent/consul/fsm/commands_oss.go index fae5eb1a81..d637a366d7 100644 --- a/agent/consul/fsm/commands_oss.go +++ b/agent/consul/fsm/commands_oss.go @@ -53,43 +53,43 @@ var CommandsSummaries = []prometheus.SummaryDefinition{ }, { Name: []string{"consul", "fsm", "intention"}, - Help: "", + Help: "Deprecated - use fsm_intention instead", }, { Name: []string{"fsm", "intention"}, - Help: "", + Help: "Measures the time it takes to apply an intention operation to the FSM.", }, { Name: []string{"consul", "fsm", "ca"}, - Help: "", + Help: "Deprecated - use fsm_ca instead", + }, + { + Name: []string{"fsm", "ca"}, + Help: "Measures the time it takes to apply CA configuration operations to the FSM.", }, { Name: []string{"fsm", "ca", "leaf"}, - Help: "", + Help: "Measures the time it takes to apply an operation while signing a leaf certificate.", }, { Name: []string{"fsm", "acl", "token"}, - Help: "", - }, - { - Name: []string{"fsm", "ca", "leaf"}, - Help: "", + Help: "Measures the time it takes to apply an ACL token operation to the FSM.", }, { Name: []string{"fsm", "acl", "policy"}, - Help: "", + Help: "Measures the time it takes to apply an ACL policy operation to the FSM.", }, { Name: []string{"fsm", "acl", "bindingrule"}, - Help: "", + Help: "Measures the time it takes to apply an ACL binding rule operation to the FSM.", }, { Name: []string{"fsm", "acl", "authmethod"}, - Help: "", + Help: "Measures the time it takes to apply an ACL authmethod operation to the FSM.", }, { Name: []string{"fsm", "system_metadata"}, - Help: "", + Help: "Measures the time it takes to apply a system metadata operation to the FSM.", }, // TODO(kit): We generate the config-entry fsm summaries by reading off of the request. It is // possible to statically declare these when we know all of the names, but I didn't get to it @@ -378,8 +378,12 @@ func (c *FSM) applyIntentionOperation(buf []byte, index uint64) interface{} { panic(fmt.Errorf("failed to decode request: %v", err)) } + // TODO(kit): We should deprecate this first metric that writes the metrics_prefix itself, + // the config we use to flag this out, telemetry.disable_compat_1.9 is on the agent - how do + // we access it here? defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "intention"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) + defer metrics.MeasureSinceWithLabels([]string{"fsm", "intention"}, time.Now(), []metrics.Label{{Name: "op", Value: string(req.Op)}}) @@ -474,6 +478,7 @@ func (c *FSM) applyConnectCAOperation(buf []byte, index uint64) interface{} { } } +// applyConnectCALeafOperation applies an operation while signing a leaf certificate. func (c *FSM) applyConnectCALeafOperation(buf []byte, index uint64) interface{} { var req structs.CALeafRequest if err := structs.Decode(buf, &req); err != nil { diff --git a/website/pages/docs/agent/telemetry.mdx b/website/pages/docs/agent/telemetry.mdx index 2ed0254e01..a05222143f 100644 --- a/website/pages/docs/agent/telemetry.mdx +++ b/website/pages/docs/agent/telemetry.mdx @@ -243,6 +243,14 @@ These metrics are used to monitor the health of the Consul servers. | `consul.fsm.txn` | This measures the time it takes to apply the given transaction update to the FSM. | ms | timer | | `consul.fsm.autopilot` | This measures the time it takes to apply the given autopilot update to the FSM. | ms | timer | | `consul.fsm.persist` | This measures the time it takes to persist the FSM to a raft snapshot. | ms | timer | +| `consul.fsm.intention` | Measures the time it takes to apply an intention operation to the state store. | ms | timer | +| `consul.fsm.ca` | Measures the time it takes to apply CA configuration operations to the FSM. | ms | timer | +| `consul.fsm.ca.leaf` | Measures the time it takes to apply an operation while signing a leaf certificate. | ms | timer | +| `consul.fsm.acl.token` | Measures the time it takes to apply an ACL token operation to the FSM. | ms | timer | +| `consul.fsm.acl.policy` | Measures the time it takes to apply an ACL policy operation to the FSM. | ms | timer | +| `consul.fsm.acl.bindingrule` | Measures the time it takes to apply an ACL binding rule operation to the FSM. | ms | timer | +| `consul.fsm.acl.authmethod` | Measures the time it takes to apply an ACL authmethod operation to the FSM. | ms | timer | +| `consul.fsm.system_metadata` | Measures the time it takes to apply a system metadata operation to the FSM. | ms | timer | | `consul.kvs.apply` | This measures the time it takes to complete an update to the KV store. | ms | timer | | `consul.leader.barrier` | This measures the time spent waiting for the raft barrier upon gaining leadership. | ms | timer | | `consul.leader.reconcile` | This measures the time spent updating the raft store from the serf member information. | ms | timer |