Grafana
Overview
Grafana provides visualization dashboards for application metrics and logs. It runs alongside Prometheus (metrics) and Loki (logs) in the monitoring stack.
Stack
Prometheus (metrics) ──┐
├── Grafana (dashboards)
Loki (logs) ──────────┘| Service | Port | Purpose |
|---|---|---|
| Grafana | :3000 | Dashboard UI |
| Prometheus | :9090 | Metrics collection |
| Loki | :3100 | Log aggregation |
Dashboards
| Dashboard | Source | Metrics |
|---|---|---|
| Octane Workers | Prometheus | Request rate, memory, worker count |
| Database | Prometheus | Connection count, query time |
| Queue | Prometheus | Job count, wait time, failure rate |
| Application Logs | Loki | Error rate, 5xx responses |
Access
- Dev:
http://localhost:3000(default credentials:admin/admin) - Prod:
https://grafana.sutomo.sch.id
Docker Compose
yaml
services:
prometheus:
image: prom/prometheus:v3
volumes:
- ./docker/prometheus:/etc/prometheus
loki:
image: grafana/loki:v3
grafana:
image: grafana/grafana:13
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
ports:
- "3000:3000"Key Files
| File | Purpose |
|---|---|
docker-compose.yml | Grafana + Prometheus + Loki service definitions |
docker/prometheus/prometheus.yml | Prometheus scrape configuration |
config/octane.php | Octane Prometheus metrics endpoint |