kube-state-metrics
kube-state-metrics copied to clipboard
Handling Custom Resources with missing metric related labels
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.
I would also suggest to just not add the label in this case :-)
#1777 would implement that behaviour.
Fixed via #1777, xref: https://github.com/kubernetes/kube-state-metrics/pull/1777/files#diff-1cbeb50a6b171ac66f4fad40018421010ed1733ea97fcb40b65a7ebd5e7e3d77R424
/close
@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.