# Drakkar integration test configuration
# All values can be overridden with env vars: DRAKKAR_KAFKA__BROKERS, etc.

worker_name_env: "WORKER_ID"
cluster_name: "main cluster"

kafka:
  brokers: "kafka:9092"
  source_topic: "search-requests"
  consumer_group: "drakkar-integration"
  max_poll_records: 50
  max_poll_interval_ms: 300000
  session_timeout_ms: 45000
  heartbeat_interval_ms: 3000

executor:
  binary_path: "/usr/local/bin/run-rg"
  max_workers: 4
  task_timeout_seconds: 120
  window_size: 10
  max_retries: 3
  drain_timeout_seconds: 5
  backpressure_high_multiplier: 32
  backpressure_low_multiplier: 4

sinks:
  kafka:
    results:
      topic: "search-results"
      # brokers inherited from kafka.brokers
      ui_url: "http://localhost:8088"

  postgres:
    main:
      dsn: "postgresql://drakkar:drakkar@postgres:5432/drakkar"
      pool_min: 1
      pool_max: 5

  mongo:
    archive:
      uri: "mongodb://mongo:27017"
      database: "drakkar"
      ui_url: "http://localhost:8089"

  redis:
    cache:
      url: "redis://redis:6379/0"
      key_prefix: "drakkar:"
      ui_url: "http://localhost:8087"

  http:
    webhook:
      url: "http://webhook:8080/"
      method: "POST"
      timeout_seconds: 10
      max_retries: 2

  filesystem:
    logs:
      base_path: "/tmp"

dlq:
  topic: ""  # auto-derived: search-requests_dlq

metrics:
  enabled: true
  port: 9090

logging:
  level: "INFO"
  format: "json"

debug:
  enabled: true
  port: 8080
  db_dir: "/shared"
  store_events: true
  store_config: true
  store_state: true
  state_sync_interval_seconds: 10
  expose_env_vars:
    - "WORKER_ID"
    - "DRAKKAR_CONFIG"
  retention_hours: 24
  retention_max_events: 100000
  store_output: true
  flush_interval_seconds: 3
  max_buffer: 50000
  max_ui_rows: 5000
  prometheus_url: "http://localhost:9099"
  prometheus_rate_interval: "30s"
  prometheus_worker_label: 'instance="{worker_id}:{metrics_port}"'
  prometheus_cluster_label: 'cluster="main-cluster"'
  custom_links:
    - name: "Drakkar GitHub"
      url: "https://github.com/wlame/drakkar?from={worker_id}"
