Design Production ML Serving Observability
Scale and optimize an existing online ML service using end-to-end metrics, traces, logs, controlled releases, and explicit overload behavior.
Problem statement
For this exercise, assume an existing production service accepts independent prediction requests and invokes a versioned machine-learning model. The model architecture itself is fixed.
Traffic is bursty, request preprocessing and downstream feature calls are asynchronous, inference capacity is expensive, and operators currently cannot localize latency or correctness regressions. Start by naming the main problems in the current service and how you would confirm each one.
Then design the serving and observability changes that fix them: scale the system, remove bottlenecks, optimize Python asynchronous execution safely, and roll out a new serving version without hiding failures.
A request must return one prediction, a retry-safe known result, or an explicit throttled, timed-out, unavailable, or uncertain outcome. Model training and model-architecture design are outside scope.
What to build
- An authorized client can submit an independent prediction request and receive a versioned result or one explicit non-success outcome.
- The service admits, queues, batches, throttles, or rejects work according to tenant limits, deadlines, and measured serving capacity.
- Operators can correlate metrics, traces, and structured logs across admission, feature work, preprocessing, queueing, inference, and response delivery.
- Operators can canary, compare, promote, drain, and roll back immutable serving versions using explicit performance and quality guardrails.
At scale
- For this exercise, assume 10,000 prediction requests per second normally, tenfold bursts lasting one minute, and up to 500 tenants with highly skewed traffic.
- For this exercise, target 300 milliseconds p95 and one second p99 end-to-end latency for admitted requests, with at most 150 milliseconds p95 spent waiting for inference capacity.
- For this exercise, assume each request has a two-second deadline, inference workers are the scarce resource, and one serving pool or availability zone may fail.
- For this exercise, retain sampled traces and structured error evidence for 14 days and aggregate service and model-version metrics for 13 months.