otel-semantic-conventions — скилл для Claude Code: атрибуты
Помогает выбирать и проверять атрибуты телеметрии по спецификации OpenTelemetry Semantic Conventions. Пригодится, когда нужно назвать атрибут правильно, а не выдумывать своё.
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a claude-codeЧто делает otel-semantic-conventions
Скилл разбирает, как выбирать, размещать и проверять атрибуты и метрические инструменты по спецификации OpenTelemetry Semantic Conventions. Внутри три правила: attributes — реестр атрибутов, выбор, размещение и типовые атрибуты по доменам (HTTP, БД, обмен сообщениями, RPC); versioning — версии semconv, стабильность и миграция; dash0 — производные атрибуты Dash0 и зависимости от функций.
Порядок работы задан жёстко: сначала поиск в реестре атрибутов, потом проверка стабильности, затем уровень размещения. Ресурсные атрибуты описывают сущность, которая порождает телеметрию, атрибуты спанов и логов — отдельную операцию. Дублировать одно и то же на разных уровнях не стоит, а выбранный уровень держат одинаковым во всех сервисах. Для метрик значения атрибутов должны быть низкокардинальными: идентификаторы пользователей и пути с параметрами туда не годятся, их место — в атрибутах спанов. Иначе хранилище и стоимость запросов растут.
Свои атрибуты создают в последнюю очередь, когда в реестре нет подходящей записи, и называют по шаблону org.namespace.attribute_name. Имена спанов, виды спанов и коды статуса скилл не покрывает — за этим отправляет к соседнему otel-instrumentation. Установка идёт через npx skills add или gh skill install, для Gemini CLI есть отдельная команда gemini skills install.
Какие задачи решает
- подобрать стандартное имя атрибута вместо самодельного
- разложить атрибуты по ресурсу и спанам без дублей
- убрать высококардинальные значения из атрибутов метрик
- перейти на новую версию semconv без потери данных
- проверить, не нарушает ли разметка спецификацию
Примеры запросов агенту
- Проверь атрибуты в этом спане на соответствие semconv и предложи замены
- У меня в метрике атрибут user.id — что с ним не так и куда его перенести?
- Помоги мигрировать атрибуты на актуальную версию semconv
Как установить otel-semantic-conventions
1Через Skills CLI (Vercel)
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a claude-code2Вручную: положить файлы
~/.claude/skills/otel-semantic-conventions/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/otel-semantic-conventions/
1Через Skills CLI (Vercel)
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a codex2Вручную: положить файлы
.agents/skills/otel-semantic-conventions/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a cursor2Вручную: положить файлы
.cursor/skills/otel-semantic-conventions/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install dash0hq/agent-skills otel-semantic-conventions2Вручную: положить файлы
.github/skills/otel-semantic-conventions/SKILL.md1Через Skills CLI (Vercel)
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a gemini-cli2Командой платформы
gemini skills install https://github.com/dash0hq/agent-skills --path skills/otel-semantic-conventionsВручную: положить файлы
.devin/skills/otel-semantic-conventions/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора3
Похожие
Рядом в теме «DevOps и инфраструктура»
Всё по теме «DevOps и инфраструктура» →Вопросы о otel-semantic-conventions
Как установить otel-semantic-conventions в Claude?
Выполните npx skills add dash0hq/agent-skills --skill otel-semantic-conventions -a claude-code. Скилл окажется в ~/.claude/skills/otel-semantic-conventions/SKILL.md.
Что делает otel-semantic-conventions?
Помогает выбирать, размещать и проверять атрибуты телеметрии и метрические инструменты по спецификации OpenTelemetry Semantic Conventions, включая работу с реестром атрибутов и миграцию версий.
Чем этот скилл отличается от otel-instrumentation?
Здесь про атрибуты и метрические инструменты. Имена спанов, виды спанов и коды статуса разбирает скилл otel-instrumentation.
Исходный текст
SKILL.md · Apache-2.0
---
name: otel-semantic-conventions
description: OpenTelemetry Semantic Conventions expert. Use when selecting, applying, or reviewing telemetry attributes. Triggers on tasks involving attribute selection, semantic convention compliance, attribute migration, or custom attribute decisions. Covers the attribute registry, naming patterns, attribute placement, and versioning. For span names, span kinds, and span status codes, see the otel-instrumentation skill.
metadata:
author: dash0
version: '1.0.0'
---
# OpenTelemetry Semantic Conventions
This skill governs correct selection, placement, and validation of telemetry attributes and metric instruments according to the OpenTelemetry Semantic Conventions specification.
For span naming, span kinds, and span status codes, see the [otel-instrumentation](../otel-instrumentation/) skill.
The [Attribute Registry](https://opentelemetry.io/docs/specs/semconv/registry/attributes/) is the single source of truth for all defined attributes.
## Rules
| Rule | Description | Use Case |
|-------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------------------|
| [attributes](./rules/attributes.md) | Attribute registry, selection, placement, common attributes by domain | Choosing or reviewing attributes; HTTP/DB/messaging/RPC attributes; attribute placement (resource vs span) |
| [versioning](./rules/versioning.md) | Semconv versioning, stability, migration | Semconv version migration |
| [dash0](./rules/dash0.md) | Dash0 derived attributes and feature dependencies | Dash0 derived attributes |
## Official documentation
- [Attribute Registry](https://opentelemetry.io/docs/specs/semconv/registry/attributes/)
- [Semantic Conventions Specification](https://opentelemetry.io/docs/specs/semconv/)
- [Semantic Conventions Repository](https://github.com/open-telemetry/semantic-conventions)
- [Dash0 Semantic Conventions](https://www.dash0.com/documentation/dash0/semantic-conventions)
- [Dash0 Semantic Conventions Explainer](https://www.dash0.com/knowledge/otel-semantic-conventions-explainer)
## How to select the right attribute
1. **Search the registry first** — Look up the concept in the [Attribute Registry](https://opentelemetry.io/docs/specs/semconv/registry/attributes/). Use the standard name if it exists (e.g., prefer `http.request.method` over a custom `custom.http.verb`). Custom names fragment querying and break tooling — only create a custom attribute when no registry entry covers the concept.
2. **Check stability** — Prefer `stable` attributes; note any `experimental` attributes that may change. See [versioning](./rules/versioning.md).
3. **Place at the correct level** — Resource attributes describe the entity producing telemetry; span/log attributes describe the individual operation. Do not duplicate across levels. Once an attribute is at a given level, keep it there consistently across all services.
4. **Verify cardinality** — Metric attribute values must be low-cardinality (bounded set). Variable data (user IDs, request paths with parameters) belongs in span attributes, not metric attributes.
5. **Custom attribute as last resort** — Only create a custom attribute if no registry entry covers the concept. Document the decision and follow the `org.namespace.attribute_name` naming pattern.
### Example: correct vs incorrect attribute selection
<!-- eval:skip -->
```
# Correct — uses registry attribute for HTTP method
span.set_attribute("http.request.method", "GET")
# Incorrect — invents a custom attribute for a concept already in the registry
span.set_attribute("custom.http.verb", "GET")
```
### Example: resource vs span attribute placement
<!-- eval:skip -->
```
# Correct — service identity is a resource attribute
resource = Resource({"service.name": "checkout-service", "service.version": "2.1.0"})
# Correct — operation-specific data is a span attribute
span.set_attribute("http.request.method", "POST")
span.set_attribute("http.response.status_code", 201)
# Incorrect — placing a resource-level attribute on every span
span.set_attribute("service.name", "checkout-service") # belongs on the resource
```
### Example: cardinality violation in metric attributes
<!-- eval:skip -->
```
# Correct — metric attribute uses a bounded, low-cardinality value
histogram.record(duration_ms, {"http.request.method": "GET", "http.response.status_code": 200})
# Incorrect — unbounded values as metric attributes explode storage and query cost
histogram.record(duration_ms, {"user.id": "u-839201", "url.path": "/orders/839201"})
# Fix: move high-cardinality values to span attributes instead
span.set_attribute("user.id", "u-839201")
span.set_attribute("url.path", "/orders/839201")
```
© dash0 · Apache-2.0 · dash0hq/agent-skills