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

Set docker container name and meta data as prometheus labels #688

Closed
discordianfish opened this issue May 6, 2015 · 6 comments
Closed

Comments

@discordianfish
Copy link
Contributor

cadvisor supports exposing metrics for prometheus consumption. Right now it only sets the container ID as a label but it would be useful to also set the container name and potential meta data[1] as labels.

  1. https://docs.docker.com/userguide/labels-custom-metadata/
@MrMMorris
Copy link

yes please! I need to be able to differentiate containers as I don't name them and docker labels seems to be the best way to do it 😄

@tim-gp
Copy link

tim-gp commented Jun 18, 2015

+1 here.

@jimmidyson
Copy link
Collaborator

Think docker container name & labels are now in the prometheus exposed metrics. Can this be closed?

@discordianfish
Copy link
Contributor Author

Awesome, then it can be closed!

@Colstuwjx
Copy link
Contributor

Colstuwjx commented May 9, 2017

I have some docker envs which need to inject as prom labels, how to achieve that goal?
It seems that we need a more flexible way to determine prom labels...

@Colstuwjx
Copy link
Contributor

Colstuwjx commented May 9, 2017

I have been checked the source code, and found that cadvisor will set some default labels, and envs are already exist.

BTW, I also found that there is a ContainerSpec struct to determine the container metadata, but the env will be whitelist? How to setup these configs?

I cannot find any documentation about this, and I also suggest docker inspect result should have a simple way to inject as part of ContainerSpect, e.g Network IPAddress.

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

No branches or pull requests

5 participants