How do you find the actual bottleneck in a slow multi-service request?
IntermediateScenarioScaling and performance
Answer
Situation read → Guessing per service wastes hours. Distributed tracing shows the critical path directly.
What I'd do →
- Pick a slow trace by trace ID from logs, or filter traces by duration in Tempo or Jaeger.
- Read the waterfall: which span is longest, and are calls sequential when they could be parallel?
- Look for N+1 patterns: 200 tiny DB spans in one request.
- Correlate the slow span with that service's metrics (CPU, pool waits) and logs, using the trace ID.
- If tracing doesn't exist, add OpenTelemetry auto-instrumentation; it's the fastest path to visibility in most languages.
Why → In a call chain, total latency is the critical path. Tracing shows it; per-service dashboards don't.
Interview tip → Name the N+1 query pattern; it's one of the most common causes.
More on Scaling and performance
Traffic is expected to 10x for a sale next week. How do you prepare the platform?IntermediateThe HPA is configured but pods don't scale even though the app is slow. Why?BeginnerPods are Pending during a traffic spike because the cluster is out of capacity. What do you do now and long term?IntermediateThe database CPU is at 95% and the API is timing out. What's your approach?Intermediate"Too many connections" errors from Postgres after scaling the app out. How do you fix it?IntermediateLatency is fine on average but p99 is terrible. Where do you look?Advanced