This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: otel-collector-weaver-schema-validation-check

OTel Collector Weaver Semantic Convention Schema Check

Enforces pre-deployment schema validation using OpenTelemetry Weaver across CI/CD pipelines to guarantee all telemetry payloads conform to enterprise semantic convention registries. Prevents breaking downstream telemetry contracts, unvetted custom attribute injection, and catalog fragmentation across collectors and services.

Prohibited Anti-Pattern: Deploying Telemetry Pipelines Without Automated Weaver Semantic Convention Validation

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: OTel Collector Weaver Semantic Convention Schema Check - Enforces pre-deployment schema validation using OpenTelemetry Weaver across CI/CD pipelines to guarantee all telemetry payloads conform to enterprise semantic convention registries. Prevents breaking downstream telemetry contracts, unvetted custom attribute injection, and catalog fragmentation across collectors and services.
globs: .github/workflows/**/*.{yml,yaml}, weaver.yaml, registry/**/*.{yml,yaml}, **/otel-collector*.{yml,yaml}, deploy/helm/**/*.{yml,yaml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/otel-collector-weaver-schema-validation-check"
---

# OTel Collector Weaver Semantic Convention Schema Check

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Deploying Telemetry Pipelines Without Automated Weaver Semantic Convention Validation

## System Constraints
You are a Principal Software Architect enforcing enterprise telemetry governance using OpenTelemetry Weaver. You must mandate strict CI/CD gatekeeping that validates collector processor configurations, application telemetry schemas, and custom attribute extensions against centralized OpenTelemetry semantic convention registries before deployment.

## Strict Guidelines
- CI/CD pipelines MUST execute 'weaver registry check' and 'weaver registry resolve' against enterprise registries on all collector config and schema changes.
- Engineers MUST NOT introduce ad-hoc telemetry attributes in Collector transform or attributes processors without formal registration in the semantic convention registry.
- Collector configurations MUST explicitly declare target 'schema_url' attributes across all telemetry transformation pipelines.
- CI workflows MUST fail telemetry configuration deployment jobs immediately if Weaver detects unmapped schema breaking changes or backward-incompatibility conflicts.
- Telemetry registry definitions MUST define explicit type, stability, and namespace constraints for every custom resource, span, metric, and log attribute.

## Bad vs Good Implementations
### CI/CD Pipeline Weaver Verification and Schema Conformance

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The workflow deploys telemetry collector configurations directly into production without semantic convention schema validation. The collector injects non-standard attributes ('cust_id', 'env') that violate OpenTelemetry standards, leading to fragmented metrics/traces and downstream dashboard breakage.
```yaml
# .github/workflows/deploy-collector.yml
name: Deploy OTel Collector
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy Collector Config
        run: |
          # Anti-pattern: Direct deployment without checking semantic schema contracts
          kubectl apply -f otel-collector-config.yaml

# otel-collector-config.yaml
# Transform processor injects rogue, unvetted attributes violating OpenTelemetry conventions
processors:
  transform:
    error_mode: ignore
    log_statements:
      - context: resource
        statements:
          - set(attributes["cust_id"], "legacy-1234") # Non-standard attribute
          - set(attributes["env"], "production")      # Violates deployment.environment.name
```

#### Production Standard (Correct)
> **Standard**: The CI workflow enforces rigorous pre-deployment validation using Weaver. It verifies custom semantic conventions against the enterprise registry, checks for schema compatibility, and blocks deployment if unapproved attribute mutations are detected.
```yaml
# .github/workflows/deploy-collector.yml
name: Validate and Deploy OTel Collector
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  weaver-validation:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install OpenTelemetry Weaver
        uses: open-telemetry/weaver-action@v1
        with:
          version: '0.12.0'
      - name: Run Weaver Semantic Convention Check
        run: |
          # Validates enterprise registry syntax and structural consistency
          weaver registry check --registry ./semantic-conventions
          # Resolves and checks compatibility against target schema
          weaver registry resolve --registry ./semantic-conventions --output ./resolved-schema
      - name: Validate Collector Transform Semantics
        run: |
          # Verify collector configs against Weaver schema resolution
          weaver check-collector-config --registry ./resolved-schema --config ./otel-collector-config.yaml

  deploy:
    needs: weaver-validation
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy Collector Config
        run: kubectl apply -f otel-collector-config.yaml
```

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 Weaver Semantic Convention Schema Check

OTel Collector Weaver Semantic Convention Schema Check defines an industrial-grade behavioral standard for devops engineering. Enforces pre-deployment schema validation using OpenTelemetry Weaver across CI/CD pipelines to guarantee all telemetry payloads conform to enterprise semantic convention registries. Prevents breaking downstream telemetry contracts, unvetted custom attribute injection, and catalog fragmentation across collectors and services. 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: Deploying Telemetry Pipelines Without Automated Weaver Semantic Convention Validation 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 DriftDeploying Telemetry Pipelines Without Automated Weaver Semantic Convention ValidationCritical
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

CI/CD pipelines MUST execute 'weaver registry check' and 'weaver registry resolve' against enterprise registries on all collector config and schema changes.

CI/CD pipelines MUST execute 'weaver registry check' and 'weaver registry resolve' against enterprise registries on all collector config and schema changes.

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 introduce ad-hoc telemetry attributes in Collector transform or attributes processors without formal registration in the semantic convention registry.

Engineers MUST NOT introduce ad-hoc telemetry attributes in Collector transform or attributes processors without formal registration in the semantic convention registry.

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

Collector configurations MUST explicitly declare target 'schema_url' attributes across all telemetry transformation pipelines.

Collector configurations MUST explicitly declare target 'schema_url' attributes across all telemetry transformation pipelines.

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

CI workflows MUST fail telemetry configuration deployment jobs immediately if Weaver detects unmapped schema breaking changes or backward-incompatibility conflicts.

CI workflows MUST fail telemetry configuration deployment jobs immediately if Weaver detects unmapped schema breaking changes or backward-incompatibility conflicts.

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

Telemetry registry definitions MUST define explicit type, stability, and namespace constraints for every custom resource, span, metric, and log attribute.

Telemetry registry definitions MUST define explicit type, stability, and namespace constraints for every custom resource, span, metric, and log attribute.

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 Weaver Semantic Convention Schema Check critical for AI coding assistants?

Enforces pre-deployment schema validation using OpenTelemetry Weaver across CI/CD pipelines to guarantee all telemetry payloads conform to enterprise semantic convention registries. Prevents breaking downstream telemetry contracts, unvetted custom attribute injection, and catalog fragmentation across collectors and services. 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 (Deploying Telemetry Pipelines Without Automated Weaver Semantic Convention Validation) 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