Fix cluster label in backup metrics #1097
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue with the Prometheus metrics sent from the restic backup pod to the pushgateway, specifically concerning the "cluster" label.
The "cluster" label was introduced in #1030. However, this label doesn't currently works as intended. The clusterName values from the backup/schedule manifest are not being passed to the backup pod's environment. As a result, the "cluster" label consistently appears empty ("") in pushgateway/prometheus.
Additionally, there is another point to discuss.
These two PRs #1030 and #260 added ClusterName and PromURL to "restic check" (./api/v1/check_types.go)
code, which are intended for the code that pushes metrics to Pushgateway. It appears the actual code implementing this push functionality is missing, At least, I was unable to find it. So the "check" job doesn't push any metrics.
A reasonable solution might be to completely remove these configurations and clean the CRDs accordingly. But since these would be breaking changes, I have left the existing code unchanged, assuming that the metrics-pushing code either exists elsewhere or will be implemented in the future.
Checklist
For Code changes
bug,enhancement,documentation,change,breaking,dependencyas they show up in the changelog
area:operatorcharts/directory.