Skip to content

Commit

Permalink
Merge pull request #7445 from allenxu404/backup-last-status-fixed
Browse files Browse the repository at this point in the history
Adjust the logic for the backup_last_status metric to stop incorrectly incrementing over time
  • Loading branch information
blackpiglet authored Feb 21, 2024
2 parents d45b313 + 84fb88c commit 2a1ae0e
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 2a1ae0e

Please sign in to comment.