-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Custom Resource State Metrics support deep nested objects? #2589
Comments
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The 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. |
If I understand correctly, you want the "parent" keys in the CR to be added as labels. This seems interesting but hard to generalize. How would this work if there are multiple keys with different structures? And when faced with sub-trees containing arrays, how would it know what key to use as the label name and value, and which key to traverse for further values? It seems like you would need something like a JSONPath expression or a series of them, so you could express to k-s-m a generic pattern for traversing your CR to discover unique time-series and values for them. Otherwise you won't be able to handle something like:
... which is the other common pattern for expressing these sorts of structures. |
Thanks for response @ringerc. Yes I think we need something like JSONPath to extract arbitrary custom info from k8s object. A kubectl request may look like:
If there is a general solution for this, kube-state-metrics will be much more powerful. But it is understandable this might be challenging. |
Duplicate of #2368 |
We have a k8s object as follows.
We would like to generate a metrics like
resourceCount{tenant=tenantA, hostGroup=hostGroupA, resourceType=type2} 2
.Initially I tried to use
labelFromKey
, but it seems only supports one level of nesting. I have to statically specify path, and in the last level use labelFromKey to generate metrics by resourceType.Wondering whether we can use labelFromKey for nested objects.
The text was updated successfully, but these errors were encountered: