Skip to content

Commit 1b23be8

Browse files
committed
Review comments.
Signed-off-by: Steve Simpson <[email protected]>
1 parent 18da771 commit 1b23be8

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

pkg/alertmanager/alertmanager_metrics.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ func newAlertmanagerMetrics() *alertmanagerMetrics {
176176
"Number of times we have failed to replicate a state to other alertmanagers",
177177
[]string{"user"}, nil),
178178
fetchReplicaStateTotal: prometheus.NewDesc(
179-
"cortex_alertmanager_fetch_replica_state_total",
179+
"cortex_alertmanager_state_fetch_replica_state_total",
180180
"Number of times we have tried to read and merge the full state from another replica.",
181181
[]string{"user"}, nil),
182182
fetchReplicaStateFailed: prometheus.NewDesc(
183-
"cortex_alertmanager_fetch_replica_state_failed_total",
183+
"cortex_alertmanager_state_fetch_replica_state_failed_total",
184184
"Number of times we have failed to read and merge the full state from another replica.",
185185
[]string{"user"}, nil),
186186
initialSyncTotal: prometheus.NewDesc(
@@ -290,8 +290,8 @@ func (m *alertmanagerMetrics) Collect(out chan<- prometheus.Metric) {
290290
data.SendSumOfCountersPerUser(out, m.partialMergesFailed, "alertmanager_partial_state_merges_failed_total")
291291
data.SendSumOfCountersPerUser(out, m.replicationTotal, "alertmanager_state_replication_total")
292292
data.SendSumOfCountersPerUser(out, m.replicationFailed, "alertmanager_state_replication_failed_total")
293-
data.SendSumOfCountersPerUser(out, m.fetchReplicaStateTotal, "alertmanager_fetch_replica_state_total")
294-
data.SendSumOfCountersPerUser(out, m.fetchReplicaStateFailed, "alertmanager_fetch_replica_state_failed_total")
293+
data.SendSumOfCountersPerUser(out, m.fetchReplicaStateTotal, "alertmanager_state_fetch_replica_state_total")
294+
data.SendSumOfCountersPerUser(out, m.fetchReplicaStateFailed, "alertmanager_state_fetch_replica_state_failed_total")
295295
data.SendSumOfCountersPerUser(out, m.initialSyncTotal, "alertmanager_state_initial_sync_total")
296296
data.SendSumOfCountersPerUserWithLabels(out, m.initialSyncCompleted, "alertmanager_state_replication_total", "outcome")
297297
data.SendSumOfHistograms(out, m.initialSyncDuration, "alertmanager_state_initial_sync_duration_seconds")

pkg/alertmanager/state_persister.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func newStatePersister(cfg PersisterConfig, userID string, state PersistableStat
7272
timeout: defaultPersistTimeout,
7373
persistTotal: promauto.With(r).NewCounter(prometheus.CounterOpts{
7474
Name: "alertmanager_state_persist_total",
75-
Help: "Number of times we have tried to persist the running state to storage.",
75+
Help: "Number of times we have tried to persist the running state to remote storage.",
7676
}),
7777
persistFailed: promauto.With(r).NewCounter(prometheus.CounterOpts{
7878
Name: "alertmanager_state_persist_failed_total",
79-
Help: "Number of times we have failed to persist the running state to storage.",
79+
Help: "Number of times we have failed to persist the running state to remote storage.",
8080
}),
8181
}
8282

pkg/alertmanager/state_replication.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,24 @@ func newReplicatedStates(userID string, rf int, re Replicator, st alertstore.Ale
9393
Help: "Number of times we have failed to replicate a state to other alertmanagers.",
9494
}, []string{"key"}),
9595
fetchReplicaStateTotal: promauto.With(r).NewCounter(prometheus.CounterOpts{
96-
Name: "alertmanager_fetch_replica_state_total",
96+
Name: "alertmanager_state_fetch_replica_state_total",
9797
Help: "Number of times we have tried to read and merge the full state from another replica.",
9898
}),
9999
fetchReplicaStateFailed: promauto.With(r).NewCounter(prometheus.CounterOpts{
100-
Name: "alertmanager_fetch_replica_state_failed_total",
100+
Name: "alertmanager_state_fetch_replica_state_failed_total",
101101
Help: "Number of times we have failed to read and merge the full state from another replica.",
102102
}),
103103
initialSyncTotal: promauto.With(r).NewCounter(prometheus.CounterOpts{
104104
Name: "alertmanager_state_initial_sync_total",
105-
Help: "Number of times we have tried to sync initial state from peers or storage.",
105+
Help: "Number of times we have tried to sync initial state from peers or remote storage.",
106106
}),
107107
initialSyncCompleted: promauto.With(r).NewCounterVec(prometheus.CounterOpts{
108108
Name: "alertmanager_state_initial_sync_completed_total",
109109
Help: "Number of times we have completed syncing initial state for each possible outcome.",
110110
}, []string{"outcome"}),
111111
initialSyncDuration: promauto.With(r).NewHistogram(prometheus.HistogramOpts{
112112
Name: "alertmanager_state_initial_sync_duration_seconds",
113-
Help: "Time spent syncing initial state from peers or storage.",
113+
Help: "Time spent syncing initial state from peers or remote storage.",
114114
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
115115
}),
116116
}

