diff --git a/config/loki-config.yaml b/config/loki-config.yaml new file mode 100644 index 0000000..4f419e8 --- /dev/null +++ b/config/loki-config.yaml @@ -0,0 +1,30 @@ +--- +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + instance_addr: 127.0.0.1 + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +ruler: + alertmanager_url: http://localhost:9093 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 596596e..03bdf04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ volumes: driver: local prometheus-data: driver: local + data_loki: + driver: local networks: grafana-prometheus: external: true @@ -58,6 +60,26 @@ services: restart: unless-stopped networks: - grafana-prometheus + loki: + container_name: loki + image: docker.io/grafana/loki:3.5.0 + command: "-config.file=/etc/loki/config.yaml" # Tells Grafana Loki to start with the config file. + ports: + # --> (Optional) Remove when using traefik... + - "3100:3100" + # <-- + volumes: + - ./config/loki-config.yaml:/etc/loki/config.yaml:ro + - data_loki:/loki:rw + networks: + - grafana-prometheus + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://localhost:3100/ready"] + interval: 10s # check every 10 seconds + timeout: 5s # wait max 5 seconds per check + retries: 5 # mark as unhealthy after 5 failures + start_period: 20s # wait 20s after container starts before first check https_portal: container_name: https_portal image: "steveltn/https-portal:1.21" @@ -81,4 +103,5 @@ services: - ./https_portal/log:/var/log/nginx # nginx logs depends_on: - prometheus - - grafana \ No newline at end of file + - grafana + - loki \ No newline at end of file