Repository navigation
feat: every container's output reaches Loki through Docker's fluentd driver and the collector - #421
Merged
Merged
Conversation
…driver and the collector
HardMax71
enabled auto-merge (squash)
October 19, 2026 22:26
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Loki only gets what the backend and worker send over OTLP; the collector's logs pipeline had no other receiver. So Mongo, Kafka, Redis and nginx output, gunicorn's own lines and a traceback from a crash before logging starts were only visible through
docker logson the server.Changes
Every service logs through Docker's built-in
fluentdlog driver to the collector's newfluent_forwardreceiver (127.0.0.1:24224), tagged with the container name.groupbyattrsandtransformgive each container its ownservice.name, and a filter drops the backend's and worker's JSON lines, which already arrive over OTLP with trace ids. Withfluentd-asynccontainers start while the collector is down, anddocker logsreads Docker's local cache, capped at 3 × 10 MB as before. The collector stays on thelocaldriver, or its debug exporter would echo its own lines forever. Its unuseddocker.sockmount goes.Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation:
otelcol validatepasses, and so do the Grafana contract tests and mkdocs --strict. On a local observability stack, Redis lines reached Loki asservice_name="redis". A container named backend got its gunicorn and traceback lines through while its JSON line was dropped.docker compose logsstill works, anddocker stoptook 0.4 s with no collector listening.Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Loki now receives the output of every container, not just the backend's and worker's OTLP lines. Mongo, Kafka, Redis, nginx, gunicorn, and pre-logging tracebacks previously only visible through
docker logsnow land in Grafana.fluentddriver to the collector's newfluent_forwardreceiver on127.0.0.1:24224, tagged with the container name.groupbyattrs/containerandtransform/containerprocessors give each container its ownservice.name;filter/app_json_stdoutdrops the backend's and worker's JSON stdout lines, which already arrive over OTLP with trace ids.fluentd-asynckeeps containers starting and buffering while the collector is down, anddocker logsreads Docker's local cache capped at 3 × 10 MB as before.localdriver so its debug exporter doesn't echo its own lines, and its unuseddocker.sockmount is removed.Written for commit 51b2868. Summary will update on new commits.