Skip to main content

OTEL-043: Batch before tail_sampling/groupbytrace

Severity: warn (advisory)

Rule Details

tail_sampling and groupbytrace both need to see all spans for a trace in the same processor instance to make a correct decision. If batch runs first, it can put spans from the same trace into different batches — and spans from different batches arrive at the sampler at different times, sometimes after the sampler's decision window has already closed. Run trace-aware processors before batch.

This rule fires when a pipeline contains batch and a tail_sampling or groupbytrace processor appearing after it.

Options

This rule has no options.

Examples

Avoid
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch, tail_sampling]
exporters: [otlp/backend]
Prefer
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, groupbytrace, tail_sampling, batch]
exporters: [otlp/backend]

When Not To Use It

Never for tail_sampling or groupbytrace — it will produce incorrect sampling decisions.

  • OTEL-013batch processor should be last in pipeline
  • OTEL-038 — filter processor after batch
  • OTEL-039 — transform/attributes processor after batch
  • OTEL-063tail_sampling without groupbytrace
  • OTEL-064 — both probabilistic_sampler and tail_sampling in same pipeline

Version

Available since augur v0.1.0.

Further Reading

Resources