This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: otel-collector-arrow-cardinality-suppression-standard

OTel Collector Apache Arrow Stream Cardinality Suppression Standard

Enforces edge-level dimension masking, dynamic attribute truncation, and columnar Apache Arrow encoding within OpenTelemetry Collector pipelines. Prevents upstream TSDB time-series index explosion and catastrophic OOMs by sanitizing unbounded runtime attributes prior to cross-network transmission.

Prohibited Anti-Pattern: Direct OTLP Ingestion of Unsanitized High-Cardinality Metrics Leading to TSDB Index Exhaustion and Pipeline OOM

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OTel Collector Apache Arrow Stream Cardinality Suppression Standard - Enforces edge-level dimension masking, dynamic attribute truncation, and columnar Apache Arrow encoding within OpenTelemetry Collector pipelines. Prevents upstream TSDB time-series index explosion and catastrophic OOMs by sanitizing unbounded runtime attributes prior to cross-network transmission.
globs: **/otel-collector*.{yaml,yml}, **/collector/*.{yaml,yml}, deployments/**/otel-*.{yaml,yml}, k8s/**/otel-collector*.{yaml,yml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/otel-collector-arrow-cardinality-suppression-standard"
---

# OTel Collector Apache Arrow Stream Cardinality Suppression Standard

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Direct OTLP Ingestion of Unsanitized High-Cardinality Metrics Leading to TSDB Index Exhaustion and Pipeline OOM

## System Constraints
You are a Principal Observability Infrastructure Architect enforcing the OTel Collector Apache Arrow Stream Cardinality Suppression Standard. Mandate edge-level attribute sanitization using OTTL (OpenTelemetry Transformation Language) transforms and high-throughput columnar compression via the Apache Arrow protocol. Reject configurations that route raw, unconstrained metric dimensions (UUIDs, raw URLs, user IDs, ephemeral IP addresses) directly to TSDB backends.

## Strict Guidelines
- Engineers MUST ALWAYS configure the `transform` processor with OTTL statements to sanitize, regex-replace, or delete high-cardinality attributes (e.g., UUIDs, transaction IDs, raw dynamic query params) before metric export.
- Engineers MUST NOT allow unaggregated metric streams carrying arbitrary runtime dimensions to bypass edge-collector transformation and batching tiers.
- Code SHOULD utilize the OpenTelemetry-Arrow receiver and exporter components (`arrow` protocol) across edge-to-gateway pipelines to minimize serialized memory overhead and maximize transport compression.
- Services MUST enforce strict memory limiter (`memory_limiter`) thresholds alongside adaptive batch processing (`batch` processor) preceding Arrow encoding to prevent Collector container kills.
- Components NEVER permit downstream forwarding of raw client IP addresses, session tokens, or entity IDs inside metric datapoint attribute maps.

## Bad vs Good Implementations
### Edge Collector Metric Cardinality Suppression & Arrow Pipeline

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Metrics pass uninspected directly to the backend. High-cardinality keys like raw HTTP targets with URL query params and unique entity IDs cause TSDB index explosions and downstream OOM failures. Standard OTLP protocol incurs high CPU and deserialization overhead.
```yaml
# INVARIANT VIOLATION: Metric attributes contain raw high-cardinality tokens,
# passing unmasked directly through standard OTLP gRPC without batching safeguards.
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

processors: {}

exporters:
  otlp/backend:
    endpoint: tsdb-backend.internal:4317
    tls:
      insecure: true

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: []
      exporters: [otlp/backend]
```

#### Production Standard (Correct)
> **Standard**: Implements an active memory limiter, strips unbounded high-cardinality dimensions using OTTL regex routines before emission, and leverages columnar Apache Arrow compression (`arrow` exporter) for high-efficiency, saturation-resistant transport.
```yaml
# COMPLIANT: Memory limiter, OTTL cardinality suppression, and Apache Arrow columnar compression enabled.
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 20

  transform/cardinality_suppression:
    error_mode: ignore
    metric_statements:
      - context: datapoint
        statements:
          # Mask dynamic path parameters (UUIDs / IDs) to prevent dimension explosion
          - replace_pattern(attributes["http.target"], "[0-9a-fA-F-]{36}", "{uuid}")
          - replace_pattern(attributes["http.target"], "\\d+", "{id}")
          # Strip ephemeral or PII attributes that must not exist in metric indices
          - delete_key(attributes, "user.id")
          - delete_key(attributes, "client.ip")
          - delete_key(attributes, "order.id")

  batch:
    send_batch_size: 8192
    timeout: 5s

exporters:
  arrow:
    endpoint: otel-gateway.internal:4317
    arrow:
      num_streams: 4
    tls:
      insecure: true

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [memory_limiter, transform/cardinality_suppression, batch]
      exporters: [arrow]
```

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: OTel Collector Apache Arrow Stream Cardinality Suppression Standard

OTel Collector Apache Arrow Stream Cardinality Suppression Standard defines an industrial-grade behavioral standard for devops engineering. Enforces edge-level dimension masking, dynamic attribute truncation, and columnar Apache Arrow encoding within OpenTelemetry Collector pipelines. Prevents upstream TSDB time-series index explosion and catastrophic OOMs by sanitizing unbounded runtime attributes prior to cross-network transmission. 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: Direct OTLP Ingestion of Unsanitized High-Cardinality Metrics Leading to TSDB Index Exhaustion and Pipeline OOM 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 DriftDirect OTLP Ingestion of Unsanitized High-Cardinality Metrics Leading to TSDB Index Exhaustion and Pipeline OOMCritical
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 configure the `transform` processor with OTTL statements to sanitize, regex-replace, or delete high-cardinality attributes (e.g., UUIDs, transaction IDs, raw dynamic query params) before metric export.

Engineers MUST ALWAYS configure the `transform` processor with OTTL statements to sanitize, regex-replace, or delete high-cardinality attributes (e.g., UUIDs, transaction IDs, raw dynamic query params) before metric export.

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 unaggregated metric streams carrying arbitrary runtime dimensions to bypass edge-collector transformation and batching tiers.

Engineers MUST NOT allow unaggregated metric streams carrying arbitrary runtime dimensions to bypass edge-collector transformation and batching tiers.

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 utilize the OpenTelemetry-Arrow receiver and exporter components (`arrow` protocol) across edge-to-gateway pipelines to minimize serialized memory overhead and maximize transport compression.

Code SHOULD utilize the OpenTelemetry-Arrow receiver and exporter components (`arrow` protocol) across edge-to-gateway pipelines to minimize serialized memory overhead and maximize transport compression.

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 enforce strict memory limiter (`memory_limiter`) thresholds alongside adaptive batch processing (`batch` processor) preceding Arrow encoding to prevent Collector container kills.

Services MUST enforce strict memory limiter (`memory_limiter`) thresholds alongside adaptive batch processing (`batch` processor) preceding Arrow encoding to prevent Collector container kills.

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 permit downstream forwarding of raw client IP addresses, session tokens, or entity IDs inside metric datapoint attribute maps.

Components NEVER permit downstream forwarding of raw client IP addresses, session tokens, or entity IDs inside metric datapoint attribute maps.

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 OTel Collector Apache Arrow Stream Cardinality Suppression Standard critical for AI coding assistants?

Enforces edge-level dimension masking, dynamic attribute truncation, and columnar Apache Arrow encoding within OpenTelemetry Collector pipelines. Prevents upstream TSDB time-series index explosion and catastrophic OOMs by sanitizing unbounded runtime attributes prior to cross-network transmission. 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 (Direct OTLP Ingestion of Unsanitized High-Cardinality Metrics Leading to TSDB Index Exhaustion and Pipeline OOM) 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

OTel