feat: add some new labels to every container #4324
Open
+59
−45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
I strongly encourage to read the comment that initiated this PR: #3569 (comment)
TL;DR: The main issue is the difficulty in monitoring due to automatically generated container names. Currently, when I look at my Grafana/cAdvisor dashboard tracking CPU usage for each container managed by Coolify, I only see cuid names , which makes it impossible to identify what each container corresponds to.
So we need a way to have "human-readable" names for each container. This PR addresses the issue by adding three new labels to each container managed by Coolify :
coolify.resourceName
: The name of theApplication
orService
coolify.projectName
: The name of the project where the resource livescoolify.serviceName
: This one might be a bit confusing, and perhaps we can find a better name. If the resource is of typeService
, it will be the sub-service name. If it's of typeApplication
, it will be the application name. This label is necessary because, using my monitoring use case as an example, I need metrics/logs for each of my containers. To differentiate them, I need a unique name. If I'm using aService
, I can't rely oncoolify.resourceName
since all the services in my docker-compose file would have the same value. I hope this explanation makes sense.This is my first contribution to Coolify, and I'm not familiar with PHP either, so feel free to point out any corrections or improvements I should made
( And thanks a lot for making Coolify 💙 )
Issues