This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: opentelemetry-ebpf-profiling-cpu-ceiling-standard

OpenTelemetry eBPF Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard

Establishes a mandatory 1.5% single-core CPU utilization limit and zero-loss ring-buffer threshold for OpenTelemetry eBPF continuous profiling agents deployed on high-density Kubernetes nodes. Enforces automated sample rate throttling, dynamic frame-pointer unwinding bailouts, and Prometheus alerting on perf event buffer drop deltas to prevent node degradation.

Prohibited Anti-Pattern: Unbounded eBPF Stack Unwinding Frequency and Unmonitored BPF Ring Buffer Overflows

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OpenTelemetry eBPF Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard - Establishes a mandatory 1.5% single-core CPU utilization limit and zero-loss ring-buffer threshold for OpenTelemetry eBPF continuous profiling agents deployed on high-density Kubernetes nodes. Enforces automated sample rate throttling, dynamic frame-pointer unwinding bailouts, and Prometheus alerting on perf event buffer drop deltas to prevent node degradation.
globs: deployments/**/*.yaml, charts/**/*.yaml, src/profiler/**/*.ts
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/opentelemetry-ebpf-profiling-cpu-ceiling-standard"
---

# OpenTelemetry eBPF Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unbounded eBPF Stack Unwinding Frequency and Unmonitored BPF Ring Buffer Overflows

## System Constraints
You are a Principal Engineer enforcing the OpenTelemetry eBPF Continuous Profiling Kernel CPU Ceiling Standard. You must ensure profiling agents never exceed 1.5% core CPU consumption on host nodes, dynamically throttle unwinding sample rates under high system load, and configure automated alerts for ring-buffer drops.

## Strict Guidelines
- Engineers MUST ALWAYS enforce resource limits capping agent CPU allocation to a maximum of 150m (1.5% of a standard 10-core allotment or 15% of a single core) with strict cgroup quotas.
- Engineers MUST NOT allow continuous unwinding sampling frequencies to exceed 19Hz without automated adaptive backoff under CPU saturation.
- Code SHOULD implement an adaptive PID controller that reduces unwinding sample rate when host CPU load exceeds 80%.
- Services MUST emit metrics tracking 'otelcol_processor_profiling_bpf_lost_samples_total' and alert on any sustained non-zero delta over a 60-second window.
- Components NEVER continue native DWARF/frame-pointer walking beyond a max stack depth of 128 frames per thread.

## Bad vs Good Implementations
### Dynamic Sampling Controller with Resource and Drop Guardrails

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: A static 100Hz unwinding rate with 512-frame traversal causes heavy CPU overhead on dense nodes, exceeding the 1.5% core ceiling and risking unmonitored ring-buffer drops.
```typescript
// Anti-pattern: Static 100Hz sampling without drop monitoring or dynamic rate adaptation
export interface ProfilerConfig {
  sampleRateHz: number;
  maxStackDepth: number;
}

export const defaultConfig: ProfilerConfig = {
  sampleRateHz: 100,
  maxStackDepth: 512,
};

export function collectProfiles(config: ProfilerConfig): void {
  // Continuously unrolls kernel and user stacks with no CPU ceiling check
  setInterval(() => {
    // Poll BPF ring buffer without drop counters or throttling
  }, 1000 / config.sampleRateHz);
}
```

#### Production Standard (Correct)
> **Standard**: Implements an adaptive profiling supervisor enforcing a base 11Hz to 19Hz frequency, limits stack depth to 128, and throttles sampling when CPU usage surges or lost sample deltas appear.
```typescript
// Production standard: Adaptive rate throttling bounded to <=19Hz with drop threshold alerts
export interface ProfilerConfig {
  targetCpuCeilingPercent: number;
  baseSampleRateHz: number;
  maxSampleRateHz: number;
  maxStackDepth: number;
  ringBufferPageCount: number;
}

export const productionProfilerConfig: Readonly<ProfilerConfig> = Object.freeze({
  targetCpuCeilingPercent: 1.5,
  baseSampleRateHz: 11,
  maxSampleRateHz: 19,
  maxStackDepth: 128,
  ringBufferPageCount: 64,
});

export class AdaptiveProfilingSupervisor {
  private currentRateHz: number = productionProfilerConfig.baseSampleRateHz;

  public evaluateRate(currentHostCpuUsagePercent: number, lostSamplesDelta: number): number {
    if (lostSamplesDelta > 0 || currentHostCpuUsagePercent > 80.0) {
      this.currentRateHz = Math.max(5, this.currentRateHz - 2);
    } else if (this.currentRateHz < productionProfilerConfig.maxSampleRateHz) {
      this.currentRateHz = Math.min(productionProfilerConfig.maxSampleRateHz, this.currentRateHz + 1);
    }
    return this.currentRateHz;
  }
}
```

Recommended MCP Servers (mcp-serverlist.com)

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

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: OpenTelemetry eBPF Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard

OpenTelemetry eBPF Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard defines an industrial-grade behavioral standard for devops engineering. Establishes a mandatory 1.5% single-core CPU utilization limit and zero-loss ring-buffer threshold for OpenTelemetry eBPF continuous profiling agents deployed on high-density Kubernetes nodes. Enforces automated sample rate throttling, dynamic frame-pointer unwinding bailouts, and Prometheus alerting on perf event buffer drop deltas to prevent node degradation. 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 eBPF Stack Unwinding Frequency and Unmonitored BPF Ring Buffer Overflows 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 eBPF Stack Unwinding Frequency and Unmonitored BPF Ring Buffer OverflowsCritical
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 enforce resource limits capping agent CPU allocation to a maximum of 150m (1.5% of a standard 10-core allotment or 15% of a single core) with strict cgroup quotas.

Engineers MUST ALWAYS enforce resource limits capping agent CPU allocation to a maximum of 150m (1.5% of a standard 10-core allotment or 15% of a single core) with strict cgroup quotas.

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 NOT allow continuous unwinding sampling frequencies to exceed 19Hz without automated adaptive backoff under CPU saturation.

Engineers MUST NOT allow continuous unwinding sampling frequencies to exceed 19Hz without automated adaptive backoff under CPU saturation.

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

Code SHOULD implement an adaptive PID controller that reduces unwinding sample rate when host CPU load exceeds 80%.

Code SHOULD implement an adaptive PID controller that reduces unwinding sample rate when host CPU load exceeds 80%.

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

Services MUST emit metrics tracking 'otelcol_processor_profiling_bpf_lost_samples_total' and alert on any sustained non-zero delta over a 60-second window.

Services MUST emit metrics tracking 'otelcol_processor_profiling_bpf_lost_samples_total' and alert on any sustained non-zero delta over a 60-second window.

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

Components NEVER continue native DWARF/frame-pointer walking beyond a max stack depth of 128 frames per thread.

Components NEVER continue native DWARF/frame-pointer walking beyond a max stack depth of 128 frames per thread.

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 Profiler Kernel CPU Ceiling and Ring-Buffer Integrity Standard critical for AI coding assistants?

Establishes a mandatory 1.5% single-core CPU utilization limit and zero-loss ring-buffer threshold for OpenTelemetry eBPF continuous profiling agents deployed on high-density Kubernetes nodes. Enforces automated sample rate throttling, dynamic frame-pointer unwinding bailouts, and Prometheus alerting on perf event buffer drop deltas to prevent node degradation. 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 eBPF Stack Unwinding Frequency and Unmonitored BPF Ring Buffer Overflows) 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