Interview Prep/SRE & Reliability/Observability & Telemetry Decisions

You need to pick a trace sampling strategy for a service doing 20,000 requests per second.

AdvancedScenarioObservability & Telemetry Decisions
Answer

Situation read → Keeping 100% of traces at 20k RPS is expensive and mostly useless; but naive head sampling at 1% throws away the rare errors you actually want.

What I'd do →

  1. Use parent-based head sampling at the SDK (for example 10%) to cap overhead and keep traces complete across services.
  2. Add tail sampling in an OpenTelemetry Collector gateway that sees whole traces:
    processors:
      tail_sampling:
        decision_wait: 10s
        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: 2}
    
  3. Route spans by trace ID to the same collector instance with the loadbalancing exporter, otherwise tail sampling sees partial traces.
  4. Keep RED metrics generated from 100% of spans (spanmetrics connector) so sampling never affects SLO numbers.
  5. Monitor dropped spans and collector memory.

Why → Head sampling controls cost; tail sampling controls which traces survive. Metrics derived before sampling keep aggregates accurate.

Interview tip → Mention the loadbalancing exporter — interviewers know tail sampling silently breaks without trace-ID affinity.

All SRE & Reliability questions

More on Observability & Telemetry Decisions