Skip to content
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

Open
pbxqdown opened this issue Jan 8, 2025 · 1 comment
Open

Does Custom Resource State Metrics support deep nested objects? #2589

pbxqdown opened this issue Jan 8, 2025 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@pbxqdown
Copy link

pbxqdown commented Jan 8, 2025

We have a k8s object as follows.

status:
    resourceCount:
      tenantA:
        hostGroupA:
          example.com/type1: 2
          example.com/type2: 2
          example.com/type3: 20

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.

metrics:
            - name: resourceCount
              each:
                type: Gauge
                gauge:
                  path: [status, resourceCount, tenantA, hostGroupA]
                  labelFromKey: resourceType

Wondering whether we can use labelFromKey for nested objects.

@pbxqdown pbxqdown added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants