From 8d63bd055a4dc046c20a372a539f41c5367ec700 Mon Sep 17 00:00:00 2001 From: Alex Weaver Date: Fri, 17 Jan 2025 08:54:47 -0600 Subject: [PATCH] Update metric docs from upstream --- pkg/alertmanager/alertmanager.go | 2 +- pkg/alertmanager/alertmanager_metrics.go | 2 +- pkg/alertmanager/alertmanager_metrics_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/alertmanager/alertmanager.go b/pkg/alertmanager/alertmanager.go index fd50f5b909b..5d26df91372 100644 --- a/pkg/alertmanager/alertmanager.go +++ b/pkg/alertmanager/alertmanager.go @@ -202,7 +202,7 @@ func New(cfg *Config, reg *prometheus.Registry) (*Alertmanager, error) { maintenanceStop: make(chan struct{}), configHashMetric: promauto.With(reg).NewGauge(prometheus.GaugeOpts{ Name: "alertmanager_config_hash", - Help: "Hash of the currently loaded alertmanager configuration.", + Help: "Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash.", }), rateLimitedNotifications: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{ diff --git a/pkg/alertmanager/alertmanager_metrics.go b/pkg/alertmanager/alertmanager_metrics.go index 73973ac4a97..494de452942 100644 --- a/pkg/alertmanager/alertmanager_metrics.go +++ b/pkg/alertmanager/alertmanager_metrics.go @@ -197,7 +197,7 @@ func newAlertmanagerMetrics(logger log.Logger) *alertmanagerMetrics { []string{"user", "state"}, nil), configHashValue: prometheus.NewDesc( "cortex_alertmanager_config_hash", - "Hash of the currently loaded alertmanager configuration.", + "Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash.", []string{"user"}, nil), partialMerges: prometheus.NewDesc( "cortex_alertmanager_partial_state_merges_total", diff --git a/pkg/alertmanager/alertmanager_metrics_test.go b/pkg/alertmanager/alertmanager_metrics_test.go index 52e08910b24..527f65ed8bf 100644 --- a/pkg/alertmanager/alertmanager_metrics_test.go +++ b/pkg/alertmanager/alertmanager_metrics_test.go @@ -61,7 +61,7 @@ func TestAlertmanagerMetricsStore(t *testing.T) { cortex_alertmanager_alerts_received_total{user="user1"} 10 cortex_alertmanager_alerts_received_total{user="user2"} 100 cortex_alertmanager_alerts_received_total{user="user3"} 1000 - # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. + # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash. # TYPE cortex_alertmanager_config_hash gauge cortex_alertmanager_config_hash{user="user1"} 0 cortex_alertmanager_config_hash{user="user2"} 0 @@ -389,7 +389,7 @@ func TestAlertmanagerMetricsRemoval(t *testing.T) { cortex_alertmanager_alerts_received_total{user="user2"} 100 cortex_alertmanager_alerts_received_total{user="user3"} 1000 - # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. + # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash. # TYPE cortex_alertmanager_config_hash gauge cortex_alertmanager_config_hash{user="user1"} 0 cortex_alertmanager_config_hash{user="user2"} 0 @@ -720,7 +720,7 @@ func TestAlertmanagerMetricsRemoval(t *testing.T) { cortex_alertmanager_alerts_received_total{user="user1"} 10 cortex_alertmanager_alerts_received_total{user="user2"} 100 - # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. + # HELP cortex_alertmanager_config_hash Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash. # TYPE cortex_alertmanager_config_hash gauge cortex_alertmanager_config_hash{user="user1"} 0 cortex_alertmanager_config_hash{user="user2"} 0 @@ -987,7 +987,7 @@ func populateAlertmanager(base float64) *prometheus.Registry { reg := prometheus.NewRegistry() promauto.With(reg).NewGauge(prometheus.GaugeOpts{ Name: "alertmanager_config_hash", - Help: "Hash of the currently loaded alertmanager configuration.", + Help: "Hash of the currently loaded alertmanager configuration. Note that this is not a cryptographically strong hash.", }) s := newSilenceMetrics(reg)