Your OpenTelemetry Collector is getting OOMKilled under load. How do you stabilise it?
IntermediateScenarioTracing and OpenTelemetry
Answer
Situation read → No memory limiter, large batches, or a slow exporter causing the queue to grow.
What I'd do →
- Add
memory_limiteras the first processor in each pipeline:
processors:
memory_limiter: {check_interval: 1s, limit_percentage: 80, spike_limit_percentage: 20}
batch: {send_batch_size: 8192, timeout: 5s}
service:
pipelines:
traces: {receivers: [otlp], processors: [memory_limiter, batch], exporters: [otlp]}
- Set
GOMEMLIMITto about 80% of the container limit. - Configure
sending_queuesize and optional file storage for persistence. - Scale horizontally with an HPA on CPU/memory.
- Monitor
otelcol_exporter_queue_sizeandotelcol_processor_refused_spans.
Why → The memory limiter applies back-pressure instead of crashing and losing everything.
Interview tip → Processor order matters: memory_limiter first, batch last before export.
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.BeginnerHow do you trace a request that goes through Kafka from a producer to three consumers?Intermediate