Fixing OpenTelemetry Collector restarts and memory pressure

A Collector that restarts in a loop or gets OOM-killed usually has a sizing mismatch between its memory limits, its queues and its load. This page explains how to find which one it is and fix it in the right order.

On this page

Why the OpenTelemetry Collector restarts or runs out of memory

A Collector that restarts, drops telemetry or gets OOMKilled is usually telling you that it holds more data in memory than its container or host can afford. The Collector keeps data in three places as it moves through a pipeline: receivers that accept incoming requests, processors that batch, transform and filter, and sending queues that hold data waiting for exporters to deliver it to a backend. Each of these consumes memory, and the sum can exceed a container limit long before any single component looks unhealthy. The memory_limiter processor is the guard meant to prevent this. It checks memory use against configured thresholds and starts refusing data at the receivers before the process reaches the point where the kernel or the runtime kills it. When the guard is missing, set too loosely, or placed in the wrong position in the pipeline, the first symptom is an abrupt restart rather than a clean refusal.

Restarts, refused data and queue growth are usually three views of the same sizing mismatch. A slow or unavailable backend causes sending queues to grow, queued batches hold memory, and the limiter starts refusing data, which then appears upstream as dropped telemetry in applications and agents. Bursty input that the Collector cannot drain quickly produces the same pattern. Because OpenTelemetry is not an observability backend, the Collector does not store telemetry for later querying. Its memory is spent on buffering data in transit, so the question to answer is how much data is in flight at peak and how long it stays there. Confirm the cause from the Collector's own internal metrics and logs, such as memory usage and refused or failed counters, before changing settings, because the same symptom can come from a limit set too low, a queue sized too large, or a backend that is failing. The OpenTelemetry Collector documentation describes the components involved. This topic covers the Collector only, not the applications or SDKs that send it data.

Where the Collector holds telemetry in memory and where it refuses it

Telemetry starts at the receivers, which accept data from applications or agents, then passes through the memory_limiter processor before the other processors run. Each exporter has its own sending queue, where data waits in memory until the back end accepts it. When the limiter sees memory pressure it refuses new data at the receiver, so the sender retries or drops it. Check the limiter's position in the pipeline and how many queues hold memory at once.

Memory is held in processors and per-exporter queues, and the limiter refuses data at the receiver.

Which memory and queue settings to change first

This table compares the settings that govern Collector memory, from the memory_limiter down to container limits and GOMEMLIMIT. Read it in order: the limiter sets the ceiling, the batch and queue settings decide how much data sits in memory, and the container limit decides whether the process survives. Change one setting at a time and confirm each name and default in the configuration docs for your version.

