This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: otel-arrow-streaming-buffer-backpressure-guardrail

OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard

Enforces strict columnar record batch sizing, bounded channel queuing, and memory-aware backpressure limits on OTLP/Arrow streams within OpenTelemetry Collector deployments. Prevents catastrophic GC pauses and Out-Of-Memory (OOM) fatal crashes when ingesting millions of telemetry events per second. Mandates explicit memory limiter processor ordering and Arrow record allocation caps to safeguard the collector pipeline.

Prohibited Anti-Pattern: Unbounded Arrow record allocation and unbuffered streaming causing sudden OOM collector crashes under sustained ingest bursts

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard - Enforces strict columnar record batch sizing, bounded channel queuing, and memory-aware backpressure limits on OTLP/Arrow streams within OpenTelemetry Collector deployments. Prevents catastrophic GC pauses and Out-Of-Memory (OOM) fatal crashes when ingesting millions of telemetry events per second. Mandates explicit memory limiter processor ordering and Arrow record allocation caps to safeguard the collector pipeline.
globs: **/otel-collector*.yaml, **/otel-collector*.yml, **/collector-config*.yaml, **/collector-config*.yml, k8s/**/otel*.yaml, helm/**/values*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/otel-arrow-streaming-buffer-backpressure-guardrail"
---

# OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unbounded Arrow record allocation and unbuffered streaming causing sudden OOM collector crashes under sustained ingest bursts

## System Constraints
You are a Principal Software Architect and DevOps SRE enforcing strict memory safety and backpressure invariants on OpenTelemetry Arrow (OTLP/Arrow) streaming pipelines. OTLP/Arrow achieves high compression by transforming telemetry records into columnar Arrow RecordBatches, but unbounded streaming configurations cause non-linear off-heap and heap allocation spikes under high ingestion rates (millions of spans/metrics/logs per sec). You must mandate that every OpenTelemetry Collector configuration running the Arrow receiver or exporter configures explicit memory limits, hard columnar batch caps, bounded queue sizes, and places the `memory_limiter` processor ahead of any batching or Arrow translation components.

## Strict Guidelines
- Collectors MUST ALWAYS place the `memory_limiter` processor as the FIRST processor in every OTLP/Arrow pipeline before `arrow` or `batch` processors.
- The Arrow receiver (`otlpmarrow`) MUST define `max_stream_lifetime` and strict `channel_buffer_size` to prevent persistent buffer retention.
- Engineers MUST specify explicit `max_payload_size` (or `max_batch_size_bytes`) on Arrow streaming configurations to bound off-heap Apache Arrow chunk allocations.
- Collectors MUST NOT use default unbounded queue configurations (`sending_queue.enabled: true` without `queue_size` or storage limits) alongside high-throughput Arrow streams.
- The `memory_limiter` processor MUST set `check_interval` to at most `1s` with `limit_percentage` or absolute `limit_mib` not exceeding 80% of container cgroup memory limits to leave headroom for zero-copy Arrow memory mapping.
- Pipelines MUST explicitly enable transport-level backpressure (gRPC HTTP/2 flow control) by avoiding silent in-memory drop fallbacks without dead-letter queues.

## Bad vs Good Implementations
### Collector Arrow Ingestion Pipeline Configuration

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Omitting the memory_limiter processor and using unbounded Arrow concurrent streams with a massive batch size causes the collector to buffer millions of records in Arrow columnar memory. During network latency spikes, queue allocation exceeds the cgroup hard memory boundary, resulting in sudden fatal SIGKILL (OOMKilled) without graceful backpressure propagation.
```yaml
receivers:
  otlp:
    protocols:
      arrow: # Default unbounded configuration
        max_concurrent_streams: 0 # Uncapped concurrency

processors:
  batch:
    send_batch_size: 100000
    timeout: 10s
  # Missing memory_limiter processor!

exporters:
  otlp:
    endpoint: upstream-collector:4317
    sending_queue:
      enabled: true # Unbounded queue depth default

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
```

