Centralized Logs with Grafana Loki and Promtail
Monitoring

Centralized Logs with Grafana Loki and Promtail

  • AuthorBen H.
  • Date
  • Time13 minutes

Why Loki?

Loki stores logs as compressed chunks indexed by labels. It's cost-effective and integrates with Grafana for queries and dashboards.

Install Promtail

bash
curl -O -L "https://github.com/grafana/loki/releases/download/v2.8.2/promtail-linux-amd64.zip"
unzip promtail-linux-amd64.zip
sudo mv promtail-linux-amd64 /usr/local/bin/promtail
sudo chmod +x /usr/local/bin/promtail

Minimal Promtail Config

yaml
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

Technical Author

Ben H.

Ben H.

Rack, remote hands, and logistics in the datacenter. Writes when the job is hardware, hands on site, and getting gear in place.