SettingWhen it fitsTrade-offConfirm before changing
memory_limiter (check interval and memory limit)The Collector is restarting from out-of-memory kills and has no limiter, or the limiter sits too high to act before the container limit is reachedA lower limit refuses data earlier and protects the process, but producers see refused data and retry or lose it. A higher limit keeps more data but leaves less headroom before an OOM killConfirm the limit fields, the check interval, and the position of the limiter first in each pipeline in the Collector configuration docs for your version
Batch processor (size and timeout)Large batches or long timeouts hold many items in memory at once, which shows up as growing usage during burstsLarger batches reduce export calls and overhead but hold more data in memory and add latency. Smaller batches reduce peak memory but increase request count to the backendConfirm the batch size and timeout keys and their defaults in the processor README for your release
Sending queue size on each exporterBackend slowdowns fill the queue and memory climbs steadily until the process is killedA larger queue absorbs longer backend outages but costs memory for every queued item. A smaller queue sheds data sooner, which is safer for the process but loses more telemetry during an outageConfirm the queue size key, whether it counts batches or items, and how the exporter's memory use is bounded in the exporter README
Sending queue consumersThe backend accepts parallel requests and the queue drains too slowly, so items wait in memoryMore consumers drain the queue faster and raise throughput, but add concurrent requests, more in-flight memory, and more load on the backendConfirm the consumer count key and the backend's concurrency limits before raising it
Retry settings (initial interval, max interval, max elapsed time)Transient backend errors are common and retried items accumulate in the queueLonger retry windows preserve data through short outages but keep failed items in memory for longer. Shorter windows free memory sooner and drop data earlierConfirm the retry keys and their defaults in the exporter helper documentation for your version
Container memory limit and requestPods are OOM killed or evicted, or the limit is set without reference to the Collector's measured usageA higher limit reduces OOM risk but can starve neighbors and hides leaks. A limit set below the memory_limiter ceiling means the limiter never acts before the killConfirm the limiter's configured ceiling sits below the container limit with headroom for non-heap memory, and confirm your platform's eviction behavior
GOMEMLIMIT environment variableThe Go runtime grows well past the working set and the process is killed while the limiter reports usage within rangeSetting it makes the garbage collector work harder as usage approaches the limit, which raises CPU use. Setting it too low can cause sustained GC pressureConfirm with the Collector release notes and your runtime settings whether the team sets GOMEMLIMIT, and how it relates to the memory_limiter in your version
Load sizing and pprof profilesSettings are tuned but memory still rises under the same load, or the cause is unknownProfiling takes time and exposes the pprof endpoint, which must be restricted while in use. Load tests need representative data volume to be meaningfulConfirm the pprof extension and its listen address in the extension README, and keep the endpoint bound to localhost or an internal network

How memory_limiter and queue sizing interact with container limits

The memory_limiter processor must be set against the memory the Collector can actually use, not the container's nominal limit. Start from the container or host memory limit, then subtract headroom for the Go runtime, garbage collection overhead, network buffers and other non-heap memory. The processor's limit_mib should sit below that usable figure, and spike_limit_mib controls how much sudden growth is tolerated before the processor starts refusing data. If the Kubernetes memory limit is set but the Collector's own limits are sized as if the whole container were heap, the processor will reject data too late and the pod will still be killed. Confirm the exact behavior of your Collector version against the Collector configuration docs before you choose values.

Queues multiply buffered data, so a sending queue can push the process past its limit even when memory_limiter is present. Each exporter with a sending_queue holds its own buffer, and the queue_size value counts batches, not bytes. With several exporters, or with one exporter configured with a large queue, the worst-case buffered volume is the batch size multiplied by the queue depth and the number of exporters. The memory_limiter watches total process memory, but a queue that fills during a backend outage can grow quickly between checks. Size queues by estimating the memory of one batch, multiplying by queue depth and exporter count, and checking the result against the usable memory figure from the previous step. Ask the vendor or project for the batch memory characteristics of your receivers, since they vary with payload size.

Place memory_limiter first in each pipeline, so it runs before batch and other memory-consuming processors. A limiter placed after a batch processor or a transform processor sees memory only after it has already been allocated, so it can react too late. Placing it at the head of the processor list means it can refuse data at the receiver before expensive work begins, and the refusal is visible to senders as a backpressure signal. The limiter should be the only memory-control mechanism that applies across the whole process, while queue limits act per exporter. Verify this ordering in the rendered configuration of each pipeline, because overlays and generated configs can reorder processors without an obvious error. Finally, do not assume these values are correct: run a load test at the expected peak rate and a simulated backend outage, watch memory against the container limit, and adjust the limiter and queue settings until the process stays below the limit with margin.

Which fix fits which failure pattern

A crash loop that begins during startup usually points to configuration that the Collector rejects or to a component that cannot start. The restart reason is the first thing to read, because a configuration error, a port that is already in use, or a missing credential or certificate file fails long before memory becomes a factor. Memory settings rarely cause a startup crash on their own, so check the logs from the first failed start rather than tuning limits.

  • Restart reason: Read the container's last termination state and the first error lines in the logs. An exit code without an OOMKilled reason points away from memory.
  • Configuration validation: Run the Collector's validate subcommand against the same configuration file before deploying it again.
  • Bind and dependency errors: Look for address-in-use errors, unreachable extensions such as authenticators, and missing secret or certificate mounts.
  • Version changes: If the crash began after an upgrade, check the release notes for renamed or removed components before changing memory settings.
  • Fix direction: Correct the configuration or dependency, then confirm the pod reaches a steady running state before reviewing resource limits.

