Skip to content

Commit

Permalink
feat(metrics): get recurringjob label from status field instead of to…
Browse files Browse the repository at this point in the history
…p level labels for backup metrics

Signed-off-by: Yvan <[email protected]>
  • Loading branch information
YvanGuidoin committed Oct 16, 2024
1 parent 8387bcf commit 4bb0d22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics_collector/backup_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (bc *BackupCollector) Collect(ch chan<- prometheus.Metric) {
if !ok {
bc.logger.WithError(err).Warn("Error get backup volume label")
}
backupRecurringJobName := backup.Labels[types.RecurringJobLabel]
backupRecurringJobName := backup.Status.Labels[types.RecurringJobLabel]
ch <- prometheus.MustNewConstMetric(bc.sizeMetric.Desc, bc.sizeMetric.Type, size, backupVolumeName, backup.Name, backupRecurringJobName)
ch <- prometheus.MustNewConstMetric(bc.stateMetric.Desc, bc.stateMetric.Type, float64(getBackupStateValue(backup)), backupVolumeName, backup.Name, backupRecurringJobName)
}
Expand Down

0 comments on commit 4bb0d22

Please sign in to comment.