Merge pull request #6838 from yanggangtony/fix-metrics-backup_last_status

Change the default value of the velero_backup_last_status metrics.
This commit is contained in:
Wenkai Yin(尹文开)
2023-09-20 10:18:52 +08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1 @@
change the metrics backup_attempt_total default value to 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(0)
c.WithLabelValues(scheduleName).Add(1)
}
if c, ok := m.metrics[restoreAttemptTotal].(*prometheus.CounterVec); ok {
c.WithLabelValues(scheduleName).Add(0)