Check the first error in the logs from the first failed start, then the configuration and mounts it names.

How to fix Collector restarts in a safe sequence

This sequence moves from evidence to change: it confirms why the Collector is restarting, sets a memory budget that matches the container, adds visibility, and then applies and tests each change before it reaches production. Every step ends with a check so the team knows whether the fix held.

  1. Capture the restart reason and last logs

    The platform engineer on call records the restart reason from the orchestrator, such as an OOMKilled status or a failed liveness probe, along with the exit code and the Collector logs from just before each restart. Store these in the incident record with the Collector version and the active configuration file. Before changing anything, confirm you can reproduce the restart pattern from the stored evidence, for example by matching restart timestamps to a spike in incoming data volume. If the logs show no clear cause, do not change configuration yet; widen the collection window first.

  2. Confirm the memory limit the container actually has

    The Kubernetes or VM owner checks the effective memory limit for the Collector process, not the number written in the deployment template. Read the container's memory limit from the running pod or unit, and check whether the Go runtime sees the same ceiling, since a limit set higher than the node can supply will still end in an OOM kill. Note any sidecars or other containers sharing the same pod budget. Done means you have one written number for the usable memory limit, which every later sizing step will use.

  3. Enable the Collector's internal metrics

    The platform team turns on the Collector's own telemetry so memory use, queue size and refused-data counters are visible before the next change. Set the internal metrics endpoint in the service telemetry section of the configuration and make sure the scrape or dashboard can reach it. Consult the Collector configuration documentation for the exact keys in your version, since they have changed across releases. Done means the Collector's memory and queue metrics appear in your monitoring tool for at least one full load cycle, which gives you a baseline to compare against.

  4. Place memory_limiter first in each pipeline

    The Collector engineer edits each pipeline so the memory_limiter processor is the first processor listed, before batching or transformation processors. Set its limit and spike settings to values below the usable memory limit confirmed earlier, leaving headroom for the Go runtime and non-heap memory, and check the component README for the current option names. Apply the change to one staging environment first. Done means that under a controlled load test, the limiter refuses data before the process reaches its memory ceiling, and the Collector stays running.

  5. Size sending queues against available memory

    The engineer reviews each exporter's sending queue settings and calculates the worst-case memory held by queued batches, using the batch size, average item size and queue capacity. Keep the total queue footprint well within the memory left after the limiter threshold, and reduce queue capacity where the estimate does not fit. Record the assumptions, because average item size changes as applications evolve. Done means the sizing worksheet fits inside the memory budget and the queue metrics from the internal telemetry stay below capacity during the staging run.

  6. Reduce or split load if needed

    If the staging run still exceeds the memory budget at expected peak volume, the team reduces load on a single Collector by moving some sources to a second agent or gateway instance, or by filtering low-value data earlier in the pipeline. Choose the split by signal or by source group so each instance has a clear owner. Confirm that the Collector deployment pattern still matches the team's design. Done means peak volume per instance is below the level where the limiter engaged in the staging test.

  7. Load test before rolling out

    The engineer runs a load test that replays realistic peak traffic, including bursts, against the exact Collector version and configuration planned for production. Watch restarts, memory use, refused counters and exporter failures for the full test window, and compare the results with the baseline recorded earlier. Ask the team to agree on pass criteria in writing before the test begins. Done means the Collector completes the test with no restarts, memory stays under the limiter threshold, and no unexplained data loss appears in the counters.

  8. Stage the rollout and record every change

    The platform team promotes the tested configuration in stages, starting with a small set of instances and widening only after the internal metrics and restart counts stay clean. Each change is recorded in version control with the previous configuration, the Collector version, the memory limit and the reason for the change, so the team can roll back to the last known good state quickly. Done means the production instances run the new configuration with no restarts across the rollout, and the rollback steps are documented and tested.

