Docker driver not logging to Loki

Hello all,
I am running loki behind Traefik. The URL is https://loki.domain.tld and it shows as ready (https://loki.domain.tld/ready) so I know that bit works.

I installed the Docker logging driver and it is enabled.

Here is the logging config in my docker-compose.yml file for the service:

x-logging:
  &loki
  logging:
    driver: loki
    options:
      loki-url: "https://loki.domain.tld/loki/api/v1/push"
      loki-batch-size: "400"
      loki-retries: "5"

and the service itself has
<< : *loki

However, I start the service and I can see logs when I run docker logs container but nothing is getting logged to loki.

Hi @tam481! Did you ever manage to solve the problem? I have the exact same problem and so far I’ve not managed to get the plugin to log anything from my Docker Compose and Docker containers into the Grafana Cloud Loki instance I’m using. I’ve double checked API keys, URLs etc.

Hi @fredriksmedberg It turns out, rather embarrassingly, that it wasn’t Grafana. It was my Loki container where I hadn’t disabled analytics. As soon as I added

analytics:
  reporting_enabled: false

and restarted the container, all the DNS domain lookups stopped.

I hope this helps.