── GENERATED OUTPUT ──

Monitoring

Prometheus + Grafana monitoring stack with pre-built dashboards and alert rules.

## Generation

bash
exo gen monitoring

## Generated Files

text
monitoring/
├── prometheus.yml # Scrape configuration
└── docker-compose.monitoring.yml # Prometheus + Grafana stack
grafana_dashboard.json # Pre-built dashboard
alerts.yml # Prometheus alert rules

## Prometheus Config

monitoring/prometheus.yml
1global:
2 scrape_interval: 15s
3
4scrape_configs:
5 - job_name: 'my-service'
6 static_configs:
7 - targets: ['host.docker.internal:8080']

## Docker Compose

monitoring/docker-compose.monitoring.yml
1version: '3.8'
2services:
3 prometheus:
4 image: prom/prometheus:latest
5 volumes:
6 - ./prometheus.yml:/etc/prometheus/prometheus.yml
7 ports:
8 - "9090:9090"
9
10 grafana:
11 image: grafana/grafana:latest
12 ports:
13 - "3000:3000"
14 environment:
15 - GF_SECURITY_ADMIN_PASSWORD=admin

## Alert Rules

alerts.yml
1groups:
2 - name: my-service-alerts
3 rules:
4 - alert: HighErrorRate
5 expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.1
6 for: 5m
7 labels:
8 severity: critical
9 annotations:
10 summary: "High error rate detected"
11
12 - alert: HighLatency
13 expr: histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m])) > 0.5
14 for: 5m
15 labels:
16 severity: warning

## Usage

bash
# Start monitoring stack
docker-compose -f monitoring/docker-compose.monitoring.yml up -d
# Access
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3000 (admin/admin)