#### Production Standard (Correct)
> **Standard**: Places the memory_limiter processor as the first stage in the pipeline to shed load before memory pressure escalates. Bounds Arrow concurrent streams, channel buffer sizes, and stream lifetimes to force gRPC flow control backpressure onto downstream clients when ingestion saturates available buffer limits.
```yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      arrow:
        endpoint: 0.0.0.0:4318
        max_concurrent_streams: 1024
        max_stream_lifetime: 5m
        channel_buffer_size: 128

processors:
  memory_limiter:
    check_interval: 500ms
    limit_percentage: 75
    spike_limit_percentage: 20

  batch:
    send_batch_size: 8192
    send_batch_max_size: 16384
    timeout: 1s

exporters:
  otlp:
    endpoint: upstream-collector:4317
    sending_queue:
      enabled: true
      num_consumers: 16
      queue_size: 5000

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp]
```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard

OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard defines an industrial-grade behavioral standard for devops engineering. Enforces strict columnar record batch sizing, bounded channel queuing, and memory-aware backpressure limits on OTLP/Arrow streams within OpenTelemetry Collector deployments. Prevents catastrophic GC pauses and Out-Of-Memory (OOM) fatal crashes when ingesting millions of telemetry events per second. Mandates explicit memory limiter processor ordering and Arrow record allocation caps to safeguard the collector pipeline. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Unbounded Arrow record allocation and unbuffered streaming causing sudden OOM collector crashes under sustained ingest bursts Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftUnbounded Arrow record allocation and unbuffered streaming causing sudden OOM collector crashes under sustained ingest burstsCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Collectors MUST ALWAYS place the `memory_limiter` processor as the FIRST processor in every OTLP/Arrow pipeline before `arrow` or `batch` processors.

Collectors MUST ALWAYS place the `memory_limiter` processor as the FIRST processor in every OTLP/Arrow pipeline before `arrow` or `batch` processors.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

The Arrow receiver (`otlpmarrow`) MUST define `max_stream_lifetime` and strict `channel_buffer_size` to prevent persistent buffer retention.

The Arrow receiver (`otlpmarrow`) MUST define `max_stream_lifetime` and strict `channel_buffer_size` to prevent persistent buffer retention.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST specify explicit `max_payload_size` (or `max_batch_size_bytes`) on Arrow streaming configurations to bound off-heap Apache Arrow chunk allocations.

Engineers MUST specify explicit `max_payload_size` (or `max_batch_size_bytes`) on Arrow streaming configurations to bound off-heap Apache Arrow chunk allocations.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Collectors MUST NOT use default unbounded queue configurations (`sending_queue.enabled

Collectors MUST NOT use default unbounded queue configurations (`sending_queue.enabled: true` without `queue_size` or storage limits) alongside high-throughput Arrow streams.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

The `memory_limiter` processor MUST set `check_interval` to at most `1s` with `limit_percentage` or absolute `limit_mib` not exceeding 80% of container cgroup memory limits to leave headroom for zero-copy Arrow memory mapping.

The `memory_limiter` processor MUST set `check_interval` to at most `1s` with `limit_percentage` or absolute `limit_mib` not exceeding 80% of container cgroup memory limits to leave headroom for zero-copy Arrow memory mapping.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

Pipelines MUST explicitly enable transport-level backpressure (gRPC HTTP/2 flow control) by avoiding silent in-memory drop fallbacks without dead-letter queues.

Pipelines MUST explicitly enable transport-level backpressure (gRPC HTTP/2 flow control) by avoiding silent in-memory drop fallbacks without dead-letter queues.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is OpenTelemetry Arrow Streaming Buffer Backpressure and Memory Limiting Standard critical for AI coding assistants?

Enforces strict columnar record batch sizing, bounded channel queuing, and memory-aware backpressure limits on OTLP/Arrow streams within OpenTelemetry Collector deployments. Prevents catastrophic GC pauses and Out-Of-Memory (OOM) fatal crashes when ingesting millions of telemetry events per second. Mandates explicit memory limiter processor ordering and Arrow record allocation caps to safeguard the collector pipeline. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Unbounded Arrow record allocation and unbuffered streaming causing sudden OOM collector crashes under sustained ingest bursts) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

OpenTelemetry