smartclass-ops / monitoring /prometheus.yml
balaji958685's picture
Add monitoring - Prometheus config
049d0ed verified
# SmartClass Prometheus Configuration
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_timeout: 10s
# Alert rules
rule_files:
- /etc/prometheus/rules/smartclass_alerts.yml
# Scrape configurations
scrape_configs:
# ─── Prometheus self-monitoring ─────────────────────────────────────
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
# ─── SmartClass API Server ──────────────────────────────────────────
- job_name: "smartclass-api"
metrics_path: /metrics
static_configs:
- targets: ["api:8000"]
labels:
service: "api"
environment: "production"
scrape_interval: 10s
# ─── SmartClass Edge Nodes ──────────────────────────────────────────
- job_name: "smartclass-edge"
metrics_path: /metrics
static_configs:
# Local test edge node
- targets: ["edge:9100"]
labels:
service: "edge"
section: "test"
environment: "development"
# Production edge nodes (add as deployed)
# - targets: ["192.168.1.101:9100"]
# labels:
# service: "edge"
# section: "AIML-3-A"
# location: "room-301"
# environment: "production"
# - targets: ["192.168.1.102:9100"]
# labels:
# service: "edge"
# section: "AIML-3-B"
# location: "room-302"
# environment: "production"
scrape_interval: 10s
# Relabel to add node hostname
relabel_configs:
- source_labels: [__address__]
target_label: instance
regex: "(.+):.*"
replacement: "$1"
# ─── Redis Exporter (optional) ──────────────────────────────────────
# Uncomment if you add redis-exporter service
# - job_name: "redis"
# static_configs:
# - targets: ["redis-exporter:9121"]
# ─── PostgreSQL Exporter (optional) ─────────────────────────────────
# Uncomment if you add postgres-exporter service
# - job_name: "postgres"
# static_configs:
# - targets: ["postgres-exporter:9187"]