pkg/alertmanager/state_replication_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ func TestStateReplication(t *testing.T) {
160160

161161
if tt.replicationFactor > 1 {
162162
assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(`
163-
# HELP alertmanager_fetch_replica_state_failed_total Number of times we have failed to read and merge the full state from another replica.
164-
# TYPE alertmanager_fetch_replica_state_failed_total counter
165-
alertmanager_fetch_replica_state_failed_total 0
166-
# HELP alertmanager_fetch_replica_state_total Number of times we have tried to read and merge the full state from another replica.
167-
# TYPE alertmanager_fetch_replica_state_total counter
168-
alertmanager_fetch_replica_state_total 1
163+
# HELP alertmanager_state_fetch_replica_state_failed_total Number of times we have failed to read and merge the full state from another replica.
164+
# TYPE alertmanager_state_fetch_replica_state_failed_total counter
165+
alertmanager_state_fetch_replica_state_failed_total 0
166+
# HELP alertmanager_state_fetch_replica_state_total Number of times we have tried to read and merge the full state from another replica.
167+
# TYPE alertmanager_state_fetch_replica_state_total counter
168+
alertmanager_state_fetch_replica_state_total 1
169169
# HELP alertmanager_partial_state_merges_failed_total Number of times we have failed to merge a partial state received for a key.
170170
# TYPE alertmanager_partial_state_merges_failed_total counter
171171
alertmanager_partial_state_merges_failed_total{key="nflog"} 0
@@ -178,7 +178,7 @@ alertmanager_state_initial_sync_completed_total{outcome="failed"} 0
178178
alertmanager_state_initial_sync_completed_total{outcome="from-replica"} 1
179179
alertmanager_state_initial_sync_completed_total{outcome="from-storage"} 0
180180
alertmanager_state_initial_sync_completed_total{outcome="user-not-found"} 0
181-
# HELP alertmanager_state_initial_sync_total Number of times we have tried to sync initial state from peers or storage.
181+
# HELP alertmanager_state_initial_sync_total Number of times we have tried to sync initial state from peers or remote storage.
182182
# TYPE alertmanager_state_initial_sync_total counter
183183
alertmanager_state_initial_sync_total 1
184184
# HELP alertmanager_state_replication_failed_total Number of times we have failed to replicate a state to other alertmanagers.
@@ -188,8 +188,8 @@ alertmanager_state_replication_failed_total{key="nflog"} 0
188188
# TYPE alertmanager_state_replication_total counter
189189
alertmanager_state_replication_total{key="nflog"} 1
190190
`),
191-
"alertmanager_fetch_replica_state_failed_total",
192-
"alertmanager_fetch_replica_state_total",
191+
"alertmanager_state_fetch_replica_state_failed_total",
192+
"alertmanager_state_fetch_replica_state_total",
193193
"alertmanager_partial_state_merges_failed_total",
194194
"alertmanager_partial_state_merges_total",
195195
"alertmanager_state_initial_sync_completed_total",

0 commit comments

Comments
 (0)