Skip to content

Instantly share code, notes, and snippets.

@mehranz
Last active March 1, 2021 18:28
Show Gist options
  • Save mehranz/5c423bce73cb13021621fa19f57c8bd3 to your computer and use it in GitHub Desktop.
Save mehranz/5c423bce73cb13021621fa19f57c8bd3 to your computer and use it in GitHub Desktop.
docker compose to run grafana + loki.
version: "3"
networks:
loki:
services:
loki:
image: grafana/loki:2.0.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
networks:
- loki
promtail:
image: grafana/promtail:2.0.0
volumes:
- /var/log:/var/log
- $GRAFANA_HOME/config:/etc/promtail
command: -config.file=/etc/promtail/config.yml
networks:
- loki
grafana:
image: grafana/grafana:latest
ports:
- "3008:3000"
networks:
- loki
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*log
@mehranz
Copy link
Author

mehranz commented Mar 1, 2021

you should set $GRAFANA_HOME variable to a directory that contains the config file of promtail. ($GRAFANA_HOME/config/config.yml)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment