-
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 service discovery - logging interrupted when a container is restarted #5259
Comments
Thanks a ton for the extensive description 👏 The culprit is loki/clients/pkg/promtail/targets/docker/target_group.go Lines 75 to 79 in f5d5701
We are not restarting a finished container. I wonder whether it's enough to check if the target is stopped and restart it. Did you just restart the container with |
Yes, I just used |
Summary: The Docker target would not reconnect to a container if it restarted and kept the same ID. This should introduces a `startIfNotRunning` method that will be called to restart scraping the container's logs. Fixes grafana#5259
Summary: The Docker target would not reconnect to a container if it restarted and kept the same ID. This should introduces a `startIfNotRunning` method that will be called to restart scraping the container's logs. Fixes #5259
Just tested the newest version with this change. Seems to work fine, thanks a lot! |
Describe the bug
I was just testing the new docker_sd_config. Everything worked like a charm, until I noticed something weird. When I restart a container, from which I scrape logs with the docker_sd_config, promtail seems to not send the logs to loki after the restart. (All other containers still work fine.) When I then restart promtail, all the missing logs get delivered at once. So nothing is missing, but after the restart it seems to stop sending the logs of this specific container to loki.
When restarting any container (id of the container stays the same) this happens. When instead recreating the container (id changes) this does not seem to happen.
To Reproduce
Steps to reproduce the behavior:
docker logs traefik
show logs normallyExpected behavior
After restarting a container (e.g. Traefik) expect logs to be send to loki normally
Environment:
Screenshots, Promtail config, or terminal output
Loki config yml
promtail config yml
Logs of promtail when container gets restarted
5c66fcb97ccd197d9cd2395a15d4016bff76bc86545cd0dbf0bf266c43f6c21d
being the id of the container restartedPromtail logs after restarting promtail container
Let me know if i can help you further.
The text was updated successfully, but these errors were encountered: