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

reserved labels of CustomResourceStateMetrics are getting overwritten #1943

Closed
bavarianbidi opened this issue Jan 3, 2023 · 3 comments
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@bavarianbidi
Copy link
Contributor

What happened:

Contrary to the current documentation

NOTE: The group, version, and kind common labels are reserved, and will be overwritten by the values from the groupVersionKind field.

these fields won't get overwritten.

I have following configuration from cluster-api

    metricNamePrefix: capi_kubeadmcontrolplane
    metrics:
    - name: info
      help: Information about a kubeadmcontrolplane.
      each:
        info:
          labelsFromPath:
            version:
            - spec
            - version
        type: Info

but the generated metric will look like the following:

capi_kubeadmcontrolplane_info{cluster_name="glippy",group="controlplane.cluster.x-k8s.io",kind="KubeadmControlPlane",name="glippy",namespace="org-giantswarm",uid="bd2c772e-2140-480f-a051-3ecedc2ed02b",version="v1.22.7"}

What you expected to happen:

capi_kubeadmcontrolplane_info{cluster_name="glippy",group="controlplane.cluster.x-k8s.io",kind="KubeadmControlPlane",name="glippy",namespace="org-giantswarm",uid="bd2c772e-2140-480f-a051-3ecedc2ed02b",version="v1beta1"}

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

I've created #1942 as an alternative approach for the auto-generated group,version and kind labels. I've also created a tracking issue on kubernetes-sigs/cluster-api.

Environment:

  • kube-state-metrics version: 2.7.0
  • Kubernetes version (use kubectl version): 1.24.4
  • Cloud provider or hardware configuration:
  • Other info:
@bavarianbidi bavarianbidi added the kind/bug Categorizes issue or PR as related to a bug. label Jan 3, 2023
@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 3, 2023
@logicalhan
Copy link
Member

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 12, 2023
@logicalhan
Copy link
Member

/assign @dgrisonnet

@dgrisonnet
Copy link
Member

Fixed by #1942.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants