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 →
- Use parent-based head sampling at the SDK (for example 10%) to cap overhead and keep traces complete across services.
- 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} - Route spans by trace ID to the same collector instance with the
loadbalancingexporter, otherwise tail sampling sees partial traces. - Keep RED metrics generated from 100% of spans (spanmetrics connector) so sampling never affects SLO numbers.
- 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.
More on Observability & Telemetry Decisions
Your team has metrics and logs but no tracing. A request to checkout fans out to 9 services and nobody can tell where the 2 seconds go. How do you introduce tracing?IntermediateThe monthly observability bill doubled in two months and finance wants it cut by 40%. What do you do?IntermediateA developer adds `customer_id` as a label to a request counter "for better debugging". You catch it in code review. What do you say?BeginnerEvery team has built their own Grafana dashboards with different panels. During incidents, nobody can find anything.BeginnerA service's logs are unstructured strings like `Order 123 failed for user 9 after 3 retries`. Searching them during incidents is painful.BeginnerYour Prometheus is a single instance holding everything. It is at 90% memory and the team wants 13 months of retention for SLO reports.Advanced