Security risks when profiling and debugging a live Collector

Profiling and debug tools make a live Collector easier to fix, and they also expose its internals, its configuration and the telemetry flowing through it. The four risks below share one root cause: a troubleshooting aid left reachable, readable or unreviewed outlives the incident that needed it. Check each control before you enable a tool during a restart or memory investigation.

Exposed pprof endpoints

The pprof endpoint shows goroutine stacks, heap contents and runtime details, which reveal how the Collector is built and what it is doing. If it binds to a reachable address, anyone on that network can request it while the Collector struggles. Confirm the extension listens on localhost or a management interface only, and that a firewall or network policy blocks other sources. Recent Collector releases bind server components to localhost by default, so check whether your configuration overrides that setting.

Collector security guidance

Debug exporter output in logs

The debug exporter prints the telemetry it receives, including attribute values that may carry tokens, user identifiers or query text. Logs are usually retained longer and read by more people than the Collector's own pipeline data. Limit debug output to short, supervised windows, and confirm that a redaction processor removes sensitive attributes before any debug exporter sees them. Ask who can read the pod logs in your cluster.

Unreviewed live configuration changes

Editing a running Collector's configuration to add a receiver, raise a limit or turn on a profiler skips the review that a normal release would receive. A single change to a memory limit or an exporter endpoint can drop data or send it somewhere unintended. Make every change in version-controlled configuration, deploy it through the same pipeline as other changes, and record who approved it. Keep a rollback copy of the last known good file.

Profiles that reveal internal structure

Heap and goroutine profiles can expose function names, package layout, internal hostnames embedded in configuration, and memory contents that include recent telemetry. Treat captured profiles as sensitive artifacts. Store them in restricted storage, delete them after analysis, and share them only with engineers who already have access to the pipeline. Name a data owner for profile captures so retention is not left to chance.

Credentials in the configuration file

Collector configuration often holds exporter keys, OAuth client secrets or endpoint credentials, and a debug or config dump can print them. Keep secrets in an external store and reference them from the file rather than writing them inline. Check that no troubleshooting step echoes the resolved configuration to a shared log. Rotate any credential that appeared in a log or a profile during an incident.

Load sizing and profiling with pprof before you change limits

Change memory limits only after you know what load the Collector must carry. Start by replaying or generating telemetry that matches your expected peak: the same signal mix, span and log sizes, batch shapes and cardinality that production produces during its busiest hour. Run the Collector at that load in a test environment with the same container memory limit and the same configuration you plan to deploy. Watch the Collector's own memory use, the otelcol_process_memory_rss metric, the memory limiter's refusal behavior and the queue size and capacity metrics on each exporter. If the queues fill and memory climbs toward the container limit while throughput stays flat, the problem is downstream or in sizing, and raising the limit alone will only delay the next restart. Confirm the exact metric names for your Collector version in the component documentation before you build dashboards on them.

Use pprof to see where the memory and CPU actually go. The Collector can expose Go profiling endpoints through the pprof extension, but the extension must be present in the build you run and enabled in its configuration, so confirm that for your distribution before you plan the test. Do not expose the endpoint beyond the host or management network while you profile, and keep it off by default in production. Capture a heap profile while memory is elevated, not after the process has settled at idle, because an idle heap shows steady-state allocations and misses the spike that caused the kill. Capture a CPU profile in the same window so you can tell whether memory growth comes from buffering, from processor work or from serialization. Compare profiles taken before and after a configuration change to confirm the change moved the cost you expected.

