Merge pull request #7450 from allenxu404/release-1.13

[cherry-pick]adjust the logic for the backup_last_status metrics to stop incorrectly incrementing over time
This commit is contained in:
Xun Jiang/Bruce Jiang
2024-02-26 10:04:06 +08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
Adjust the logic for the backup_last_status metrics to stop incorrectly incrementing over time
+1 -1
View File
@@ -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)