Anything you do to Grafana Loki twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.
1. Install it reproducibly
docker run -d --name loki -p 3100:3100 grafana/loki:latest
docker run -d --name promtail -v $PWD/promtail.yaml:/etc/promtail/config.yml grafana/promtail2. Describe the desired state
Promtail scraping local logs and shipping to Loki.
server: { http_listen_port: 9080 }
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 }3. Run it from CI
Query logs programmatically with logcli.
logcli query '{app="web"} |= "error"' --since=1h --limit=100Want senior help putting Grafana Loki to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.