Skip to content

Commit

Permalink
Adjust the logic for the backup_last_status metrics to stop incorrect…
Browse files Browse the repository at this point in the history
…ly incrementing over time

Signed-off-by: allenxu404 <[email protected]>
  • Loading branch information
allenxu404 committed Feb 21, 2024
1 parent d45b313 commit 84fb88c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/unreleased/7445-allenxu404
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adjust the logic for the backup_last_status metrics to stop incorrectly incrementing over time
2 changes: 1 addition & 1 deletion pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func (m *ServerMetrics) InitSchedule(scheduleName string) {
c.WithLabelValues(scheduleName).Add(0)
}
if c, ok := m.metrics[backupLastStatus].(*prometheus.GaugeVec); ok {
c.WithLabelValues(scheduleName).Add(1)
c.WithLabelValues(scheduleName).Set(float64(1))
}
if c, ok := m.metrics[restoreAttemptTotal].(*prometheus.CounterVec); ok {
c.WithLabelValues(scheduleName).Add(0)
Expand Down

0 comments on commit 84fb88c

Please sign in to comment.