Design Distributed Tracing With Adaptive Sampling Across Meta Microservices
Last updated: November 29, 2026
Quick Overview
Design a tracing system that follows a single request (for example loading the Facebook feed) across hundreds of backend services, stores enough traces to debug latency regressions, and does not overload the fleet.
Meta
November 29, 20260
0
0 solved
Design a tracing system that follows a single request (for example loading the Facebook feed) across hundreds of backend services, stores enough traces to debug latency regressions, and does not overload the fleet.
Meta's infrastructure interviews often probe observability at fleet scale, where full tracing of every request is unaffordable. The interviewer checks context propagation, sampling strategies including tail-based capture of slow requests, and storage and query design.
What the Interviewer Expects
- Propagate trace context across RPC, queues, and async work
- Choose head versus tail sampling and justify the mix
- Design the collection pipeline and its overhead budget
- Store and index traces for lookup and aggregate analysis
- Show how engineers find the cause of a latency regression
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you capture the rare 5 second requests if you sample 0.1%?
- How do you trace across an async queue hop?
- How long do you retain traces and at what fidelity?
- How would you compute the critical path?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: every request gets a trace id; services record spans (name, start, duration, parent, tags); engineers can look up a trace by id, search by attributes (endpoint, status, latency), and s...
High-Level Design
- Instrumentation library in the RPC framework creates spans automatically and propagates
trace_id, span_id, sampled flagin request headers; queue messages carry the same context. - **Local age...