π Full Observability Stack Setup Guide (PLPA)
This repository contains a complete, lightweight, and modern observability stack for your homelab, featuring:
- Promtail β Log collection
- Loki β Log storage
- Prometheus β Metrics collection
- Alertmanager β Alert routing (via Pushover)
- Grafana β Visualization & UI
This stack is designed to run easily in Docker and centralize your application and system logs.
Follow these steps to get your logging and monitoring system running:
-
π¦ Save the files
- Ensure all essential YAML configuration files are placed in the same directory:
docker-compose.yamlloki-config.yamlpromtail-config.yamlprometheus.yamlalertmanager.yaml
- Ensure all essential YAML configuration files are placed in the same directory:
-
βΆοΈ Start the stack- Run the following command in the directory containing the files to download images and start the services in the background:
docker compose up -dOnce the stack is running, you can access the following web interfaces:
| Service | Purpose | URL |
|---|---|---|
| Grafana | Central UI for logs, metrics, alerts | http://localhost:3030 (or http://<your-server-ip>:3030) |
| Prometheus | Metrics query and status UI | http://localhost:9090 |
| Alertmanager | Alert grouping and routing UI | http://localhost:9093 |
- Default Grafana login:
admin/strongpassword- Change this immediately after logging in.
Grafana needs to know where to find your logs (Loki) and metrics (Prometheus):
- In Grafana, go to Configuration β Data sources.
- Add Loki (Logs):
- Click Add data source and select Loki.
- Under HTTP β URL, enter:
http://loki:3100(this uses the Docker service name). - Click Save & Test.
- Add Prometheus (Metrics):
- Click Add data source and select Prometheus.
- Under HTTP β URL, enter:
http://prometheus:9090. - Click Save & Test.
Alertmanager is wired to send notifications via Pushover.
- Open
alertmanager.yamland replace:YOUR_PUSHOVER_APP_TOKENwith your Pushover Application Key.YOUR_PUSHOVER_USER_KEYwith your Pushover User Key or Group Key.
- In Grafana, create alert rules (using the bell icon π) based on:
- LogQL (Loki) queries β e.g., log lines containing
"ERROR". - PromQL (Prometheus) queries β e.g., CPU usage > 90%.
- LogQL (Loki) queries β e.g., log lines containing
- Grafana forwards these alerts to Alertmanager, which then sends notifications to your Pushover devices.