Monitoring Stack Setup
Complete observability stack with Prometheus, Grafana, Loki, and AlertManager.
One
docker compose upto full production monitoring. Stop flying blind.
What You Get
- Docker Compose stack: Prometheus, Grafana, AlertManager, Loki, Promtail, node-exporter, cAdvisor
- 30+ alert rules covering infrastructure, containers, and application metrics
- 3 Grafana dashboards: Node overview, Docker containers, Application metrics
- Log aggregation with Loki + Promtail (search logs in Grafana)
- One-command setup script with health checks
- Monitoring strategy guide: SLI/SLO/SLA, alert fatigue, runbooks
File Tree
monitoring-stack-setup/
├── README.md
├── manifest.json
├── LICENSE
├── docker-compose.yml # Full stack definition
├── .env.example # Configurable variables
├── prometheus/
│ ├── prometheus.yml # Scrape configs + relabeling
│ ├── alert-rules.yml # 30+ alert rules
│ └── recording-rules.yml # Pre-computed aggregations
├── grafana/
│ ├── provisioning/
│ │ ├── datasources.yaml # Prometheus + Loki
│ │ └── dashboards.yaml # Dashboard provisioning
│ └── dashboards/
│ ├── node-overview.json # CPU, memory, disk, network
│ ├── docker-overview.json # Container metrics
│ └── application-metrics.json # Request rate, latency, errors
├── alertmanager/
│ └── alertmanager.yml # Routing: PagerDuty, Slack
├── loki/
│ └── loki-config.yml # Loki with retention
├── promtail/
│ └── promtail-config.yml # Log scraping + labels
├── scripts/
│ └── setup.sh # One-command setup
└── guides/
└── monitoring-strategy.md # SLI/SLO, alert fatigue
Getting Started
1. Configure environment
cp .env.example .env
# Edit .env with your settings (Slack webhook, PagerDuty key, etc.)
nano .env
2. Start the stack
# One-command setup (creates dirs, starts stack, waits for health)
./scripts/setup.sh
# Or manually:
docker compose up -d
3. Access the dashboards
| Service | URL | Default Credentials |
|---|---|---|
| Grafana | http://localhost:3000 | admin / admin |
| Prometheus | http://localhost:9090 | — |
| AlertManager | http://localhost:9093 | — |
4. Add your application
Add scrape targets to prometheus/prometheus.yml:
scrape_configs:
- job_name: 'my-app'
static_configs:
- targets: ['host.docker.internal:8080']
metrics_path: /metrics
Then reload: curl -X POST http://localhost:9090/-/reload
Architecture
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Your App │────▶│ Prometheus │────▶│ Grafana │
│ /metrics │ │ (metrics) │ │ (dashboards)│
└─────────────┘ └──────┬───────┘ └──────▲──────┘
│ │
┌──────▼───────┐ ┌──────┴──────┐
│ AlertManager │ │ Loki │
│ (alerting) │ │ (logs) │
└──────┬───────┘ └──────▲──────┘
│ │
┌──────▼───────┐ ┌──────┴──────┐
│ Slack / PD │ │ Promtail │
│ (notify) │ │ (log ship) │
└──────────────┘ └─────────────┘
┌──────────────┐ ┌──────────────┐
│node-exporter │ │ cAdvisor │
│ (host metrics│ │(container │
│ CPU/mem/disk│ │ metrics) │
└──────────────┘ └──────────────┘
Requirements
- Docker 24+ and Docker Compose v2
- 2 GB RAM minimum (4 GB recommended)
- 10 GB disk for metrics and log retention
- Ports: 3000, 9090, 9093 (configurable in .env)
Related Products
- Log Management Toolkit — Centralized logging with ELK and Loki
- Backup & Disaster Recovery — Backup strategies and DR runbooks
- Linux Hardening Scripts — CIS benchmark-aligned hardening scripts
Datanest Digital | datanest.dev | MIT License
- Issues: Report bugs or request features
- Updates: Purchase includes all future updates
This is 1 of 6 resources in the DevOps Toolkit Pro toolkit. Get the complete [Monitoring Stack Setup] with all files, templates, and documentation for $XX.
Or grab the entire DevOps Toolkit Pro bundle (6 products) for $178 — save 30%.
Top comments (0)