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

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  # Stamps every record with the environment and namespace it came from, but
  # only where the sender did not set them already.
  transform/set-resource:
    error_mode: ignore
    log_statements:
      - context: resource
        statements:
          - set(attributes["deployment.environment.name"], "production") where attributes["deployment.environment.name"] == nil
          - set(attributes["service.namespace"], "shop") where attributes["service.namespace"] == nil
    trace_statements:
      - context: resource
        statements:
          - set(attributes["deployment.environment.name"], "production") where attributes["deployment.environment.name"] == nil
          - set(attributes["service.namespace"], "shop") where attributes["service.namespace"] == nil
    metric_statements:
      - context: resource
        statements:
          - set(attributes["deployment.environment.name"], "production") where attributes["deployment.environment.name"] == nil
          - set(attributes["service.namespace"], "shop") where attributes["service.namespace"] == nil
  batch:
    timeout: 5s

exporters:
  otlphttp:
    endpoint: https://your-backend:4318

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [memory_limiter, transform/set-resource, batch]
      exporters: [otlphttp]
    metrics:
      receivers: [otlp]
      processors: [memory_limiter, transform/set-resource, batch]
      exporters: [otlphttp]
    traces:
      receivers: [otlp]
      processors: [memory_limiter, transform/set-resource, batch]
      exporters: [otlphttp]
