Interview Prep/Monitoring & Observability/Tracing and OpenTelemetry

A developer asks: "Should I add a span for every function?" What do you tell them?

BeginnerScenarioTracing and OpenTelemetry
Answer

Situation read → Over-instrumentation adds overhead and noise; under-instrumentation leaves gaps.

What I'd do →

  1. Let auto-instrumentation cover network boundaries (HTTP, gRPC, DB, cache, queue).
  2. Add manual spans for meaningful units of work: "calculate price", "reserve inventory", external calls without instrumentation.
  3. Add attributes (order.id, customer.tier) rather than more spans.
  4. Use span events for notable moments (retry, cache miss).

Why → Each span costs CPU and storage; aim for the spans that explain latency.

Interview tip → "Span boundaries at I/O and business steps, attributes for context."

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing and OpenTelemetry