Architectural Invariant Design: OpenTelemetry Collector Adaptive Backpressure and Memory Limiter Guardrail
OpenTelemetry Collector Adaptive Backpressure and Memory Limiter Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces strict memory limits, queue boundaries, and tail-sampling circuit breakers across OpenTelemetry Collector deployments. Prevents out-of-memory (OOMKilled) crashes and silent data drops during downstream degradation by coupling cgroup-aware memory limiters with bounded persistent or memory sending queues. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
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 Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Unbounded Exporter Queues and Missing Memory Limiter Leading to Fatal OOM Cascades | Critical | 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 Inconsistency | AI 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. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Engineers MUST ALWAYS declare the `memory_limiter` processor as the very first processor in every pipeline (traces, metrics, logs).
Engineers MUST ALWAYS declare the `memory_limiter` processor as the very first processor in every pipeline (traces, metrics, logs).
Engineers MUST configure `check_interval` to at most `1s` and set `limit_percentage` to no more than `80%` (or `limit_mib` to 75-80% of Kubernetes cgroup memory limit) with `spike_limit_percentage` set to `20%` (or `spike_limit_mib` to 15-20%).
Engineers MUST configure `check_interval` to at most `1s` and set `limit_percentage` to no more than `80%` (or `limit_mib` to 75-80% of Kubernetes cgroup memory limit) with `spike_limit_percentage` set to `20%` (or `spike_limit_mib` to 15-20%).
Engineers MUST NEVER deploy exporters with unbounded `sending_queue` configurations
Engineers MUST NEVER deploy exporters with unbounded `sending_queue` configurations; `queue_size` MUST be explicitly calculated based on available worker memory and batch size.
Pipelines using `tail_sampling` MUST define explicit sampling decision limits and timeout safeguards (`decision_wait`) to prevent state retention spikes during high trace cardinality.
Pipelines using `tail_sampling` MUST define explicit sampling decision limits and timeout safeguards (`decision_wait`) to prevent state retention spikes during high trace cardinality.
Receivers MUST return an HTTP 503 or gRPC `UNAVAILABLE` status immediately upon upstream backpressure activation rather than accepting telemetry into an unbuffered pipeline.
Receivers MUST return an HTTP 503 or gRPC `UNAVAILABLE` status immediately upon upstream backpressure activation rather than accepting telemetry into an unbuffered pipeline.
The deprecated memory ballast configuration (`ballast_size_mib`) MUST NOT be used in any environment.
The deprecated memory ballast configuration (`ballast_size_mib`) MUST NOT be used in any environment.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is OpenTelemetry Collector Adaptive Backpressure and Memory Limiter Guardrail critical for AI coding assistants?
Enforces strict memory limits, queue boundaries, and tail-sampling circuit breakers across OpenTelemetry Collector deployments. Prevents out-of-memory (OOMKilled) crashes and silent data drops during downstream degradation by coupling cgroup-aware memory limiters with bounded persistent or memory sending queues. 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 Exporter Queues and Missing Memory Limiter Leading to Fatal OOM Cascades) 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.