# infrastructure/monitoring/prometheus/prometheus.yml
# Prometheus configuration

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    cluster: 'bakery-forecasting'
    replica: 'prometheus-01'

rule_files:
  - "/etc/prometheus/rules/*.yml"

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

scrape_configs:
  # Service discovery for microservices
  - job_name: 'gateway'
    static_configs:
      - targets: ['gateway:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s
    scrape_timeout: 10s

  - job_name: 'auth-service'
    static_configs:
      - targets: ['auth-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'tenant-service'
    static_configs:
      - targets: ['tenant-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'training-service'
    static_configs:
      - targets: ['training-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'forecasting-service'
    static_configs:
      - targets: ['forecasting-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'sales-service'
    static_configs:
      - targets: ['sales-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'external-service'
    static_configs:
      - targets: ['external-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'notification-service'
    static_configs:
      - targets: ['notification-service:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s

  # Infrastructure monitoring
  - job_name: 'redis'
    static_configs:
      - targets: ['redis:6379']
    metrics_path: '/metrics'
    scrape_interval: 30s

  - job_name: 'rabbitmq'
    static_configs:
      - targets: ['rabbitmq:15692']
    metrics_path: '/metrics'
    scrape_interval: 30s

  # Database monitoring (requires postgres_exporter)
  - job_name: 'postgres'
    static_configs:
      - targets: ['postgres-exporter:9187']
    scrape_interval: 30s