# Health Check Configuration for K8s-Ready Environment
# This file defines comprehensive health check patterns that mirror
# Kubernetes readiness, liveness, and startup probes

health_checks:
  # Application Services
  admin-backend:
    startup_probe:
      path: /health/startup
      initial_delay: 30s
      period: 10s
      timeout: 5s
      failure_threshold: 6
    readiness_probe:
      path: /health/ready
      period: 10s
      timeout: 5s
      failure_threshold: 3
    liveness_probe:
      path: /health/live
      period: 30s
      timeout: 10s
      failure_threshold: 3

  admin-frontend:
    startup_probe:
      path: /
      initial_delay: 20s
      period: 10s
      timeout: 5s
      failure_threshold: 3
    readiness_probe:
      path: /
      period: 15s
      timeout: 5s
      failure_threshold: 2
    liveness_probe:
      path: /
      period: 30s
      timeout: 10s
      failure_threshold: 3

  # Platform Services
  mvp-platform-vehicles-api:
    startup_probe:
      path: /health/startup
      initial_delay: 30s
      period: 10s
      timeout: 5s
      failure_threshold: 6
    readiness_probe:
      path: /health/ready
      period: 10s
      timeout: 5s
      failure_threshold: 3
    liveness_probe:
      path: /health/live
      period: 30s
      timeout: 10s
      failure_threshold: 3

  mvp-platform-tenants:
    startup_probe:
      path: /health/startup
      initial_delay: 30s
      period: 10s
      timeout: 5s
      failure_threshold: 6
    readiness_probe:
      path: /health/ready
      period: 10s
      timeout: 5s
      failure_threshold: 3
    liveness_probe:
      path: /health/live
      period: 30s
      timeout: 10s
      failure_threshold: 3

  mvp-platform-landing:
    startup_probe:
      path: /
      initial_delay: 20s
      period: 10s
      timeout: 5s
      failure_threshold: 3
    readiness_probe:
      path: /
      period: 15s
      timeout: 5s
      failure_threshold: 2
    liveness_probe:
      path: /
      period: 30s
      timeout: 10s
      failure_threshold: 3

# Monitoring Endpoints
monitoring:
  metrics:
    traefik:
      endpoint: http://localhost:8080/metrics
      format: prometheus
    services:
      admin-backend:
        endpoint: /metrics
        port: 3001
      mvp-platform-vehicles-api:
        endpoint: /metrics
        port: 8000
      mvp-platform-tenants:
        endpoint: /metrics
        port: 8000

  logging:
    level: INFO
    format: json
    destinations:
      - console
      - file:/var/log/app/application.log

# Service Discovery Validation
service_discovery:
  expected_services:
    - admin-app@docker
    - admin-api@docker
    - landing@docker
    - vehicles-api@docker
    - tenants-api@docker
  expected_routes:
    - "Host(admin.motovaultpro.com)"
    - "Host(motovaultpro.com)"
    - "PathPrefix(/api/platform/vehicles)"
    - "PathPrefix(/api/platform/tenants)"
    - "PathPrefix(/api)"

# Performance Thresholds (K8s-ready SLOs)
performance:
  response_time:
    target: 500ms
    max: 2000ms
  availability:
    target: 99.9%
    min: 99.0%
  error_rate:
    target: 0.1%
    max: 1.0%