$npx -y skills add ollygarden/opentelemetry-agent-skills --skill otel-semantic-conventionsOpenTelemetry semantic convention lookup and naming guidance. Use when selecting released semantic convention groups, attributes, or span naming rules, or when checking semantic convention compliance.
| 1 | # OpenTelemetry Semantic Conventions |
| 2 | |
| 3 | Use this skill when you need released semantic convention guidance for naming, attributes, or compliance checks. |
| 4 | |
| 5 | |
| 6 | ## Workflow |
| 7 | |
| 8 | 1. Start with released semantic conventions, not model memory. |
| 9 | - do not load the full semantic convention spec into context |
| 10 | - use the bundled lookup script to query only the needed released group or attribute |
| 11 | - for local verification against a checked-out upstream repo, set `OTEL_SEMCONV_REPO=/path/to/semantic-conventions` |
| 12 | |
| 13 | 2. Choose the closest released group before inventing custom keys. |
| 14 | - identify the boundary type such as `http`, `db`, `messaging`, `rpc`, or `network` |
| 15 | - pick one primary group first, then add related groups only when they add needed context |
| 16 | - for `gen_ai.*`, OpenAI, or MCP conventions, use the dedicated OpenTelemetry GenAI semantic conventions repository; the core repository keeps only deprecated GenAI-era stubs after v1.42.0 |
| 17 | - see `references/semconv-selection.md` |
| 18 | |
| 19 | 3. Query only the released guidance you need. |
| 20 | - list groups: `./scripts/query-otel-semantic-conventions.sh --groups` |
| 21 | - inspect one group: `./scripts/query-otel-semantic-conventions.sh http` |
| 22 | - inspect one kind: `./scripts/query-otel-semantic-conventions.sh http spans` |
| 23 | - inspect one exact attribute or entry: `./scripts/query-otel-semantic-conventions.sh http http.request.method` |
| 24 | - see `references/otel-semantic-conventions.md` |
| 25 | |
| 26 | 4. Apply the released naming and attribute rules directly. |
| 27 | - use required and recommended attributes before optional ones |
| 28 | - derive semconv-governed span names directly from the released naming rule |
| 29 | - do not prepend or append protocol labels, hostnames, product names, business hints, or other custom prose to semconv-governed span names |
| 30 | - if the released naming rule does not provide a low-cardinality target, use the simpler fallback allowed by that convention |
| 31 | - if no released key exists, use a stable custom namespace and keep values bounded |
| 32 | |
| 33 | 5. Return the result with exact source context. |
| 34 | - include the group name, released version, and source URL from the script output |
| 35 | - call out any concrete compatibility limitation if the implementation cannot fully match the released guidance |