-
Notifications
You must be signed in to change notification settings - Fork 22
Description
🎯 Problem to be solved
The new v0.1.13 release contains optional support for log collection.
The way that is implemented relies on operators to manually add an additional compose file on the command line (every time they interact with the deployed stack).
This is not only inconvenient due to the amount of typing required (i.e. docker compose ... vs docker compose -f docker-compose.yml -f logging.yml ...) but also error prone due to people forgetting to include the additional file.
A more elegant (IMO) solution would be to use the profile feature docker compose provides.
This allows to place services into profiles which can be thought of like groups.
Services without an assigned profile are always selected while those with a profile can be selected wither via a CLI flag or an env variable (COMPOSE_PROFILES) which can also be set in .env.
So that would mean to enable log forwarding operators would simply need to edit their .env file (e.g. uncomment or add a COMPOSE_PROFILES=logging line)
Example:
docker-compose.yml:
services:
# ...
logging:
profiles: [logging]
# ....env:
# ...
#COMPOSE_PROFILES=logging
🧪 Tests
- Works in local docker-compose