From a3578ceae966a8ec56cd59b64da0b25f8e63cfa1 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Wed, 18 Aug 2021 19:09:25 +0200 Subject: [PATCH 1/4] Document known Docker driver issues. --- docs/sources/clients/docker-driver/_index.md | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/sources/clients/docker-driver/_index.md b/docs/sources/clients/docker-driver/_index.md index 6713aa91c2e3..de6eb92024b2 100644 --- a/docs/sources/clients/docker-driver/_index.md +++ b/docs/sources/clients/docker-driver/_index.md @@ -57,3 +57,35 @@ To cleanly uninstall the plugin, disable and remove it: docker plugin disable loki --force docker plugin rm loki ``` + +# Know Issues + +The driver keeps all logs in memory and will drop log entries in case Loki is not reachable and the `max_retries` are exceeded. This can be avoided by setting `max_retries` to zero and thus trying forever until Loki is reachable again. However, this setting might have undesired consequences. The Docker daemon will wait for the Loki driver to process all logs of a container until it's removed. So it might wait forever and the container is stuck. + +In order to avoid this situation it's recommended to use [Promtail](../promtail) instead with the following configuration. + +```yaml +server: + disable: true + +positions: + filename: loki-positions.yml + +clients: + - url: ${LOKI_ENDPOINT} + basic_auth: + username: ${LOKI_USER} + password: ${LOKI_PASSOWORD} + +scrape_configs: + - job_name: system + pipeline_stages: + - docker: {} + static_configs: + - labels: + job: docker + __path__: /var/lib/docker/containers/*/*-json.log + +``` + +This will enable Promtail to tail *all* Docker container logs and publish them to Loki. From b8f9df8f7a073fb670c941eda7926a8c9bc8394b Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 23 Aug 2021 11:30:04 +0200 Subject: [PATCH 2/4] Update docs/sources/clients/docker-driver/_index.md Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com> --- docs/sources/clients/docker-driver/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/clients/docker-driver/_index.md b/docs/sources/clients/docker-driver/_index.md index de6eb92024b2..fa3629bb8301 100644 --- a/docs/sources/clients/docker-driver/_index.md +++ b/docs/sources/clients/docker-driver/_index.md @@ -60,9 +60,9 @@ docker plugin rm loki # Know Issues -The driver keeps all logs in memory and will drop log entries in case Loki is not reachable and the `max_retries` are exceeded. This can be avoided by setting `max_retries` to zero and thus trying forever until Loki is reachable again. However, this setting might have undesired consequences. The Docker daemon will wait for the Loki driver to process all logs of a container until it's removed. So it might wait forever and the container is stuck. +The driver keeps all logs in memory and will drop log entries if Loki is not reachable and if the quantity of `max_retries` has been exceeded. To avoid the dropping of log entries, setting `max_retries` to zero allows unlimited retries; the drive will continue trying forever until Loki is again reachable. Trying forever may have undesired consequences, because the Docker daemon will wait for the Loki driver to process all logs of a container, until the container is removed. Thus, the Docker daemon might wait forever if the container is stuck. -In order to avoid this situation it's recommended to use [Promtail](../promtail) instead with the following configuration. +This issue is avoided by using [Promtail](../promtail) with this configuration: ```yaml server: From 68f080467e991cbd8914361d4679da52ef09e6fc Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 23 Aug 2021 11:30:46 +0200 Subject: [PATCH 3/4] Update docs/sources/clients/docker-driver/_index.md Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com> --- docs/sources/clients/docker-driver/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/clients/docker-driver/_index.md b/docs/sources/clients/docker-driver/_index.md index fa3629bb8301..88e6e6ce44c3 100644 --- a/docs/sources/clients/docker-driver/_index.md +++ b/docs/sources/clients/docker-driver/_index.md @@ -72,7 +72,7 @@ positions: filename: loki-positions.yml clients: - - url: ${LOKI_ENDPOINT} + - url: http://ip_or_hostname_where_Loki_run:3100/loki/api/v1/push basic_auth: username: ${LOKI_USER} password: ${LOKI_PASSOWORD} From 20c9e3acadf45cce6c86aac79c7f341db2d3b0d4 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 23 Aug 2021 11:30:58 +0200 Subject: [PATCH 4/4] Update docs/sources/clients/docker-driver/_index.md Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com> --- docs/sources/clients/docker-driver/_index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/sources/clients/docker-driver/_index.md b/docs/sources/clients/docker-driver/_index.md index 88e6e6ce44c3..5bbd2c78ecff 100644 --- a/docs/sources/clients/docker-driver/_index.md +++ b/docs/sources/clients/docker-driver/_index.md @@ -73,9 +73,12 @@ positions: clients: - url: http://ip_or_hostname_where_Loki_run:3100/loki/api/v1/push + # If using basic auth, configures the username and password sent. basic_auth: - username: ${LOKI_USER} - password: ${LOKI_PASSOWORD} + # The username to use for basic auth + username: + # The password to use for basic auth + password: scrape_configs: - job_name: system