Skip to content
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

loki-docker-driver does not support reconstructing docker logs split by docker in 16kB chunks #12262

Open
andoks opened this issue Mar 19, 2024 · 0 comments
Labels
component/docker-driver type/bug Somehing is not working as expected

Comments

@andoks
Copy link

andoks commented Mar 19, 2024

Describe the bug
Log entries are being split into multiple lines by docker, and as the loki docker driver (aka. Docker loki log plugin) does not reconstruct entries that are split into multiple lines/chunks , these chunks/lines are treated as individual log entries in Loki and Grafana, which breaks any JSON formatted structured logs

To Reproduce
Steps to reproduce the behavior:

  1. Installed loki-docker-driver (grafana/loki-docker-driver:2.9.2)
  2. Configured docker-compose service to use the loki-docker-driver docker plugin for logs
  3. Configured plugin to put logs into loki
  4. Started Loki (FROM grafana/loki:2.9.5@sha256:55561cf48b19e03d982e1f959efc0d8842b7be141eb5eaaa4b8a8eeb5a2dfc58)
  5. Started service using docker-compose
  6. Made service produce a huge log entry (this happens outside of my control, as this is not actually an internal service)
  7. Observed "broken" log entries split over multiple lines in Loki using Grafana.
    By broken I mean that log entries that were supposed to be a single entry are being parsed and treated as multiple entries, many of which are missing valuable fields like level and original timestamp, as those fields are only detected on the single entry/line which contains those fields, and not for the lines that are being displayed as different entries.

Expected behavior
The loki-docker-driver recombines the split chunks/lines into a single entry/line, and treats them as such, even before the pipeline-configuration in the loki-docker-driver enters the picture.

Environment:

  • Infrastructure: Docker compose running on desktop computer
  • Deployment tool: Docker compose

Screenshots, Promtail config, or terminal output
I can share screenshots and logs privately on request

Links

@JStickler JStickler added component/docker-driver type/bug Somehing is not working as expected labels Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/docker-driver type/bug Somehing is not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants