# OpenTelemetry Collector Configuration
# Receives traces and metrics from Agent OS

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:
    timeout: 10s
    send_batch_size: 1024
    
  memory_limiter:
    check_interval: 1s
    limit_mib: 1000
    spike_limit_mib: 200
    
  resource:
    attributes:
      - key: service.namespace
        value: agent-os
        action: upsert

exporters:
  # Export traces to Jaeger
  otlp/jaeger:
    endpoint: jaeger:4317
    tls:
      insecure: true
      
  # Export metrics to Prometheus
  prometheus:
    endpoint: 0.0.0.0:8888
    namespace: agent_os_otel
    
  # Debug output (disable in production)
  logging:
    loglevel: info

extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  zpages:
    endpoint: 0.0.0.0:55679

service:
  extensions: [health_check, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch, resource]
      exporters: [otlp/jaeger, logging]
      
    metrics:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [prometheus, logging]
