chore: Reduce code duplication for metadata metric families
What this PR does / why we need it: There are common metrics shared among all resources for creation, deletion, labels and annotations. We can deduplicate code this way and currently I implemented it for pods (I will apply it to other resources as well).
The downside with the current approach is, that we can flip stability only on and off for all of them, which I think is fine because of the common nature of these metrics.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
None
Which issue(s) this PR fixes: (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged)
Fixes #
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: mrueg
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [mrueg]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/triage accepted
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.