# OpenTelemetry Collector configuration for Expanso

receivers:
  # Receive OTLP metrics via gRPC
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  # Add batch processing to improve performance
  batch:
    timeout: 10s
    send_batch_size: 1024

  # Add resource attributes processor for enrichment
  resource:
    attributes:
      - key: collector
        value: expanso-main
        action: upsert

exporters:
  # Export to Prometheus using prometheus exporter
  prometheus:
    endpoint: 0.0.0.0:9090
    namespace: expanso

  # Also log metrics for debugging (optional)
  logging:
    loglevel: info

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [batch, resource]
      exporters: [prometheus, logging]
