opentelemetry-genai
Skill1 starsChanged 31 days agoMITView on GitHub
OpenTelemetry GenAI semantic conventions: instrument LLM inference, embeddings, tool calls and agents with gen_ai.* spans, attributes, events and metrics. Use when tracing calls to a model provider, adding telemetry to an agent or tool loop, recording token usage and latency, deciding whether to capture prompts and completions, instrumenting MCP clients or servers, or moving an instrumentation to the latest experimental conventions with OTEL_SEMCONV_STABILITY_OPT_IN. Triggers: OpenTelemetry, OTel, semantic conventions, semconv, GenAI, LLM observability, gen_ai.operation.name, gen_ai.provider.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.input.messages, invoke_agent, execute_tool, create_agent, gen_ai.client.operation.duration, gen_ai.client.inference.usage, gen_ai_latest_experimental, mcp.method.name.
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Token counts report billable tokens: when a system reports both used and billable tokens, and the per-operation histograms are never used …
- Very specific: line 44
Decide on content capture: Default off; if enabled, choose span attributes or external storage, and apply truncation.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTelemetry GenAI semantic conventions
The OpenTelemetry semantic conventions for generative AI define the span names, span kinds, gen_ai.* attributes, events and metrics for model inference, embeddings, tool execution, agents and the Model Context Protocol. They are maintained in the open-telemetry/semantic-conventions-genai repository and have Development status. With this skill the agent instruments GenAI calls so that any OpenTelemetry backend can read them.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: instrumentation author (library or framework), application developer adding manual spans, or backend consumer reading the data.
- Revision: Draft posture: build. The pin is commit
b31e9e8ea26ac1c086d3313d474e31d7c3f391ae(2026-09-30) ofsemantic-conventions-genai, schema URLhttps://opentelemetry.io/schemas/gen-ai-dev/1.42.0-dev, built on semantic conventions v1.44.0. The repository has no releases or tags, so pin the commit and the schema URL. - Content capture: whether prompts, completions, system instructions and tool arguments may be recorded, and where (spans, events, or external storage).
- Sources: when refreshing this skill, re-read every URL in Sources, check the repository for a tag or a new
schema_urlinmodel/manifest.yaml, and update the pins.
Invariants
- Everything here is Development. The conventions, spans, attributes, events and metrics carry Development status (GenAI README; manifest
stability: development). Names can change between commits; record the schema URL you implemented. - Existing instrumentations do not switch conventions silently. Instrumentations that emit v1.36.0 or earlier keep emitting it by default, and add
OTEL_SEMCONV_STABILITY_OPT_INwith the valuegen_ai_latest_experimentalto emit the latest experimental conventions instead of the old ones (semantic conventions v1.41.1 GenAI README). gen_ai.operation.nameis Required on every GenAI span, andgen_ai.provider.nameon inference, embeddings,create_agentand clientinvoke_agentspans. Use a well-known value when one applies; otherwise a custom value is allowed (spans, agent spans, registry).- Span names are low-cardinality:
{gen_ai.operation.name} {gen_ai.request.model}for inference and embeddings,execute_tool {gen_ai.tool.name},invoke_agent {gen_ai.agent.name},create_agent {gen_ai.agent.name}(spans, agent spans). - Span kind follows the call:
CLIENTfor remote model, embeddings and agent-service calls (INTERNALallowed for in-process models);INTERNALforexecute_tooland in-processinvoke_agent(spans, agent spans). - A span covers the whole logical operation, including automatic retries, until the response is fully received or the operation ends in an error or cancellation (spans, Spans).
- Content is not captured by default.
gen_ai.system_instructions,gen_ai.input.messages,gen_ai.output.messages,gen_ai.tool.definitions,gen_ai.tool.call.argumentsandgen_ai.tool.call.resultare Opt-In; offer an option to enable them (spans, Capturing instructions, inputs, and outputs). - Errors set
error.type, and span status follows the Recording Errors document (spans). - Token counts report billable tokens when a system reports both used and billable tokens, and the per-operation histograms are never used for totals or cost (token metrics).
Workflow
- Choose the spans. Map each GenAI call in the code to an inference, embeddings, retrieval, execute_tool, create_agent, invoke_agent, invoke_workflow or MCP span.
->
references/spans.md✓ Each call site has a span type, a name pattern and a span kind. - Set the attributes. Fill the Required and Conditionally Required attributes, then the Recommended ones the response provides, such as usage and finish reasons.
->
references/attributes.md✓ No span lacksgen_ai.operation.nameor (where required)gen_ai.provider.name. - Decide on content capture. Default off; if enabled, choose span attributes or external storage, and apply truncation.
->
references/attributes.md✓ A configuration flag controls capture and is off by default. - Record metrics and events. Emit
gen_ai.client.operation.durationwith the advised buckets, the token usage counters, and the exception and evaluation events where they apply. ->references/events-metrics.md✓ Duration and token metrics carry the required attributes, includinggen_ai.token.modalityon token counters. - Handle versions. Pin the schema URL and, for an existing instrumentation, gate the new conventions behind
OTEL_SEMCONV_STABILITY_OPT_IN. ->references/versioning.md✓ The emitted schema URL and the opt-in behaviour are documented for users.
Verify before done
- Every GenAI span has
gen_ai.operation.namewith a well-known value where one applies. - Inference, embeddings,
create_agentand clientinvoke_agentspans havegen_ai.provider.name;server.portis set wheneverserver.addressis. - Span names follow the patterns above and contain no IDs or prompt text.
- Opt-In content attributes are off unless the user enabled them.
- A failed call sets
error.typeand ends the span. - Token counters use
{token}, durations uses, and the schema URL is recorded.
Reference index
references/spans.md: inference, embeddings, retrieval, execute_tool, agent and workflow spans, and MCP spans. Load for step 1.references/attributes.md: keygen_ai.*attributes, well-known values, usage attributes, and the content capture patterns. Load for steps 2 and 3.references/events-metrics.md: client, server, agent and tool metrics, token metrics, and the GenAI events. Load for step 4.references/versioning.md: Development status, the repository move, the schema URL pin, andOTEL_SEMCONV_STABILITY_OPT_IN. Load for step 5.
Related skills
ocsfto turn AI activity into security audit events:npx skills add ScaleDockHQ/scaledock-skills --skill ocsf.cloudeventsto carry trace context on events withtraceparent:npx skills add ScaleDockHQ/scaledock-skills --skill cloudevents.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- Semantic conventions for generative AI systems: Development, commit b31e9e8 (2026-09-30), Draft posture: build, checked 2026-10-02.
- Registry manifest: development, schema gen-ai-dev/1.42.0-dev on semantic conventions 1.44.0 at commit b31e9e8, checked 2026-10-02.
- Generative client AI spans: Development, commit b31e9e8, checked 2026-10-02.
- GenAI agent and framework spans: Development, commit b31e9e8, checked 2026-10-02.
- Generative AI events: Development, commit b31e9e8, checked 2026-10-02.
- Generative AI exceptions: Development, commit b31e9e8, checked 2026-10-02.
- Generative AI metrics: Development, commit b31e9e8, checked 2026-10-02.
- Generative AI inference token metrics: Development, commit b31e9e8, checked 2026-10-02.
- Model Context Protocol semantic conventions: Development, commit b31e9e8, checked 2026-10-02.
- Gen AI attribute registry: Development, commit b31e9e8, checked 2026-10-02.
- GenAI semantic conventions on opentelemetry.io: Moved, page as served on 2026-10-02, checked 2026-10-02.
- GenAI README with the opt-in transition plan: Development, semantic conventions v1.41.1, checked 2026-10-02.
- Semantic conventions v1.44.0 release: Released, v1.44.0 (2026-08-04), checked 2026-10-02.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- a2aSkill
- ag-uiSkill
- ap2Skill
- asyncapiSkill
- authzenSkill
- cedarSkill
- cloudeventsSkill
- eu-ai-actSkill
- fapiSkill
- gnapSkill
- jwtSkill
- mcp-authorizationSkill
- oauthSkill
- ocsfSkill
- openapi-arazzoSkill
- openapi-overlaySkill
- openapiSkill
- openfeatureSkill
- openid4vcSkill
- openid-connectSkill
- openid-federationSkill
- openidSkill
- owasp-agenticSkill
- problem-detailsSkill
- ratelimit-headersSkill
- scaledock-agent-permissionsSkill
- scaledock-enterprise-identitySkill
- scaledock-http-apiSkill
- scaledock-mcp-serverSkill
- scaledock-repo-standardSkill
- scimSkill
- shared-signalsSkill
- spiffeSkill
- standard-schemaSkill
- typespecSkill
- web-bot-authSkill
- webmcpSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

