Skip to content

Commit

Permalink
Update metric docs from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweav committed Jan 17, 2025
1 parent 1836ff1 commit 8d63bd0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions pkg/alertmanager/alertmanager_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8d63bd0

Please sign in to comment.