OpenTelemetry GenAI conventions: one trace format for models and agents
The gen_ai.* attributes, events, metrics and agent spans that let any backend read your LLM traces. Their status today, the official and community instrumentations, and a collector that redacts and samples.
- Vendor
- OpenTelemetry (CNCF)
- Licence
- Apache-2.0
- Category
- Standards
- Latest release
- 1.2b0 · 24 Sep 2026 · Release notes (opens in a new tab)
Best for
Vendor-neutral traces and metrics for LLM calls, agents, tools and MCP that any backend can read
Avoid when
You need a frozen schema today, or one hosted tool's SDK covers everything and you will never switch backends
On this page
- What it is and where it sits
- When to pick it
- How it works
- Members only: Set it up
- Members only: Production configuration
- Members only: A collector pipeline that redacts and samples
- Members only: Wiring it into the stack
- Members only: Operating it
- Members only: Alternatives compared
- Members only: Learn it hands-on
OpenTelemetry's GenAI semantic conventions are the agreed names for what happens inside an LLM application: which model was called, how many tokens it used, which tool an agent ran, how long each step took. Instrument once with these names and Langfuse, Datadog, Phoenix or your own Grafana can all read the same traces. This page covers what the conventions define, how settled they are on 2026-10-13, which libraries emit them, and a collector pipeline that keeps prompts and personal data out of your trace store.
What it is and where it sits#
A semantic convention is a contract for telemetry: span names, attribute keys, value formats, metric names and units. The GenAI conventions cover:
- Model calls. Inference (
chat,generate_content,text_completion), embeddings and retrieval, with attributes such asgen_ai.provider.name,gen_ai.request.model,gen_ai.response.model,gen_ai.usage.input_tokensandgen_ai.usage.output_tokens. - Agents and tools.
create_agent,invoke_agent,invoke_workflowandexecute_toolspans, withgen_ai.agent.name,gen_ai.tool.name,gen_ai.tool.call.idand, when you opt in, the tool call arguments and results. - Content. Prompts, system instructions and outputs as
gen_ai.input.messages,gen_ai.system_instructionsandgen_ai.output.messages, off by default. - Metrics. Client operation duration and token usage histograms, plus server-side metrics such as time to first token for model servers.
- MCP. Client and server spans for Model Context Protocol calls, named
{mcp.method.name} {target}, with trace context carried inside the request'sparams._meta. - Provider extras for OpenAI, Anthropic, AWS Bedrock and Azure AI Inference.
It sits at the bottom of the observability stack. It is not a product and stores nothing. The instrumentation libraries emit it, the OpenTelemetry Collector moves and filters it, and backends such as Langfuse, Arize Phoenix, Laminar or Datadog store and display it. Pick it as your wire format and the backend becomes a choice you can revisit.
When to pick it#
Pick the GenAI conventions when:
- You run more than one backend or expect to switch. Traces in a standard shape go to a second destination with one more exporter line in the collector, not a re-instrumentation project.
- You already run OpenTelemetry. Your HTTP, database and queue spans gain LLM and agent spans in the same trace, so a slow answer can be traced to a slow vector search, not just "the model".
- You need to control where prompts go. Content capture is off by default, and the collector can drop or mask it before anything leaves your network.
- Your agents call tools and MCP servers. Standard agent, tool and MCP spans make a multi-step run readable in any trace viewer.
Be careful when:
- You need a frozen schema. Every GenAI attribute is still at Development status, and names have changed in the past year. Pin your instrumentation versions and expect to update dashboards.
- A vendor SDK already does everything you need. Langfuse's or Braintrust's own SDKs capture richer, product-specific data with less setup. Many teams run both: the vendor SDK for evaluation features, OpenTelemetry for the shared trace.
- Your language lags. Python has the broadest official coverage. The JavaScript OpenAI instrumentation still implements an older version of the conventions, so the same call produces different attribute names in each language today.
The nearest alternatives are OpenLLMetry from Traceloop and OpenInference from Arize. Both are open-source instrumentation sets built on OpenTelemetry. OpenLLMetry now emits most gen_ai.* names; OpenInference uses its own llm.* and input.value attributes and can emit gen_ai.* alongside them when you turn that on.
How it works#
An instrumentation library wraps your model client. Each call becomes a span named {gen_ai.operation.name} {gen_ai.request.model}, such as chat gpt-4o-mini, with span kind CLIENT. The official Python OpenAI instrumentation (version 1.2b0) produces this for one chat completion:
| Attribute | Example | Notes |
|---|---|---|
gen_ai.operation.name | chat | Required |
gen_ai.provider.name | openai | Required. Replaced gen_ai.system in v1.37 |
gen_ai.request.model | gpt-4o-mini | What you asked for |
gen_ai.response.model | gpt-4o-mini-2024-07-18 | What actually answered |
gen_ai.response.id | chatcmpl-123 | Provider's response id |
gen_ai.response.finish_reasons | ["stop"] | Array |
gen_ai.usage.input_tokens | 14 | Cached and reasoning token attributes exist too |
gen_ai.usage.output_tokens | 9 | |
server.address | api.openai.com | Stable core attribute |
error.type | timeout | Only when the call failed |
Alongside the span it records two histograms: gen_ai.client.operation.duration in seconds and gen_ai.client.token.usage in tokens, split by gen_ai.token.type (input or output).
Agent frameworks add structure above the model calls. An agent run is an invoke_agent {gen_ai.agent.name} span; each tool call inside it is an execute_tool {gen_ai.tool.name} span of kind INTERNAL; each model call is a chat span. Your own spans (an HTTP handler, a retrieval step) wrap all of it, so one trace shows the full path from request to answer.
Content is opt-in. Since v1.37, chat history is no longer one event per message. It is recorded either as span attributes or as a single gen_ai.client.inference.operation.details event (a log record). The specification recommends three levels: record nothing (the default), record content on spans where privacy rules allow it, or upload content to separate storage and keep only a reference on the span.
Where the conventions stand. All GenAI conventions are at Development status, so names can still change. In semantic conventions v1.42.0 (June 2026) the GenAI, OpenAI and MCP definitions moved to their own repository, semantic-conventions-genai, which had not cut a tagged release by 2026-10-13. The last release that carries them is v1.41.0 (April 2026). The working draft is still moving: in September and October 2026 it renamed client metrics in the draft (for example gen_ai.client.inference.duration and per-type token counters), while today's released instrumentations still emit gen_ai.client.operation.duration and gen_ai.client.token.usage.
Set it up
Members only below this line
Get the full OpenTelemetry GenAI conventions: one trace format for models and agents deep dive free
What you get on this page:
- 7 members sections
Also in the members part
- Production configuration
- A collector pipeline that redacts and samples
- Wiring it into the stack
- Operating it
- Alternatives compared
- Learn it hands-on
Sources
Checked against these on 13 Oct 2026.
- OpenTelemetry GenAI semantic conventions repository (opens in a new tab)github.com
- GenAI client inference spans, events and metrics (working draft) (opens in a new tab)github.com
- GenAI agent spans (working draft) (opens in a new tab)github.com
- Semantic conventions changelog (v1.37 to v1.42 GenAI changes) (opens in a new tab)github.com
- OpenTelemetry Python GenAI instrumentations (opens in a new tab)github.com
- OpenAI instrumentation README (content capture and upload hook) (opens in a new tab)github.com
- OpenTelemetry JS OpenAI instrumentation (opens in a new tab)github.com
- Collector redaction processor (opens in a new tab)github.com
- Collector tail sampling processor (opens in a new tab)github.com
- Collector transform processor (OTTL) (opens in a new tab)github.com
- OpenLLMetry repository (opens in a new tab)github.com
- Traceloop is joining ServiceNow (March 2026) (opens in a new tab)traceloop.com
- OpenInference specification and instrumentations (opens in a new tab)github.com
- Datadog: OpenTelemetry instrumentation for LLM traces (opens in a new tab)docs.datadoghq.com
- Langfuse: OpenTelemetry integration (opens in a new tab)langfuse.com