# OTLP Tracing Export
#
# Exports distributed tracing spans to an OpenTelemetry Collector via
# OTLP/gRPC. Requires the `otel` feature at compile time.
#
# The telemetry.otlp_endpoint field sets the collector address. If omitted,
# the OTEL_EXPORTER_OTLP_ENDPOINT environment variable is used as a
# fallback. When neither is set, OTLP export is disabled and the proxy
# runs with fmt-only logging (the default behavior).
#
# Usage:
#   cargo run --features otel -p praxis-proxy -- -c examples/configs/observability/tracing-otlp.yaml
#   curl http://localhost:8080/

listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains: [main]

filter_chains:
  - name: main
    filters:
      - filter: request_id

      - filter: static_response
        status: 200

telemetry:
  otlp_endpoint: "http://localhost:4317"
  # Head-based sampling rate (0.0 to 1.0). Sample 1% of root traces;
  # child spans inherit the parent decision via W3C traceparent.
  # Omit or remove to use the OTel default (ParentBased(AlwaysOn)).
  sampling_rate: 0.01
  # service_name: "praxis"          # OTel service.name (default: "praxis")
  # service_version: "0.1.0"        # OTel service.version
  # environment: "production"       # deployment.environment resource attribute
  # batch_size: 512                 # max spans per batch export (default: 512)
  # batch_interval_secs: 5          # export interval in seconds (default: 5)
  # otlp_headers:                   # custom gRPC metadata (e.g. API keys)
  #   x-api-key: "your-key-here"
