Architectural Invariant Design: OpenTelemetry Collector Cgroup-Aware Dynamic Backpressure Guardrail
OpenTelemetry Collector Cgroup-Aware Dynamic Backpressure Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces deterministic memory bounds and cgroup-coupled dynamic backpressure on OpenTelemetry Collector instances to eliminate OOM kills under burst traffic. Mandates strict positioning of the memory_limiter processor, alignment of GOMEMLIMIT with container cgroup limits, and explicit bounded queues across all pipelines. 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 Collector Queuing and Uncoupled Host-Relative Memory Limits Leading to Kernel OOM Termination | 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 'memory_limiter' as the absolute first processor in every receiver pipeline (traces, metrics, logs).
Engineers MUST ALWAYS declare 'memory_limiter' as the absolute first processor in every receiver pipeline (traces, metrics, logs).
Engineers MUST configure 'limit_percentage' at no more than 80% (or 'limit_mib' at <= 80% of container limit) with a 'spike_limit_percentage' of 20% to account for GC pacing.
Engineers MUST configure 'limit_percentage' at no more than 80% (or 'limit_mib' at <= 80% of container limit) with a 'spike_limit_percentage' of 20% to account for GC pacing.
Engineers MUST NEVER use the deprecated 'memory_ballast' extension in contemporary OpenTelemetry Collector configurations.
Engineers MUST NEVER use the deprecated 'memory_ballast' extension in contemporary OpenTelemetry Collector configurations.
Container manifests MUST set the 'GOMEMLIMIT' environment variable to 80-85% of the container cgroup memory limit (e.g., 'GOMEMLIMIT=1700MiB' for a 2GiB container limit).
Container manifests MUST set the 'GOMEMLIMIT' environment variable to 80-85% of the container cgroup memory limit (e.g., 'GOMEMLIMIT=1700MiB' for a 2GiB container limit).
Exporters MUST ALWAYS define a bounded 'sending_queue' with 'enabled
Exporters MUST ALWAYS define a bounded 'sending_queue' with 'enabled: true' and a finite 'queue_size' to enforce downstream flow control and propagate HTTP 429/503 or gRPC ResourceExhausted backpressure to upstream emitters.
Engineers MUST set 'check_interval' in 'memory_limiter' to a high-frequency polling value (between '500ms' and '1s') to catch burst spikes before kernel cgroup OOM reaper invocation.
Engineers MUST set 'check_interval' in 'memory_limiter' to a high-frequency polling value (between '500ms' and '1s') to catch burst spikes before kernel cgroup OOM reaper invocation.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is OpenTelemetry Collector Cgroup-Aware Dynamic Backpressure Guardrail critical for AI coding assistants?
Enforces deterministic memory bounds and cgroup-coupled dynamic backpressure on OpenTelemetry Collector instances to eliminate OOM kills under burst traffic. Mandates strict positioning of the memory_limiter processor, alignment of GOMEMLIMIT with container cgroup limits, and explicit bounded queues across all pipelines. 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 Collector Queuing and Uncoupled Host-Relative Memory Limits Leading to Kernel OOM Termination) 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.