From 148243c49519922720fe1b340008dbce8fb02516 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Thu, 14 Aug 2025 14:25:38 -0700 Subject: [PATCH] Update metric help to be more descriptive. (#12764) Signed-off-by: Brad Davidson Co-authored-by: Brad Davidson --- pkg/agent/loadbalancer/metrics.go | 7 ++++--- pkg/certmonitor/certmonitor.go | 2 +- pkg/etcd/snapshot_metrics.go | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pkg/agent/loadbalancer/metrics.go b/pkg/agent/loadbalancer/metrics.go index 11f27486ed..5332cd46ef 100644 --- a/pkg/agent/loadbalancer/metrics.go +++ b/pkg/agent/loadbalancer/metrics.go @@ -9,17 +9,18 @@ import ( var ( loadbalancerConnections = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: version.Program + "_loadbalancer_server_connections", - Help: "Count of current connections to loadbalancer server", + Help: "Count of current connections to loadbalancer server, labeled by loadbalancer name and server address.", }, []string{"name", "server"}) loadbalancerState = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: version.Program + "_loadbalancer_server_health", - Help: "Current health value of loadbalancer server", + Help: "Current health state of loadbalancer backend servers, labeled by loadbalancer name and server address. " + + "State is enum of 0=INVALID, 1=FAILED, 2=STANDBY, 3=UNCHECKED, 4=RECOVERING, 5=HEALTHY, 6=PREFERRED, 7=ACTIVE.", }, []string{"name", "server"}) loadbalancerDials = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_loadbalancer_dial_duration_seconds", - Help: "Time taken to dial a connection to a backend server", + Help: "Time in seconds taken to dial a connection to a backend server, labeled by loadbalancer name and success/failure status.", Buckets: metrics.ExponentialBuckets(0.001, 2, 15), }, []string{"name", "status"}) ) diff --git a/pkg/certmonitor/certmonitor.go b/pkg/certmonitor/certmonitor.go index 607edfc90e..38b97edbf2 100644 --- a/pkg/certmonitor/certmonitor.go +++ b/pkg/certmonitor/certmonitor.go @@ -36,7 +36,7 @@ var ( certificateExpirationSeconds = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: version.Program + "_certificate_expiration_seconds", - Help: "Remaining lifetime on the certificate.", + Help: "Remaining lifetime in seconds of the certificate, labeled by certificate subject and usages.", }, []string{"subject", "usages"}) ) diff --git a/pkg/etcd/snapshot_metrics.go b/pkg/etcd/snapshot_metrics.go index b008e2cbe9..4b197e3d1e 100644 --- a/pkg/etcd/snapshot_metrics.go +++ b/pkg/etcd/snapshot_metrics.go @@ -9,37 +9,37 @@ import ( var ( snapshotSaveCount = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_save_duration_seconds", - Help: "Total time taken to complete the etcd snapshot process", + Help: "Total time in seconds taken to complete the etcd snapshot process, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) snapshotSaveLocalCount = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_save_local_duration_seconds", - Help: "Total time taken to save a local snapshot file", + Help: "Total time in seconds taken to save a local snapshot file, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) snapshotSaveS3Count = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_save_s3_duration_seconds", - Help: "Total time taken to upload a snapshot file to S3", + Help: "Total time in seconds taken to upload a snapshot file to S3, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) snapshotReconcileCount = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_reconcile_duration_seconds", - Help: "Total time taken to sync the list of etcd snapshots", + Help: "Total time in seconds taken to sync the list of etcd snapshots, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) snapshotReconcileLocalCount = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_reconcile_local_duration_seconds", - Help: "Total time taken to list local snapshot files", + Help: "Total time in seconds taken to list local snapshot files, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) snapshotReconcileS3Count = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: version.Program + "_etcd_snapshot_reconcile_s3_duration_seconds", - Help: "Total time taken to list S3 snapshot files", + Help: "Total time in seconds taken to list S3 snapshot files, labeled by success/failure status.", Buckets: metrics.ExponentialBuckets(0.008, 2, 15), }, []string{"status"}) )