-
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
Set Labels from Environment Variables #319
Comments
@base698 can you use config management to inject this into the config file? There is an external labels field for this kind of thing - see https://github.com/grafana/loki/blob/master/production/ksonnet/promtail/promtail.libsonnet#L42 |
I'm not familiar with libsonnet. Where is this referenced: $._config.promtail_config.external_labels ? |
@base698 The reference for external_labels is at loki/pkg/promtail/client/client.go Line 56 in 40ae03b
You can pass in as '--client.external_labels=LABELS' or generate a dynamic promtail-config base on your labels. I will put up an example of this later on |
@yubozhao |
@almariah It is not implemented yet? That's too bad. I thought it is implemented with loki/pkg/promtail/client/client.go Line 241 in 439e7bb
|
@yubozhao Yes loki/pkg/promtail/client/client.go Lines 68 to 77 in 439e7bb
This is where parsing CLI are configured and |
@yubozhao I guess because parsing a map from CLI is not implemented in https://github.com/cortexproject/cortex/tree/master/pkg/util/flagext which is used in promtail for parsing flags |
@almariah oh cool. Thanks for point it out for me! I haven't touch Loki for a long time, thanks for bring me up to speed. I remember you could pass variables as container arguments. Maybe that is changed now? |
…ata-5.6 [release-5.6] fix(operator): Disable structured metadata
Running
promtail
on a cluster, it would be handy to have information stored in labels from environment variables. Examples would be hostnames, regions, rack location, etc. Something that has to be specified during runtime.The text was updated successfully, but these errors were encountered: