Skip to main content

OTEL-038: Filter processor after batch

Severity: warn (advisory)

Rule Details

Dropping a span, metric, or log after it has already been grouped into a batch wastes the work of batching, and in some configurations forces the batch to be split or re-packed. Run filter before batch so only the telemetry you intend to keep reaches the batcher.

This rule fires when a pipeline contains both batch and filter and the filter processor appears after batch.

Options

This rule has no options.

Examples

Avoid
service:
pipelines:
logs:
receivers: [otlp]
processors: [memory_limiter, batch, filter] # filter after batch
exporters: [otlp/backend]
Prefer
service:
pipelines:
logs:
receivers: [otlp]
processors: [memory_limiter, filter, batch]
exporters: [otlp/backend]

When Not To Use It

Rarely — you might want filtering late if the filter relies on an attribute that is only added after batching (unusual). In that case disable the rule for that specific pipeline and document why.

  • OTEL-013batch processor should be last in pipeline
  • OTEL-039 — transform/attributes processor after batch
  • OTEL-043 — batch before tail_sampling/groupbytrace

Version

Available since augur v0.1.0.

Further Reading

Resources