# Prometheus configuration for IT Pro Partner infrastructure
# Scrapes:
#   1. Ops Portal backend (FastAPI /metrics)
#   2. Node Exporter on Core server
#   3. Node Exporter on each Hetzner server
#   4. (Optional) Prometheus self-monitoring
global:
  scrape_interval: 60s      # Every 60s for all targets
  evaluation_interval: 60s
  scrape_timeout: 10s

rule_files:
  - "alerts.yml"

scrape_configs:
  # Self-monitoring
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  # Ops Portal backend metrics
  - job_name: 'ops-portal'
    static_configs:
      - targets: ['127.0.0.1:8090']
    metrics_path: /metrics

  # Core server (netcup) — node exporter on port 9100
  - job_name: 'node-core'
    static_configs:
      - targets: ['127.0.0.1:9100']
    metrics_path: /metrics

  # Hetzner servers — node exporter on each
  - job_name: 'node-hetzner'
    static_configs:
      - targets:
        - '5.161.62.38:9100'     # wphost02
        - '5.161.225.131:9100'   # unms
        - '178.156.131.57:9100'  # unifi
        - '178.156.130.130:9100' # hudu
        - '178.156.149.32:9100'  # fleettracker360
        - '178.156.168.35:9100'  # docker
        - '178.156.167.181:9100' # ai
        - '5.161.114.8:9100'     # app1-bu
        - '87.99.144.163:9100'   # app1 (n8n)
        - '87.99.159.142:9100'   # tony-vps
