extensions:
  file_storage/queue:
    directory: /var/lib/otelcol/queue
    create_directory: true

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

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  batch:
    timeout: 1s

exporters:
  otlp/backend:
    endpoint: backend.example.internal:4317
    tls:
      insecure: false
    sending_queue:
      enabled: true
      # Batches waiting for the backend live on disk, so they survive a
      # collector restart during the outage.
      storage: file_storage/queue
      queue_size: 10000
    retry_on_failure:
      enabled: true
      initial_interval: 2s
      max_interval: 10s
      # 0 keeps retrying for as long as the outage lasts.
      max_elapsed_time: 0s

service:
  extensions: [file_storage/queue]
  pipelines:
    logs:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp/backend]
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp/backend]
