Logs showing in Docker Desktop but not in Grafana

Hi, I am new to Loki and Grafana and right now I am trying to install Loki on a windows 2022 server. I am testing Grafana Loki in a Docker Compose setup, but not seeing any data ingested into Grafana dashboard. But I can see the logs in my Docker Dekstop.


Can anyone tell me where the problem might be?

I followed the installation from the Loki Documentation.

This is the Docker Compose Config:

version: "3"

networks:
  loki:

services:
  loki:
    image: grafana/loki:2.9.2
    ports:
      - "3100:3100"
    command: -config.file=/etc/loki/local-config.yaml
    networks:
      - loki

  promtail:
    image: grafana/promtail:2.9.2
    volumes:
      - /var/log:/var/log
    command: -config.file=/etc/promtail/config.yml
    networks:
      - loki

  grafana:
    environment:
      - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
    entrypoint:
      - sh
      - -euc
      - |
        mkdir -p /etc/grafana/provisioning/datasources
        cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
        apiVersion: 1
        datasources:
        - name: Loki
          type: loki
          access: proxy 
          orgId: 1
          url: http://loki:3100
          basicAuth: false
          isDefault: true
          version: 1
          editable: false
        EOF
        /run.sh
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    networks:
      - loki

and here is the database URL setting:


Grafana is successfully connecting to the data source “Loki”.

If you don’t see any error, then your Loki instance is probably working. You can also try to use the push API (see Loki HTTP API | Grafana Loki documentation) to see if that’s the case or not.

If you are able to determine that your Loki instance is functional, then i’d look at promtail next to make sure it’s configured correctly for log collection.