
To tune the OpenTelemetry Collector batch processor, set send_batch_size and timeout as the triggers that flush a batch, add send_batch_max_size as the hard cap, read the otelcol_processor_batch metrics to see which trigger fires, and plan to move batching onto the exporter's sending_queue because upstream now marks the processor deprecated.
That last part changes how you should spend your tuning time. The processor still works, and plenty of pipelines still run it. But the same ideas (a size threshold, a flush timeout, an optional cap, a choice of unit) now live under sending_queue.batch on the exporter. If you learn the processor's knobs well, you can carry them over almost one to one.
This guide is for engineers running a Collector in front of a Python or TypeScript AI app or agent, who are seeing dropped spans, tiny export requests, oversized requests, or backend rejections. LLM spans make this harder than ordinary service traces, because a span that carries a prompt and a completion can be orders of magnitude larger than a span that carries a status code. Item-count tuning stops telling you much about request size.
If you want a backend that accepts what the Collector sends, telemetry.dev takes standard OTLP/HTTP from any OpenTelemetry Collector and shows model calls, tool steps and retrievals with cost, latency, tokens and errors. The tuning below applies regardless of where you export.
What the batch processor does and where it sits in the pipeline
The batch processor buffers spans, metrics or logs and releases them to the exporter in groups, so the exporter makes fewer, larger requests instead of one request per span. It sits between receivers and exporters in a pipeline, and each signal is batched independently: traces, metrics and logs each get their own batching.
Why batch at all? Sending one span per HTTP request wastes connections and hammers the backend. Sending everything in one giant request gets rejected by backends with request size limits. Batching is the compromise, and the processor gives you three settings to define it.
A minimal traces pipeline looks like this:
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 80
spike_limit_percentage: 20
batch:
send_batch_size: 8192
timeout: 200ms
send_batch_max_size: 0
exporters:
otlphttp:
endpoint: https://your-backend.example/otlp
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp]The processor also supports batching by client metadata, which is how multi-tenant Collectors keep data from different authorization contexts in separate batches, with a metadata_cardinality_limit that bounds how many batcher instances it will create. If you are single-tenant, you can ignore that.
Trigger versus cap: send_batch_size, timeout and send_batch_max_size
send_batch_size and timeout are triggers that decide when a batch is sent, while send_batch_max_size is a cap that limits how big a batch can be. Mixing these up is the most common tuning mistake.
send_batch_size is a threshold. When the buffer reaches this many items, the processor sends. It is not an exact batch size. If a large incoming payload pushes the buffer well past the threshold, the whole thing goes out, and the batch is bigger than the number you set.
timeout is the other trigger. If the size threshold has not been reached, the processor still flushes after this much time, so low-traffic pipelines do not hold data forever. A short timeout produces small, frequent batches. A long one produces fuller batches and more delay before data appears in your backend.
send_batch_max_size is the cap. When set, it splits oversized batches so none exceeds the limit. Left at zero, there is no upper bound. If your backend rejects large requests, this is the setting that protects you, because the size trigger alone cannot.
The rule that follows: if you set send_batch_max_size, keep it equal to or larger than send_batch_size. A cap below the trigger makes no sense, and the processor will not accept the combination.
A practical reading of symptoms:
Many tiny requests: timeout is firing before the size threshold is reached. Raise send_batch_size or lengthen timeout, depending on how much latency you can tolerate.
Requests too big for the backend: the trigger is overshooting. Set send_batch_max_size.
Data shows up late in the backend: timeout is too long for your traffic.
Count versus bytes: why LLM spans with prompts break item-count tuning
The batch processor counts items, so a batch of 8,192 spans can be a few hundred kilobytes or many megabytes depending on what those spans carry, and for LLM workloads that variance is large.
A normal HTTP server span has a handful of short attributes. A model-call span that captures the prompt, the completion, tool arguments and retrieved context can hold tens of kilobytes on its own. Fill a batch with 8,192 of those and you may exceed a backend's request size limit even though the item count looks reasonable. The reverse also happens: your pipeline is mostly small spans, and an occasional huge one skews the average.
This is why item-count tuning breaks down for AI apps. Two pipelines with identical send_batch_size values can produce wildly different request sizes. The count tells you how many things, not how much data.
The exporter-side batching that replaces the processor lets you choose the unit. If your spans are large and variable, a bytes sizer ties the batch limit to what the backend actually rejects.
Two things you can do regardless of unit:
Check your backend's documented maximum request size and set the cap below it.
Decide whether you need full prompts on every span. Capturing less per span shrinks batches at the source, which no Collector setting can do for you.
Read the batch metrics before changing anything
The otelcol_processor_batch metrics tell you which trigger is firing and how big batches really are, so read them before you touch a setting. Tuning without them is guessing.
Three metrics do most of the work:
otelcol_processor_batch_batch_size_trigger_send: a counter of batches sent because the buffer reached send_batch_size.otelcol_processor_batch_timeout_trigger_send: a counter of batches sent because timeout elapsed.otelcol_processor_batch_batch_send_size: a histogram of how many items each sent batch contained.
Compare the two trigger counters. If timeout-triggered sends dominate, your batches are leaving before they fill, and the size threshold is effectively irrelevant at your traffic level. Raising send_batch_size will not help until traffic or timeout changes. If size-triggered sends dominate, batches fill quickly, and the question becomes whether they are too large, which the send size histogram answers.
Remember these count items, not bytes. A healthy-looking histogram can still hide oversized requests when your spans are fat. Pair it with exporter-side signals such as backend rejection responses and the Collector's own failure and queue metrics.
Write down the three values before you change anything, change one setting, then compare after a representative traffic period. If you change timeout and size together, you will not know which one mattered.
Batch processor versus exporter sending_queue batching (and the deprecation warning)
Upstream now marks the batch processor deprecated and points users to batching on the exporter's sending_queue, so new pipelines should configure sending_queue.batch instead of adding the processor. The processor README opens by stating that the batch processor is deprecated for traces, metrics, and logs. Removal timelines have been announced as planned versions, not guarantees, so check the release notes for the Collector version you actually run.
The exporter helper documents batch settings inside the sending queue. The mapping is direct:
| Batch processor | Exporter sending_queue.batch |
|---|---|
| send_batch_size (trigger) | min_size |
| timeout | flush_timeout |
| send_batch_max_size (cap) | max_size |
| counts items only | sizer: items or bytes |
An equivalent exporter configuration:
exporters:
otlphttp:
endpoint: https://your-backend.example/otlp
sending_queue:
enabled: true
batch:
enabled: true
sizer: items
min_size: 8192
flush_timeout: 200ms
max_size: 0
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter]
exporters: [otlphttp]Notice the batch processor is gone from the pipeline. Batching now happens per exporter, which matters if you fan out to several backends: each exporter batches independently, with its own size and timeout. That is often what you want, since backends differ in their limits.
There is a replacement for the case where batching must happen before another processor or be shared across exporters. Check your Collector version's documentation for the queue_batch processor before relying on it.
Migration order: add sending_queue.batch to the exporter, remove batch from the processors list, then re-read your metrics and backend responses. Do not run both layers with different sizes unless you can explain why.
Order with memory_limiter and the sending queue, and a safe tuning checklist
Put memory_limiter first in the processors list and the batch processor last, so the limiter refuses data before it is buffered and batched. If batch comes before memory_limiter, the Collector can accumulate memory in the batcher before the limiter gets a chance to push back. When the limiter refuses spans, the upstream sender sees the refusal; see OpenTelemetry Collector Memory Limiter: Why It Refuses Spans for how to read that behavior.
The sending queue is the next buffer downstream. Batches that cannot be sent immediately wait there, and if it fills, spans are dropped. The queue's capacity is measured in its own unit, and a persistent queue can keep data across restarts. Two related posts cover those cases: OpenTelemetry Collector Sending Queue Full: What to Check and OpenTelemetry Collector Persistent Queue Setup. If you are chasing missing data end to end, OpenTelemetry Collector Dropped Spans: Find the Drop walks the stages in order.
A safe tuning checklist:
Record the batch metrics and your backend's rejection rate as a baseline.
Confirm memory_limiter is first and batching is last (or on the exporter).
Find the backend's maximum request size and set max_size or send_batch_max_size under it.
Choose the unit: items for uniform spans, bytes for large, variable LLM spans.
Change one setting at a time and observe a full traffic cycle.
If you are on a version that warns about deprecation, move batching to
sending_queue.batchand repeat the checks.Reduce prompt capture at the source if spans stay oversized.
They depend on your span sizes, traffic shape and backend, so measure your own pipeline.
FAQ: batch processor tuning questions
What is a good starting configuration for the OpenTelemetry Collector batch processor? Read the batch metrics first. Defaults are a reasonable baseline, and they are the same numbers the exporter-side batch uses.
Is send_batch_size the exact size of each batch? No. It is a trigger. A batch is sent when the buffer reaches the threshold, but a large incoming payload can push the batch past it. Only send_batch_max_size limits how big a batch can get.
Should I still use the batch processor in 2026? Upstream marks it deprecated and recommends batching under the exporter's sending_queue. Existing pipelines keep working, but new ones should use exporter batching, and you should check release notes for your Collector version before upgrading.
Move batching to the exporter and size it in bytes for LLM spans
Treat send_batch_size and timeout as triggers, send_batch_max_size as the only real guarantee, and bytes as the unit that matches what backends reject once prompts ride on your spans. Then stop investing in the deprecated processor and carry those same three numbers into sending_queue.batch. To see where your tuned pipeline's output lands, point your Collector's OTLP/HTTP exporter at telemetry.dev, start on the free plan, and check that model calls, tool steps and retrievals arrive with their cost, latency and token counts intact.
Share this article


