Fix the metrics backup_last_status not report right value when the schedule down unexpectation.

Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
yanggang
2023-09-19 15:19:14 +08:00
parent 63c6a48f92
commit cda722cf9d
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)