# Prometheus Configuration for Provisioning Platform

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    cluster: 'provisioning-platform'
    environment: '${PLATFORM_ENVIRONMENT:-development}'

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules
rule_files:
  - '/etc/prometheus/rules/*.yml'

# Scrape configurations
scrape_configs:
  # Prometheus itself
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  # Orchestrator
  - job_name: 'orchestrator'
    static_configs:
      - targets: ['orchestrator:8080']
    metrics_path: '/metrics'
    scrape_interval: 10s
    scrape_timeout: 5s

  # Control Center
  - job_name: 'control-center'
    static_configs:
      - targets: ['control-center:8081']
    metrics_path: '/metrics'
    scrape_interval: 10s

  # API Server
  - job_name: 'api-server'
    static_configs:
      - targets: ['api-server:8083']
    metrics_path: '/metrics'
    scrape_interval: 10s

  # Extension Registry
  - job_name: 'extension-registry'
    static_configs:
      - targets: ['extension-registry:8082']
    metrics_path: '/api/v1/metrics'
    scrape_interval: 30s

  # OCI Registry (Zot)
  - job_name: 'oci-registry'
    static_configs:
      - targets: ['oci-registry:5000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  # Gitea
  - job_name: 'gitea'
    static_configs:
      - targets: ['gitea:3000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  # PostgreSQL Exporter (if deployed)
  - job_name: 'postgres'
    static_configs:
      - targets: ['postgres-exporter:9187']
    scrape_interval: 30s

  # Node Exporter (if deployed)
  - job_name: 'node'
    static_configs:
      - targets: ['node-exporter:9100']
    scrape_interval: 30s

  # Docker metrics (via cAdvisor if deployed)
  - job_name: 'cadvisor'
    static_configs:
      - targets: ['cadvisor:8080']
    scrape_interval: 30s
