# Prometheus Configuration for MotoVaultPro K8s-equivalent monitoring
# This configuration mirrors K8s ServiceMonitor and PodMonitor patterns

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    cluster: 'motovaultpro-dev'
    environment: 'development'

# Rule files for alerting (K8s PrometheusRule equivalent)
rule_files:
  - "alerts/*.yml"

# Scrape configurations (K8s ServiceMonitor equivalent)
scrape_configs:
  # Traefik metrics (Infrastructure monitoring)
  - job_name: 'traefik'
    static_configs:
      - targets: ['traefik:8080']
    metrics_path: '/metrics'
    scrape_interval: 15s
    scrape_timeout: 10s

  # Application backend metrics
  - job_name: 'admin-backend'
    static_configs:
      - targets: ['admin-backend:3001']
    metrics_path: '/metrics'
    scrape_interval: 30s
    scrape_timeout: 10s

  # Platform services metrics
  - job_name: 'platform-vehicles-api'
    static_configs:
      - targets: ['mvp-platform-vehicles-api:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s
    scrape_timeout: 10s

  - job_name: 'platform-tenants-api'
    static_configs:
      - targets: ['mvp-platform-tenants:8000']
    metrics_path: '/metrics'
    scrape_interval: 30s
    scrape_timeout: 10s

  # Database monitoring (PostgreSQL exporter equivalent)
  - job_name: 'postgres-app'
    static_configs:
      - targets: ['admin-postgres:5432']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  - job_name: 'postgres-platform'
    static_configs:
      - targets: ['platform-postgres:5432']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  - job_name: 'postgres-vehicles'
    static_configs:
      - targets: ['mvp-platform-vehicles-db:5432']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  # Redis monitoring
  - job_name: 'redis-app'
    static_configs:
      - targets: ['admin-redis:6379']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  - job_name: 'redis-platform'
    static_configs:
      - targets: ['platform-redis:6379']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  - job_name: 'redis-vehicles'
    static_configs:
      - targets: ['mvp-platform-vehicles-redis:6379']
    metrics_path: '/metrics'
    scrape_interval: 60s
    scrape_timeout: 15s

  # MinIO monitoring
  - job_name: 'minio'
    static_configs:
      - targets: ['admin-minio:9000']
    metrics_path: '/minio/v2/metrics/cluster'
    scrape_interval: 60s
    scrape_timeout: 15s

# Alertmanager configuration (K8s Alertmanager equivalent)
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          - alertmanager:9093