Skip to content

Commit

Permalink
docs: Update _index.md: add information about non-blocking mode to th…
Browse files Browse the repository at this point in the history
…e documentation (backport release-3.2.x) (#15959)

Co-authored-by: Roked <[email protected]>
  • Loading branch information
loki-gh-app[bot] and Rokedd authored Jan 24, 2025
1 parent 27cee41 commit d9a8e76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/sources/send-data/docker-driver/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ The driver keeps all logs in memory and will drop log entries if Loki is not rea

The wait time can be lowered by setting `loki-retries=2`, `loki-max-backoff=800ms`, `loki-timeout=1s` and `keep-file=true`. This way the daemon will be locked only for a short time and the logs will be persisted locally when the Loki client is unable to re-connect.

Also you can use non-blocking mode by setting `services.logger.logging.options.mode=non-blocking` in your `docker-compose` file. Non-blocking means that the process of writing logs to Loki will not block the main flow of an application or service if Loki is temporarily unavailable or unable to process log messages. In non-blocking mode, log messages will be buffered and sent to Loki asynchronously, which allows the main thread to continue working without delay. If Loki is unavailable, log messages will be stored in a buffer and sent when Loki becomes available again. However, this setting is useful to prevent blocking the main flow of an application or service due to logging issues, but it can also lead to loss of log messages if the buffer overflows or if Loki is unavailable for a long time.

To avoid this issue, use the Promtail [Docker target](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/promtail/configuration/#docker) or [Docker service discovery](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/promtail/configuration/#docker_sd_configs).

0 comments on commit d9a8e76

Please sign in to comment.