From 3359f987acba84898c9234e01cc6b3a7f143b8ef Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:29:09 -0400 Subject: [PATCH] backport of commit 75eebddba9fe7d25aa1b12f6c3633bbf180ee630 (#22477) Co-authored-by: Josh Black --- changelog/22428.txt | 3 --- changelog/22468.txt | 3 +++ physical/raft/raft.go | 2 +- website/content/docs/upgrading/upgrade-to-1.14.x.mdx | 3 ++- .../telemetry-metrics/vault/raft_storage/bolt/write/time.mdx | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 changelog/22428.txt create mode 100644 changelog/22468.txt diff --git a/changelog/22428.txt b/changelog/22428.txt deleted file mode 100644 index 6ed4bef15..000000000 --- a/changelog/22428.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:bug -core/metrics: vault.raft_storage.bolt.write.time should be a gauge not a summary -``` diff --git a/changelog/22468.txt b/changelog/22468.txt new file mode 100644 index 000000000..538da1482 --- /dev/null +++ b/changelog/22468.txt @@ -0,0 +1,3 @@ +```release-note:bug +core/metrics: vault.raft_storage.bolt.write.time should be a counter not a summary +``` diff --git a/physical/raft/raft.go b/physical/raft/raft.go index 3849fcd8c..bfb4139b2 100644 --- a/physical/raft/raft.go +++ b/physical/raft/raft.go @@ -671,7 +671,7 @@ func (b *RaftBackend) collectMetricsWithStats(stats bolt.Stats, sink *metricsuti sink.SetGaugeWithLabels([]string{"raft_storage", "bolt", "spill", "count"}, float32(txstats.GetSpill()), labels) sink.AddSampleWithLabels([]string{"raft_storage", "bolt", "spill", "time"}, float32(txstats.GetSpillTime().Milliseconds()), labels) sink.SetGaugeWithLabels([]string{"raft_storage", "bolt", "write", "count"}, float32(txstats.GetWrite()), labels) - sink.SetGaugeWithLabels([]string{"raft_storage", "bolt", "write", "time"}, float32(txstats.GetWriteTime().Milliseconds()), labels) + sink.IncrCounterWithLabels([]string{"raft_storage", "bolt", "write", "time"}, float32(txstats.GetWriteTime().Milliseconds()), labels) } // RaftServer has information about a server in the Raft configuration diff --git a/website/content/docs/upgrading/upgrade-to-1.14.x.mdx b/website/content/docs/upgrading/upgrade-to-1.14.x.mdx index 9877bcd3b..86d9709e0 100644 --- a/website/content/docs/upgrading/upgrade-to-1.14.x.mdx +++ b/website/content/docs/upgrading/upgrade-to-1.14.x.mdx @@ -28,7 +28,8 @@ Official images separately. ## Important changes -There are no major changes to announce at this time. +`vault.raft_storage.bolt.write.time` has been corrected from a summary to a counter to more accurately reflect that it +is measuring cumulative time writing, and not the distribution of individual write times. ## Known issues and workarounds diff --git a/website/content/partials/telemetry-metrics/vault/raft_storage/bolt/write/time.mdx b/website/content/partials/telemetry-metrics/vault/raft_storage/bolt/write/time.mdx index e31041145..b2c245797 100644 --- a/website/content/partials/telemetry-metrics/vault/raft_storage/bolt/write/time.mdx +++ b/website/content/partials/telemetry-metrics/vault/raft_storage/bolt/write/time.mdx @@ -2,4 +2,4 @@ Metric type | Value | Description ----------- | ----- | ----------- -gauge | ms | Total time the Bolt database has spent writing to disk +counter | ms | Total cumulative time the Bolt database has spent writing to disk.