How do you configure tail sampling in the Collector?

AdvancedConceptTracing & OpenTelemetry
Answer
processors:
  tail_sampling:
    decision_wait: 10s
    num_traces: 100000
    expected_new_traces_per_sec: 2000
    policies:
      - name: errors
        type: status_code
        status_code: { status_codes: [ERROR] }
      - name: slow
        type: latency
        latency: { threshold_ms: 1000 }
      - name: baseline
        type: probabilistic
        probabilistic: { sampling_percentage: 5 }

A trace is kept if any policy says sample (use and / composite policies for more control). decision_wait must be longer than your typical trace duration; num_traces bounds memory. Spans of one trace must reach the same Collector, so front the tail-sampling tier with the loadbalancing exporter using routing_key: traceID. Watch otelcol_processor_tail_sampling_sampling_trace_dropped_too_early to detect an undersized buffer.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & OpenTelemetry