-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add tenant_id option to docker log driver #1374
Comments
I know this difficult to get the file config inside the docker plugin but if you manage to do it, the pipeline stages can help you here. https://github.com/grafana/loki/blob/master/docs/clients/promtail/pipelines.md The trouble is really to get the file accessible to the plugin. |
That's not a particularly manageable workaround (I'd have to build separate plugins for each of my environments?). Also this isn't terribly clear - I'd need to have an "action" stage with the tenant configured as described here I think I get, but how is this config file even referenced (what do I name it?)? (I see a |
No there is a way to access the host filesystem for a docker plugin. You should be able to drop the file into Then use a relative path in the The To find the plugin id, you can list plugin:
Then inspect using the short id to get the full id.
As an example of configuration:
This would send a different tenant for two team based on the stream received. So you actually need a single file for all your tenant configuration. If you have a single tenant you can still use this example:
This would send all logs with |
I'm not saying we won't do your request, but I'm giving you a good workaround and pipeline stages have more to offer also, you can parse and add as a label your log level or any label that you find relevant for your log. Since label are indexed this would make your search more easier. |
Thanks! Though the workaround is technically possible for me, I'd still end up writing temporary automation to build the config files and place it on the hosts (my list of tenants is not necessarily static). I will manage with the single default tenant for now, and migrate when this is ready. |
Describe the solution you'd like
Promtail offers a way to set the
tenant_id
to configure theX-Scope-OrgID
header when pushing logs to Loki. There should be a way to set this via a--log-opt
when configuring the docker driverDescribe alternatives you've considered
Switching from the docker log driver to adding a promtil sidecar to all of my services..!
The text was updated successfully, but these errors were encountered: