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

Adding some more (static) container labels #91

Open
vsund opened this issue Apr 12, 2024 · 1 comment
Open

Adding some more (static) container labels #91

vsund opened this issue Apr 12, 2024 · 1 comment

Comments

@vsund
Copy link

vsund commented Apr 12, 2024

Hi there, first of all thanks for this project, it's a great lightweight way to gain a little bit insight into running containers without having to use e.g. cAdvisor.

I'm searching for a way to list running containers from various machines (and Prometheus is probably the most straightforward way of doing so). The dex_container_running metric is great for that, however I think we could add some more labels there.

I poked a little bit around and think it would be quite easy to add it. The Docker API has some more interesting fields available.
I guess it's not so easy to add the slice fields, but e.g. Image, ImageID and Created could be simply added to NewDesc via variableLabels or constLabels.

What do you think? I'd be happy to contribute it, especially as it seems quite straightforward :)

@0xERR0R
Copy link
Owner

0xERR0R commented Apr 26, 2024

Hey, I think, it is a good idea, but we should take in account that each key/value combination for label increases storage on disk (prometheus), see from https://prometheus.io/docs/practices/naming/#labels

CAUTION: Remember that every unique combination of key-value label pairs represents a new time series, which can dramatically increase the amount of data stored. Do not use labels to store dimensions with high cardinality (many different label values), such as user IDs, email addresses, or other unbounded sets of values.

That mean, if you have containers which are frequently updated (newer docker image version), that could have negative impact.

Maybe we should add just one label (image:version) to reduce the amount of labels?

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

2 participants