Overview
This template provides a production‑ready Prometheus + Grafana monitoring stack as Monk runnables. You can:- Run it directly to get a complete monitoring solution with metrics collection and visualization
- Inherit it in your own infrastructure to add observability to your applications
What this template manages
- Prometheus server for metrics collection
- Grafana for visualization and dashboards
- AlertManager for alerting (optional)
- Service discovery and scrape configuration
- Persistent storage for metrics and dashboards
- Pre-configured data sources
Quick start (run directly)
- Load templates
- Run the monitoring stack
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesin the template, thenmonk load MANIFESTand run.
- Prometheus UI:
http://localhost:9090 - Grafana UI:
http://localhost:3000(default: admin/admin)
Configuration
Key variables you can customize in this template:${monk-volume-path}/prometheus and ${monk-volume-path}/grafana on the host.
Use by inheritance (recommended for monitoring)
Inherit the stack to monitor your applications. Example:Ports and connectivity
- Service:
prometheuson TCP port9090 - Service:
grafanaon TCP port3000 - Service:
alertmanageron TCP port9093(if enabled) - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve service hosts. - From monitored services, Prometheus scrapes metrics via HTTP
Persistence and configuration
- Prometheus data:
${monk-volume-path}/prometheus:/prometheus - Grafana data:
${monk-volume-path}/grafana:/var/lib/grafana - Prometheus config:
${monk-volume-path}/prometheus/config - You can customize Prometheus scrape configs and Grafana dashboards via the mounted volumes.
Features
Prometheus
- Time-series metrics database
- Powerful PromQL query language
- Service discovery (Kubernetes, Docker, Consul, etc.)
- Pull-based metrics collection
- Alerting with AlertManager
- High availability and federation
Grafana
- Beautiful, customizable dashboards
- Multiple data source support
- Templating and variables
- Alerting and notifications
- User management and RBAC
- Dashboard sharing and versioning
Metrics Exposition
Expose metrics from your applications:Alerting
Configure alerts in Prometheus:Use cases
This stack excels at:- Application performance monitoring
- Infrastructure monitoring
- Real-time alerting
- Capacity planning
- SLA monitoring
- DevOps observability
Related templates
- Use
alertmanager/for advanced alerting and notification routing - Integrate with
node-exporter/for system metrics collection - Combine with
loki/for log aggregation and correlation
Troubleshooting
- Access Prometheus targets at
http://localhost:9090/targetsto verify scrape status - Check Grafana data sources in Settings → Data Sources
- Verify metrics are being scraped:
- Check logs:
- For missing metrics, verify:
- Service is exposing metrics on the configured port
- Prometheus can reach the target (check firewalls)
- Scrape configuration is correct
- For Grafana dashboard issues, check data source configuration and time ranges