OTEL-013: batch processor should be last in pipeline
Severity: warn (advisory)
Rule Details
The batch processor groups items right before they are exported. If it runs before a filter, transform, or sampler, the downstream processors see bigger objects than they need, do more work, and can fragment batches in ways the exporter was not sized for. The conventional ordering is memory_limiter → …everything else… → batch.
This rule fires when a pipeline contains batch and it is not the last processor.
Options
This rule has no options.
Examples
Avoid
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch, attributes] # batch not last
exporters: [otlp/backend]
Prefer
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, attributes, batch]
exporters: [otlp/backend]
When Not To Use It
Advanced setups with connectors that re-route data mid-pipeline may legitimately need a second batching stage. In that case disable the rule for the affected pipeline only.
Related Rules
- OTEL-014 —
memory_limitershould be first processor - OTEL-038 — filter processor after batch
- OTEL-039 — transform/attributes processor after batch
- OTEL-043 — batch before
tail_sampling/groupbytrace
Version
Available since augur v0.1.0.
Further Reading
Resources
- Rule source:
policy/main/main.rego