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

Handling Custom Resources with missing metric related labels

Open withnale opened this issue 3 years ago • 1 comments

What would you like to be added:

With Custom Resource metrics, at present if a label is specified in the definition which isn't present in the actual custom resources the associated labels are generated as {my_label=<nil>}.

In these circumstances the correct handling is somewhat ambiguous but I believe that nil is not one of the options. Perhaps the best option in these circumstances would be to omit this label altogether.

Why is this needed:

Generating a label with such a malformed value by default seems intrinsically wrong.

withnale avatar Jun 24 '22 21:06 withnale

I would also suggest to just not add the label in this case :-)

#1777 would implement that behaviour.

chrischdi avatar Jul 05 '22 09:07 chrischdi

Fixed via #1777, xref: https://github.com/kubernetes/kube-state-metrics/pull/1777/files#diff-1cbeb50a6b171ac66f4fad40018421010ed1733ea97fcb40b65a7ebd5e7e3d77R424

/close

chrischdi avatar Aug 18 '22 20:08 chrischdi

@chrischdi: Closing this issue.

In response to this:

Fixed via #1777, xref: https://github.com/kubernetes/kube-state-metrics/pull/1777/files#diff-1cbeb50a6b171ac66f4fad40018421010ed1733ea97fcb40b65a7ebd5e7e3d77R424

/close

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/test-infra repository.

k8s-ci-robot avatar Aug 18 '22 20:08 k8s-ci-robot