Run profiling in a non-production environment or during a controlled window with an agreed rollback. Profiles add overhead, and a heap capture can briefly pause the process, so the people on call should know when it starts and when it ends. Record the Collector version, build, configuration hash, load profile and container limit alongside every profile so results can be reproduced. Only after the profile and load test agree on the cause should you change memory_limiter thresholds or queue sizes, and then retest at the same peak load before promoting the change.

What to confirm about memory behavior in your environment

Memory failures in the Collector rarely come from one setting. They come from the interaction between the Collector build, the components in each pipeline, the back end's ingestion behavior, and the limits your platform actually enforces. Confirm each of these before you tune queues or limiter values, so that a fix targets the real cause.

Collector version and distribution

Confirm which Collector version and distribution you run, and whether it is the core build or the contrib build. Read the release notes for every version between your current build and the target for memory-related changes, such as changes to default limits, queue behavior or component internals. Also confirm that the image you deploy matches the artifact you verified, since a custom build made with the Collector builder may include a different set of components than the published distribution.

Collector release notes

Stability level of each component

List every receiver, processor, exporter and extension in each pipeline and record its stability level from the component's README. Components at development or alpha stage can change behavior between releases and may hold data in unbounded structures. Ask the team that owns each pipeline whether any component was added for a specific feature, since those components are the most likely to be absent from the stability guidance you planned around.

OpenTelemetry status page

Exporter and queue behavior under back-end slowness

Test what each exporter and its sending queue do when the back end slows or rejects requests. Confirm whether the queue is held in memory or on disk, how many batches it can hold, and what happens to incoming data when it fills. Slow responses that cause retries can grow memory faster than a failed request does, so run this check with a degraded back end rather than assuming a clean failure path.

Container and node limits and enforcement

Ask the platform team for the memory request and limit set on the Collector pod or host, and confirm whether the limit is enforced by the runtime or by the node. Check whether the Collector's own memory settings are derived from the container limit or set separately, because a mismatch leaves the Collector unaware of the real ceiling. Also confirm whether other workloads share the node, since memory pressure from neighbors can trigger kills that look like Collector faults.

Back-end ingestion limits as a cause

Ask the back-end owner for its ingestion rate limits, request size limits, and any throttling or rejection responses it returns under load. When the back end rejects or slows data, the Collector holds it in memory until it can send, so a limit on the far side can look like a Collector memory problem. Confirm whether the back end returns clear status codes for throttling, since the retry behavior you configure depends on them.

Collector configuration docs

What does it cost to fix Collector memory problems with a partner

What drives the cost of fixing Collector memory problems?

The main cost drivers are the number of pipelines, the number of Collector deployments, whether load testing is needed to size them, and how complex the back end is. Each pipeline has its own receivers, processors and exporters, so memory behavior must be checked per pipeline. Each Collector deployment (agent, gateway or both) adds configuration to review and a separate set of limits to tune. Load testing adds effort because it needs a representative traffic profile and a test environment that matches production limits. Back ends that accept data slowly or reject it under load make exporter queues grow, which pushes memory use up and makes the fix harder to isolate. Ask for these four counts and conditions to be written into the scope before you agree on a fee.

Can an in-house team fix Collector memory problems on its own?

Yes, if the team has someone comfortable reading Collector configuration, container resource metrics and Go runtime profiles. The work needs Kubernetes or container platform skills to read OOM kill events and resource limits, observability skills to interpret Collector internal metrics, and enough Go familiarity to capture and read a pprof heap profile. Teams without that mix often spend the most time on the diagnosis rather than the fix itself. A partner can cover the gap for the diagnosis and load sizing while your team keeps ownership of the configuration afterward. Whichever route you choose, make sure at least one person can explain every memory limit in the final configuration.

How long does diagnosing and fixing Collector memory problems take?

