kube-state-metrics icon indicating copy to clipboard operation
kube-state-metrics copied to clipboard

chore: Reduce code duplication for metadata metric families

Open mrueg opened this issue 3 months ago • 3 comments

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 #

mrueg avatar Aug 28 '25 08:08 mrueg

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 28 '25 08:08 k8s-ci-robot

/triage accepted

CatherineF-dev avatar Sep 10 '25 18:09 CatherineF-dev

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.

k8s-ci-robot avatar Oct 10 '25 23:10 k8s-ci-robot