# ======================================== # PROMETHEUS CONFIGURATION # Enterprise Monitoring Setup # ======================================== global: scrape_interval: 15s evaluation_interval: 15s external_labels: cluster: 'math-platform' replica: '{{.ExternalURL}}' # Alertmanager configuration alerting: alertmanagers: - static_configs: - targets: ['alertmanager:9093'] # Load rules once and periodically evaluate them rule_files: - /etc/prometheus/rules/*.yml # Scrape configurations scrape_configs: # Prometheus itself - job_name: 'prometheus' static_configs: - targets: ['localhost:9090'] # Backend API - job_name: 'backend' static_configs: - targets: ['backend:3001'] metrics_path: '/metrics' scrape_interval: 10s scrape_timeout: 5s # Frontend - job_name: 'frontend' static_configs: - targets: ['frontend:3000'] scrape_interval: 30s # PostgreSQL (via postgres_exporter) - job_name: 'postgres' static_configs: - targets: ['postgres-exporter:9187'] scrape_interval: 15s # Redis (via redis_exporter) - job_name: 'redis' static_configs: - targets: ['redis-exporter:9121'] scrape_interval: 15s # Workers - job_name: 'pdf-worker' static_configs: - targets: ['pdf-worker:3002'] scrape_interval: 30s - job_name: 'exercise-worker' static_configs: - targets: ['exercise-worker:3003'] scrape_interval: 30s - job_name: 'notification-worker' static_configs: - targets: ['notification-worker:3004'] scrape_interval: 30s # Nginx - job_name: 'nginx' static_configs: - targets: ['nginx:9113'] scrape_interval: 30s # Node Exporter (host metrics) - job_name: 'node-exporter' static_configs: - targets: ['node-exporter:9100'] scrape_interval: 15s # Docker Daemon - job_name: 'docker' static_configs: - targets: ['docker-exporter:9323'] scrape_interval: 30s