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

Export Kubernetes Labels with Pods #99

Closed
alex-g-tejada opened this issue Aug 30, 2022 · 5 comments
Closed

Export Kubernetes Labels with Pods #99

alex-g-tejada opened this issue Aug 30, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@alex-g-tejada
Copy link

Hey!

We're using the helm chart within our kubernetes cluster. We're able to collect exported pod/namespace but labels belonging to the pods are not being collected. Is there a way to collect these as well?

@nikkon-dev
Copy link
Collaborator

@alex-g-tejada,

Currently, dcgm-exporter does not provide a way to output all pod labels to Prometheus.
This is not hard to add, but printing out all labels would overwhelm the output.
There should be some way to specify which pod labels are needed.
This may be a reasonable feature request.

@nikkon-dev nikkon-dev added the enhancement New feature or request label Aug 30, 2022
@syandroo
Copy link

syandroo commented Nov 9, 2022

@nikkon-dev is there any way to specify adding replicaset / deployment to the output too? or would that be in line with the pod annotations request

@nikkon-dev
Copy link
Collaborator

@syandroo,
That would be a bit different as the ReplicaSet or Deployment names are not labels. But what information would you want to see there? Just names of a replicaset/deployment?

@syandroo
Copy link

@nikkon-dev either the names of the replicaset or deployment are good, but being able to export pod labels would be sufficient, as we have them labeled anyway

@thekuffs
Copy link

Hi, you don't want to do this as part of the dcgm exporter. You should make sure that these pods are collected with a kubernetes service discovery style job in prometheus. (https://prometheus.io/docs/prometheus/latest/configuration/configuration/#pod) You can then use a labelmap to assign pod labels as labels in prometheus. There's a perfectly good example at https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml#L288.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants