Tracing adds 15% latency overhead to a high-throughput service. What do you tune?
AdvancedScenarioTracing and OpenTelemetry
Answer
Situation read → Overhead usually comes from too many spans, synchronous export, or heavy attribute processing.
What I'd do →
- Profile with tracing on and off to confirm the source.
- Ensure batch processor with async export.
- Lower the head sampling ratio; unsampled spans skip most recording work.
- Disable noisy auto-instrumentations (e.g.
OTEL_INSTRUMENTATION_<NAME>_ENABLED=falsein Java) for internal libraries. - Avoid expensive attribute computation (serializing payloads) in hot paths.
Why → Well-configured tracing typically costs low single-digit percent.
Interview tip → Give a measurement plan rather than guessing.
More on Tracing and OpenTelemetry
Your company has 30 microservices and no tracing. How do you roll out distributed tracing?IntermediateTraces stop at service B: you see spans from A, but B's spans start new traces. What is wrong?BeginnerTracing every request costs too much. How do you design sampling?IntermediateYou set up tail sampling with 4 Collector replicas, but traces are fragmented and error traces are missing. Why?AdvancedA checkout request takes 4 seconds. Walk through how you use a trace to find the cause.BeginnerYour OpenTelemetry Collector is getting OOMKilled under load. How do you stabilise it?Intermediate