Skip to content

Commit

Permalink
feat(metrics): get recurringjob label from status field for backups
Browse files Browse the repository at this point in the history
Signed-off-by: Yvan <y.guidoin@meteocontrol.com>
  • Loading branch information
YvanGuidoin authored and derekbit committed Oct 22, 2024
1 parent aad527c commit 95e5391
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 95e5391

Please sign in to comment.