-
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
Docker logging driver? #195
Comments
Instead of implementing it from zero, this driver can be used: https://github.com/deep-compute/docker-file-log-driver |
I'm coding one for Docker... (and with support for Docker Swarm tags as service name, etc) https://github.com/lfdominguez/docker_log_driver_loki is in early stage yet. |
In futher version i will change to use the protobuff protocol, i need get working with json first gg. |
Noice! for now, i'm using the journald docker daemon log setting, and then grabing those using fluentd which can push to loki |
It would be awesome if we could send the docker logs to loki directly (without having the logs sent to file and then to loki). |
check |
Thank you, any guide how to start using it? ;) |
only use de Makefile and put the options loki-host and loki-port. Soon I will put the configuration on README... sorry |
+1 Need an official Docker Logging Driver to get buy in with the enterprise. |
This is totally a legitimate feature, I’m not sure if the docker plugin is solution. May be for swarm users. For sure, in the meantime I would recommend to use a service discovery compatible with Prometheus service discovery such as consul, very simple to use. |
I disagree, we use Amazon ECS and Fargate and currently configure Docker to send logs through the Splunk logging driver. We also have some teams using the CloudWatch logging driver. Because of how easy it is to configure logging drivers, pretty much the only way I will get buy-in to switch to Loki from the enterprise teams logging in this way is if Loki also has a logging driver. |
Completely agree with @TigerC10 as I do have the same scenario (using cloudwatch logging driver). |
Sounds fair, I'll dig into it. |
You can help or fork or whatever you want ;) with my plugin |
I'll read it for inspiration but I think it's better if this code live in grafana/loki as there is a lot of pkg I could use. |
@TigerC10 if we do release a docker driver it won't be added by default to ecs image. Would you install it yourself or will you wait for the support in the ecs ? |
@Kuqd yes.. I do that for other drivers (rexray/ebs and efs). So I would just add an aditional driver there. |
@Kuqd Yes, we maintain our own ECS images for other monitoring and security software, can easily add Loki driver to the images. |
Alright so that also seems fair to add the possibility to parse lines via config file optionally so you can index log level.
|
I'm aiming for this config: {
"log-driver": "loki",
"log-opts": {
"url": "http://loki/api/prom/push",
// many other tls option.
"external-labels": "container_name={{.Name}},env=prod",
"labels": "production_status",
"env": "os,customer"
}
} |
umm.. i will change the config options of my plugin... now are |
how do you usually deal with config file when using docker drivers ? I don't seem to understand how to mount a hostpath in my plugin to add a config. |
I don't have config files... the config is on docker daemon or used directly on docker command |
In AWS, we use the USERDATA feature of EC2 and/or the Init Scripts in CloudFormation Templates. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html So, on the consumer side of this plug-in, we would install the Loki driver plugin with USERDATA on the instance profile, then we would use the Init Scripts to define the config file(s). |
With it you can populate the /etc/docker/daemon.json (Debian) with the configuration, and every container use them. |
Thanks everyone, I should release the driver today or tomorrow. @lfdominguez I've added swarm support like you did but using the |
[release-5.8] Backport PR grafana#10854
Are there plans to build a Docker logging driver plugin based on Loki?
The text was updated successfully, but these errors were encountered: