Grafana + Loki + Prometheus Local Stack
Stand up a real local observability stack — metrics in Prometheus, logs in Loki, dashboards in Grafana — one small compose change at a time.
You cannot investigate what you cannot see. Here we build a working observability stack on a laptop with docker-compose: Prometheus for metrics, Loki for logs, Grafana to explore both, and Promtail to ship container logs. We add one service or one config file per step, with a short note on what each piece does and why it matters during an incident.
What you'll build
- Run Prometheus, Loki and Grafana locally with docker-compose
- Configure Prometheus scraping and Loki storage
- Provision Grafana datasources and a dashboard as code
- Ship container logs into Loki with Promtail
Contents
- What we're building
- Start with Prometheus
- How often to scrape
- Scrape itself first
- Hand the config to the container
- Don't lose the metrics
- Add Loki for logs
- Tell Loki where to put things
- Run Loki for real
- Add Grafana, the front door
- Skip the login locally
- Wire up Prometheus, as code
- And Loki too
- Let Grafana see the provisioning
- Load dashboards from a folder
- A first real panel
- Configure the log shipper
- Start shipping logs
- Bring the whole thing up