How yrsurya/dockprom works
Project type and purpose
• This is a Docker-based monitoring “stack” orchestrated via Docker Compose.
• It brings up Prometheus (time-series database + scraper), Grafana (visualization), AlertManager (alert routing), NodeExporter and cAdvisor (metric exporters), Pushgateway (batch/job metrics), and Caddy (reverse proxy + basic-auth).
File structure
• Top-level orchestration:
• docker-compose.yml (main compose)
• docker-compose.exporters.yml (optional exporters only)
• Service folders/configs:
• prometheus/ (scrape config, alert.rules)
• alertmanager/ (alertmanager.yml)
• grafana/ (provisioning/dashboards, datasources)
• caddy/ (Caddyfile)
• Helpers/aws: CloudFormation/TaskDefinition JSON and Prometheus config for AWS ECS/EC2 deployments.
• config/: environment variables for Grafana auth.
• screens/: example visualization screenshots.
Main components & their roles
• Docker Host & Docker Engine (underlying host VM or physical server)
• Exporters (running as containers on the host network “monitor-net”):
• node_exporter – exposes host metrics (CPU, memory, filesystem)
• cAdvisor – exposes container metrics (resource usage per container)
• Prometheus server – periodically scrapes exporters & Pushgateway, stores metrics, evaluates alert.rules
• Pushgateway – accepts push-style metrics (for batch jobs)
• AlertManager – receives alerts from Prometheus, groups & routes notifications (Slack, email, etc.)
• Grafana – queries Prometheus, renders dashboards (pre-provisioned via grafana/provisioning)
• Caddy – reverse-proxy + basic-auth in front of Prometheus and AlertManager HTTP UIs
• External notifications – e.g., Slack webhook endpoint, email server
Relationships & data flows
• node_exporter → (HTTP scrape) → Prometheus
• cAdvisor → Prometheus
• Pushgateway ← (push) ← batch job / ephemeral metrics
• Prometheus → (alert POST) → AlertManager
• Grafana ← (query) ← Prometheus
• User’s browser → Caddy → {Prometheus UI, AlertManager UI, Grafana UI}
• AlertManager → (webhook) → Slack / email
Architectural patterns & design principles
• Containerized micro-services: one concern per container
• Clear separation: data collection (exporters), data storage & processing (Prometheus), presentation (Grafana), alert routing (AlertManager), edge routing/auth (Caddy)
• Declarative provisioning: Grafana dashboards and datasources auto-loaded from filesystem
• Infrastructure-as-code for AWS ECS via helpers/aws