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

Additional Labels not exported by KSM #2311

Open
bhanugarg23 opened this issue Jan 28, 2024 · 6 comments
Open

Additional Labels not exported by KSM #2311

bhanugarg23 opened this issue Jan 28, 2024 · 6 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@bhanugarg23
Copy link

What happened:

I am not able to add additional pod and deployment labels into the metrics exported by KSM. I have setup KSM via helm inside AWS EKS. Below is the change I made in the values file to add allow the additional label for pods

metricLabelsAllowlist:
- pods=[deplEnv]

Here deplEnv is the label key. When I apply this change in the values file, I am seeing this extra args being passed in the deployment. When I port forward the KSM service I am not able to see this label in any of the metrics on the /metrics page.

What you expected to happen:

Label with the key deplEnv visible in the pod and deployment metrics

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

Apply the kube-state-metrics helm chart in AWS EKS(version 1.27) with the change mentioned above in the values file and then port forward the service

Anything else we need to know?:

Environment:

  • kube-state-metrics version: 2.10.1
  • Kubernetes version (use kubectl version): 1.27
  • Cloud provider or hardware configuration: AWS EKS
  • Other info:
@bhanugarg23 bhanugarg23 added the kind/bug Categorizes issue or PR as related to a bug. label Jan 28, 2024
@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 28, 2024
@grzesuav
Copy link
Contributor

Whic metric does not have this label exactly ?

@bhanugarg23
Copy link
Author

None of the metrics have this label. When I port forward and open the /metrics page on local, I am not find this label anywhere on the page

@bhanugarg23
Copy link
Author

I got the issue. KSM was relabelling the metric name deplEnv to label_depl_env. I am only able too see this label on metric kube_pod_labels and not on any other metric. Is there a way I can see this label across all metrics for the pod ?

@dgrisonnet
Copy link
Member

I got the issue. KSM was relabelling the metric name deplEnv to label_depl_env. I am only able too see this label on metric kube_pod_labels and not on any other metric. Is there a way I can see this label across all metrics for the pod ?

That is expected, the labels are only added to the _labels metrics.

/assign
/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Feb 8, 2024
@dgrisonnet
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 Feb 8, 2024
@thefirstofthe300
Copy link

I too would like to see this particular feature added to kube-state-metrics. I'm trying to figure out how to get a metric time series which shows the versions of pods currently deployed. I figured I could do this by enforcing a version label being set on the pods, but without the ability to add my own labels to a metric, it becomes very difficult to do.

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. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants