This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: otel-ebpf-profiler-overhead-guardrail

OpenTelemetry eBPF Continuous Profiler Overhead Guardrail

Enforces strict kernel-level sampling ceilings, frame unwinding bounds, and ring-buffer allocation limits for OpenTelemetry eBPF continuous profiling daemonsets. Guarantees that continuous stack tracing does not induce kernel lock contention or exceed a 1% CPU overhead budget on latency-critical workloads.

Prohibited Anti-Pattern: Unbounded high-frequency eBPF sampling rates with infinite frame unwinding and unconstrained map buffers

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OpenTelemetry eBPF Continuous Profiler Overhead Guardrail - Enforces strict kernel-level sampling ceilings, frame unwinding bounds, and ring-buffer allocation limits for OpenTelemetry eBPF continuous profiling daemonsets. Guarantees that continuous stack tracing does not induce kernel lock contention or exceed a 1% CPU overhead budget on latency-critical workloads.
globs: infra/**/*.yaml, infra/**/*.json, k8s/**/*.yaml, src/config/**/*.{ts,json,yaml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/otel-ebpf-profiler-overhead-guardrail"
---

# OpenTelemetry eBPF Continuous Profiler Overhead Guardrail

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unbounded high-frequency eBPF sampling rates with infinite frame unwinding and unconstrained map buffers

## System Constraints
You are a Principal DevOps and SRE Engineer enforcing strict runtime overhead limits for OpenTelemetry eBPF continuous profiling agents. Mandate explicit sampling frequency ceilings (<=19Hz), bounded maximum stack-unwinding depths, deterministic ring-buffer sizes with non-blocking drops, and self-throttling circuit breakers to prevent tail-latency degradation on high-throughput nodes.

## Strict Guidelines
- Engineers MUST ALWAYS bound eBPF profiling sampling frequency to a maximum of 19 Hertz to minimize CPU cache churn and NMI interrupt overhead.
- Engineers MUST configure max-stack-depth to a finite deterministic ceiling (never exceeding 128 frames) to cap frame pointer and DWARF/ORC unwinding latency.
- DaemonSet configurations MUST define hard cgroup resource limits (e.g., maximum 0.2 CPU cores and 256MiB memory) for the profiler container.
- Profilers MUST implement lossy non-blocking ring-buffer exports (e.g., dropping frames on backpressure) rather than blocking kernel execution paths.
- Engineers MUST NOT deploy profiling agents on production nodes without an active self-profiling CPU throttling guardrail configured to disarm at >=1% aggregate node CPU consumption.

## Bad vs Good Implementations
### Configuring Safe eBPF Profiler Agent Limits in Kubernetes Helm/Manifest Values

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: A 99Hz sampling frequency coupled with an unbounded stack depth (max_stack_depth: 0) induces severe NMI interrupt overhead and cache invalidation, while disabling circuit breakers leaves node throughput vulnerable to kernel-level lock contention during deep stack walks.
```yaml
# Anti-pattern: High-frequency sampling, unbounded unwinding, no circuit breaking
apiVersion: v1
kind: ConfigMap
metadata:
  name: otel-profiler-config
data:
  config.yaml: |
    profiler:
      sampling_frequency_hz: 99
      max_stack_depth: 0
      collect_kernel_stacks: true
      ring_buffer_pages: 1024
      circuit_breaker:
        enabled: false
```

#### Production Standard (Correct)
> **Standard**: Restricts sampling to 19Hz (a prime number avoiding lockstep with periodic timers), limits stack depth to 64 frames, drops samples under buffer pressure without blocking, and trips a circuit breaker if profiler overhead exceeds 1% CPU.
```yaml
# Production Standard: Constrained sampling, bounded depth, and fail-safe throttling
apiVersion: v1
kind: ConfigMap
metadata:
  name: otel-profiler-config
data:
  config.yaml: |
    profiler:
      sampling_frequency_hz: 19
      max_stack_depth: 64
      collect_kernel_stacks: true
      ring_buffer_pages: 64
      drop_samples_on_full: true
      circuit_breaker:
        enabled: true
        max_cpu_percent: 1.0
        cool_off_duration: 30s
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: OpenTelemetry eBPF Continuous Profiler Overhead Guardrail

OpenTelemetry eBPF Continuous Profiler Overhead Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces strict kernel-level sampling ceilings, frame unwinding bounds, and ring-buffer allocation limits for OpenTelemetry eBPF continuous profiling daemonsets. Guarantees that continuous stack tracing does not induce kernel lock contention or exceed a 1% CPU overhead budget on latency-critical workloads. 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 high-frequency eBPF sampling rates with infinite frame unwinding and unconstrained map buffers 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 high-frequency eBPF sampling rates with infinite frame unwinding and unconstrained map buffersCritical
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

Engineers MUST ALWAYS bound eBPF profiling sampling frequency to a maximum of 19 Hertz to minimize CPU cache churn and NMI interrupt overhead.

Engineers MUST ALWAYS bound eBPF profiling sampling frequency to a maximum of 19 Hertz to minimize CPU cache churn and NMI interrupt overhead.

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

Engineers MUST configure max-stack-depth to a finite deterministic ceiling (never exceeding 128 frames) to cap frame pointer and DWARF/ORC unwinding latency.

Engineers MUST configure max-stack-depth to a finite deterministic ceiling (never exceeding 128 frames) to cap frame pointer and DWARF/ORC unwinding latency.

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

DaemonSet configurations MUST define hard cgroup resource limits (e.g., maximum 0.2 CPU cores and 256MiB memory) for the profiler container.

DaemonSet configurations MUST define hard cgroup resource limits (e.g., maximum 0.2 CPU cores and 256MiB memory) for the profiler container.

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

Profilers MUST implement lossy non-blocking ring-buffer exports (e.g., dropping frames on backpressure) rather than blocking kernel execution paths.

Profilers MUST implement lossy non-blocking ring-buffer exports (e.g., dropping frames on backpressure) rather than blocking kernel execution paths.

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

Engineers MUST NOT deploy profiling agents on production nodes without an active self-profiling CPU throttling guardrail configured to disarm at >=1% aggregate node CPU consumption.

Engineers MUST NOT deploy profiling agents on production nodes without an active self-profiling CPU throttling guardrail configured to disarm at >=1% aggregate node CPU consumption.

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 eBPF Continuous Profiler Overhead Guardrail critical for AI coding assistants?

Enforces strict kernel-level sampling ceilings, frame unwinding bounds, and ring-buffer allocation limits for OpenTelemetry eBPF continuous profiling daemonsets. Guarantees that continuous stack tracing does not induce kernel lock contention or exceed a 1% CPU overhead budget on latency-critical workloads. 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 high-frequency eBPF sampling rates with infinite frame unwinding and unconstrained map buffers) 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