← Back to all products
$49
Monitoring Stack Setup
Complete Prometheus + Grafana + Alertmanager setup with dashboards, alert rules, and service discovery configs.
YAMLShellJSONMarkdownConfigDockerGrafanaPrometheus
📁 File Structure 18 files
monitoring-stack-setup/
├── .env.example
├── LICENSE
├── README.md
├── alertmanager/
│ └── alertmanager.yml
├── docker-compose.yml
├── grafana/
│ ├── dashboards/
│ │ ├── application-metrics.json
│ │ ├── docker-overview.json
│ │ └── node-overview.json
│ └── provisioning/
│ ├── dashboards.yaml
│ └── datasources.yaml
├── guides/
│ └── monitoring-strategy.md
├── loki/
│ └── loki-config.yml
├── prometheus/
│ ├── alert-rules.yml
│ ├── prometheus.yml
│ └── recording-rules.yml
├── promtail/
│ └── promtail-config.yml
└── scripts/
└── setup.sh
📖 Documentation Preview README excerpt
Monitoring Stack Setup
Complete observability stack with Prometheus, Grafana, Loki, and AlertManager.
One docker compose up to full production monitoring. Stop flying blind.
[](LICENSE)
[](https://docs.docker.com/compose/)
[](https://datanest.dev)
---
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
*... continues with setup instructions, usage examples, and more.*
📄 Code Sample .yml preview
docker-compose.yml
# =============================================================================
# Monitoring Stack — Docker Compose
# Datanest Digital — monitoring-stack-setup v1.0.0
# =============================================================================
# Full observability stack: Prometheus, Grafana, AlertManager, Loki, Promtail,
# node-exporter, and cAdvisor.
#
# Usage: docker compose up -d
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Prometheus — Metrics collection and alerting engine
# ---------------------------------------------------------------------------
prometheus:
image: prom/prometheus:v2.51.0
container_name: prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME:-30d}'
- '--storage.tsdb.retention.size=${PROMETHEUS_RETENTION_SIZE:-10GB}'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml:ro
- ./prometheus/recording-rules.yml:/etc/prometheus/recording-rules.yml:ro
- prometheus_data:/prometheus
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
networks:
- monitoring
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
# ---------------------------------------------------------------------------
# Grafana — Dashboards and visualization
# ---------------------------------------------------------------------------
grafana:
image: grafana/grafana:10.4.0
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
# ... 148 more lines ...