Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
Observability & productionMiddleOccasionalPractical

How do you use a distributed trace to find the critical path of a slow request?

Answer

Follow the parent-child span relationships and timing rather than adding every span duration, because child work can overlap. Identify the chain that determines end-to-end completion, then inspect long or erroneous spans, gaps, retries, fan-out and queue time on that path. Confirm that service names, operation names, status and attributes are accurate and compare the trace with metrics and logs; one sampled request is evidence for a case, not proof of the whole population.

Strong answer includes

  • accounts for concurrent spans
  • separates the critical path from total work
  • correlates a trace with aggregate evidence

Practical example

A checkout request trace shows the parent span lasting 2 seconds, with three child spans: an inventory check (200ms), a pricing call (1.8 seconds), and a fraud check (150ms) running in parallel. Naively summing spans would suggest 2.15 seconds of work, but the critical path is actually the pricing call at 1.8 seconds, since the other two finish well before it, so the engineer investigates the pricing service and confirms with its own latency dashboard that this is a persistent pattern, not a one-off.

#distributed-tracing#spans#critical-path#latency

Sources

OpenTelemetry conceptsOpenTelemetry · Traces, metrics, logs, context propagation and instrumentationGoogle SRE booksGoogle · Reliability, SLOs, monitoring, incidents and resilience