Tool deep diveStandards

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.

Checked 13 Oct 202612 min read

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

Learn it hands-onOpenTelemetry GenAI conventions: one trace format for models and agents is taught in AI Observability: Traces, Sessions and Cost, with machine-verified labs.
On this page
  1. What it is and where it sits
  2. When to pick it
  3. How it works
  4. Members only: Set it up
  5. Members only: Production configuration
  6. Members only: A collector pipeline that redacts and samples
  7. Members only: Wiring it into the stack
  8. Members only: Operating it
  9. Members only: Alternatives compared
  10. 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 as gen_ai.provider.name, gen_ai.request.model, gen_ai.response.model, gen_ai.usage.input_tokens and gen_ai.usage.output_tokens.
  • Agents and tools. create_agent, invoke_agent, invoke_workflow and execute_tool spans, with gen_ai.agent.name, gen_ai.tool.name, gen_ai.tool.call.id and, when you opt in, the tool call arguments and results.
  • Content. Prompts, system instructions and outputs as gen_ai.input.messages, gen_ai.system_instructions and gen_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's params._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#

1. Your code emits spans two ways: the SDK calls you add, and OpenTelemetry auto-instrumentation that wraps model and database calls. 2. The OpenTelemetry Collector redacts personal data: the email in a prompt becomes [redacted]. 3. It samples: every error span is kept, plus a share of the healthy ones. 4. It exports the same spans to several backends, such as Langfuse, Arize Phoenix and Helicone. 5. An eval job scores a trace, faithfulness 0.92, and the score attaches to that trace. 6. Dashboards chart latency and cost, and an alert fires when p95 latency passes 2 seconds.SDK in your codespans you addAuto-instrumentedOpenTelemetryOTel Collector1 Redactemail: [email protected]email: [redacted]2 Sampleevery span arrivesLangfusetraces, evalsArize Phoenixtraces, evalsHeliconerequests, costEvalsscore tracesDashboards and alertsAlert: p95 over 2 sfaithful 0.92

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:

AttributeExampleNotes
gen_ai.operation.namechatRequired
gen_ai.provider.nameopenaiRequired. Replaced gen_ai.system in v1.37
gen_ai.request.modelgpt-4o-miniWhat you asked for
gen_ai.response.modelgpt-4o-mini-2024-07-18What actually answered
gen_ai.response.idchatcmpl-123Provider's response id
gen_ai.response.finish_reasons["stop"]Array
gen_ai.usage.input_tokens14Cached and reasoning token attributes exist too
gen_ai.usage.output_tokens9
server.addressapi.openai.comStable core attribute
error.typetimeoutOnly 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.

1. The root span agent.run opens and covers the whole run. 2. llm.plan: the model plans, 1,840 tokens. 3. tool.read_file reads the failing test. 4. llm.decide picks the next step. 5. tool.run_tests fails. 6. The agent retries tool.run_tests and it passes. 7. llm.write_fix takes 6.2 seconds and is flagged slow. 8. tool.edit_file applies the fix and llm.summarize writes the answer. 9. The run ends at 18.4 seconds: 12,480 tokens and 0.042 dollars.Trace · fix the failing testTokens0Cost$0.000Time0.0 s0 s5 s10 s15 s20 sagent.runllm.plantool.read_filellm.decidetool.run_testsfailedtool.run_testsretry passedllm.write_fixslow · 6.2 stool.edit_filellm.summarizeModel callTool call

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

The Python instrumentations moved in May 2026 to their own repository, opentelemetry-python-genai , under new package names. Released packages (all beta, version 1.2b0 from 2026-09-24) cover OpenAI, Anthropic, AWS Bedrock, Google GenAI, LangChain, LlamaIndex, the OpenAI Agents SDK, DSPy, Agno, Portkey, Qwen-Agent and smolagents. Claude ...

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

Free. You also get Stratiflux Weekly: one email a week, unsubscribe anytime.

Also in the members part

  1. Production configuration
  2. A collector pipeline that redacts and samples
  3. Wiring it into the stack
  4. Operating it
  5. Alternatives compared
  6. Learn it hands-on

Sources

Checked against these on 13 Oct 2026.

  1. OpenTelemetry GenAI semantic conventions repository (opens in a new tab)github.com
  2. GenAI client inference spans, events and metrics (working draft) (opens in a new tab)github.com
  3. GenAI agent spans (working draft) (opens in a new tab)github.com
  4. Semantic conventions changelog (v1.37 to v1.42 GenAI changes) (opens in a new tab)github.com
  5. OpenTelemetry Python GenAI instrumentations (opens in a new tab)github.com
  6. OpenAI instrumentation README (content capture and upload hook) (opens in a new tab)github.com
  7. OpenTelemetry JS OpenAI instrumentation (opens in a new tab)github.com
  8. Collector redaction processor (opens in a new tab)github.com
  9. Collector tail sampling processor (opens in a new tab)github.com
  10. Collector transform processor (OTTL) (opens in a new tab)github.com
  11. OpenLLMetry repository (opens in a new tab)github.com
  12. Traceloop is joining ServiceNow (March 2026) (opens in a new tab)traceloop.com
  13. OpenInference specification and instrumentations (opens in a new tab)github.com
  14. Datadog: OpenTelemetry instrumentation for LLM traces (opens in a new tab)docs.datadoghq.com
  15. Langfuse: OpenTelemetry integration (opens in a new tab)langfuse.com