Timing depends on how many Collector instances are affected, how quickly the problem reproduces, and whether a test environment exists for load runs. Work usually runs in phases: first, collecting evidence from restarts, container limits and internal metrics; second, reviewing the memory_limiter and queue settings against those limits; third, load testing and profiling with pprof to confirm the change; and last, rollout with monitoring. Each phase can be scheduled and its exit criteria agreed in writing. Ask any provider to name the phases, what each one produces and which phase depends on a change window, rather than accepting a single overall duration without that breakdown.

What does the client need to provide for a Collector memory fix?

The work needs read access to Collector metrics and logs, including container restart reasons and any OOM kill events, plus the current Collector configuration files for every affected deployment. It also needs a test environment that can receive realistic load, or a window where traffic can be replayed safely. Engineers will need to capture heap profiles through pprof, so the client should confirm where that endpoint may be exposed and who approves it. Change windows matter because limit and queue changes often need a controlled rollout and rollback. Confirm these items, owners and access paths before the scope is signed.

Can a Collector memory fix be sold as a fixed-scope engagement?

Yes. Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. For a memory fix, the written scope should name the pipelines and Collector deployments in scope, the evidence to be reviewed, the load tests to run, the profiles to capture, the configuration changes to deliver and the rollout support included. It should also state what is excluded, such as changes to back-end capacity or application instrumentation. If the problem turns out to be broader than the agreed scope, a change request is the clean way to extend it.

What should a written scope for a Collector memory fix include?

A useful scope lists the deployments and pipelines covered, the symptoms being addressed, and the evidence each phase will produce. It should define the load test method, the environment used, the pprof captures and how results are compared against the configured limits. It should state the deliverables, such as revised configuration, a sizing note and a monitoring checklist, along with who approves production changes. Include what happens if a root cause sits in a back end or in application code, and whether ongoing support is a separate retainer. Ask for the quote to map each deliverable to a phase so you can compare providers on the same basis.

What recurring costs follow a Collector memory fix?

The one-time work covers diagnosis, configuration changes and load sizing. Recurring costs come from keeping the Collector current, re-sizing when traffic grows, and watching the internal metrics that signal pressure before restarts recur. Upgrades to newer Collector releases can change component behavior, so each upgrade may need a fresh check of limits and queue settings. Ongoing support, upgrades and continuous testing are available as retainers from DeployOpen. Ask whether a quote separates the one-time fix from any retainer and what response expectations apply to each.

Does the Collector memory fix need a security review?

Yes, the review is usually light but should not be skipped. Heap profiles and debug endpoints can expose configuration details and sample data, so pprof should be bound to a restricted interface and removed after troubleshooting. The OpenTelemetry Collector security guidance recommends storing configuration securely and building only the components you need. Check that any change to queue sizes or limits does not weaken authentication or data handling. Confirm in the written scope who approves exposing debugging endpoints and how they will be closed.

How DeployOpen scopes and delivers Collector memory fixes

DeployOpen approaches Collector restarts and memory pressure as a fixed-scope engagement inside your own infrastructure. We start from the pipelines you run, the container limits they live under and the failure evidence you already have, then deliver tuned configuration, tests and a runbook your team can operate.

How we scope

  • Written scope names the Collector deployments, pipelines and container limits covered by the fix
  • Scope lists the crash and OOM evidence we review, such as restart events and memory graphs
  • Deliverables, out-of-scope items and acceptance checks are agreed in writing before work starts

How we build

  • We review memory_limiter settings and queue sizing against the memory limits of each Collector container
  • We run load tests that mirror your expected telemetry volume and capture pprof profiles under that load
  • Changes are made in your configuration repository and validated in a non-production environment first

How we hand over

  • You receive the tuned configuration, sizing worksheet and load test results with the assumptions behind them
  • A runbook covers alerts to watch, how to capture pprof safely and what to change when limits move
  • Handover includes a walkthrough with the engineers who will operate the pipelines after the engagement

How we support

  • Engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer
  • Retainer work can cover re-sizing after traffic changes or Collector version upgrades
  • Confirm with us which support hours, response paths and access arrangements apply before signing

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.