# Prometheus Configuration for Classeo
# Scrapes metrics from PHP backend and other services

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    environment: ${ENVIRONMENT:-development}
    project: classeo

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

# Load alert rules
rule_files:
  - /etc/prometheus/alerts.yml

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

  # PHP Backend metrics
  - job_name: 'classeo-backend'
    metrics_path: '/metrics'
    static_configs:
      - targets: ['php:8000']
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
        replacement: 'classeo-backend'

  # Redis metrics (via redis_exporter would be added in production)
  # For now, we rely on application-level metrics

  # PostgreSQL metrics (via postgres_exporter would be added in production)
  # For now, we rely on application-level metrics

  # RabbitMQ metrics
  - job_name: 'rabbitmq'
    static_configs:
      - targets: ['rabbitmq:15692']
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
        replacement: 'classeo-rabbitmq'
