# Same as collector.yaml, plus every trace is also sent to Langfuse over OTLP/HTTP.
# LANGFUSE_AUTH = base64("pk-lf-...:sk-lf-..."). Use your region's host or your self-hosted URL.
receivers:
  otlp:
    protocols:
      grpc: { endpoint: 0.0.0.0:4317 }
      http: { endpoint: 0.0.0.0:4318 }

processors:
  memory_limiter: { check_interval: 1s, limit_percentage: 80 }
  batch: {}
  attributes/redact:
    actions:
      - { key: gen_ai.input.messages, action: delete }
      - { key: gen_ai.output.messages, action: delete }
      - { key: gen_ai.system_instructions, action: delete }

exporters:
  otlp/lgtm:
    endpoint: lgtm:4317
    tls: { insecure: true }
  otlphttp/langfuse:
    endpoint: https://cloud.langfuse.com/api/public/otel
    headers: { Authorization: "Basic ${env:LANGFUSE_AUTH}" }

service:
  pipelines:
    traces:  { receivers: [otlp], processors: [memory_limiter, attributes/redact, batch], exporters: [otlp/lgtm, otlphttp/langfuse] }
    metrics: { receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp/lgtm] }
    logs:    { receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp/lgtm] }
