An agent answers a support question. The log shows the question and the answer. It does not show which model call took most of the time, whether the retriever returned anything useful, or which tool failed and was retried. An agent run is a small distributed system: model calls, retrieval, tools, sometimes other agents. You debug it the way you debug any distributed system, with a trace.
OpenTelemetry has a shared vocabulary for that trace: the GenAI semantic conventions. On 21 November 2026 they got their first standalone release, v0.1.0. With them, one agent request becomes one span tree that any OpenTelemetry backend can read, whatever framework produced it, as long as that framework emits these conventions.
The figure shows that result. Read the top panel row by row: each step of the request is a child span of invoke_agent, with its own duration and attributes. The bottom panel shows where that data goes.
What the GenAI conventions are#
Semantic conventions are the names OpenTelemetry agrees on: span names, span kinds, attribute keys, metric names and units. The GenAI set covers model inference, embeddings, tool execution, retrieval, agent invocation, planning, memory operations, realtime sessions, and two protocols: the Model Context Protocol (MCP) and Agent2Agent (A2A).
Until May 2026 the GenAI conventions lived in the main semantic-conventions repository. The last release there before the move was v1.41.0, and v1.42.0 of June 2026 deprecated the gen_ai.* names in that repository. They now have their own repository, open-telemetry/semantic-conventions-genai, and v0.1.0 lists the changes since v1.41.0. It depends on semantic-conventions v1.45.0 for shared attributes such as error.type and server.address.
Two things follow from the move, in my reading:
- Own release cadence. GenAI changes ship when they are ready, without waiting for the general conventions.
- A 0.x version. Every document in the repository has the status Development. Names can still change between releases, and v0.1.0 itself renames a lot.
What changed in v0.1.0#
The release notes are long. These are the changes an agent builder notices first:
- Workflows are agents now. The separate
invoke_workflowspan is merged into the internalinvoke_agentspan, andgen_ai.workflow.nameis replaced bygen_ai.agent.name. The operation name staysinvoke_workflowwhen your code, not the model, drives the control flow. - Token metrics are per operation type. The
gen_ai.client.token.usagehistogram is gone. Inference usesgen_ai.client.inference.operation.input_tokensandgen_ai.client.inference.operation.output_tokens, and there are new counters for aggregated usage, including cache and reasoning tokens. - Duration metrics are split.
gen_ai.client.operation.durationno longer covers inference, embeddings, tool calls, agent calls or retrieval. Each has its own histogram, for examplegen_ai.client.inference.duration,gen_ai.invoke_agent.durationandgen_ai.execute_tool.duration. top_kis split.gen_ai.request.top_kis now an int for top-k sampling only. Retrieval uses the newgen_ai.retrieval.top_kon a newgen_ai.retrievalspan.- New operations. A
planspan for planning and task decomposition, memory operations (search_memory,upsert_memoryand others), and client and server spans for A2A. - Content capture has one standard setting. When it is set through an environment variable, that variable is
OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT, and it defaults toNO_CONTENT. Uploading content to external storage is configured separately.
If you have dashboards on gen_ai.client.token.usage or gen_ai.workflow.name, they stop working when your instrumentation moves to v0.1.0.
How a traced agent request looks#
The conventions define one span per logical operation, nested under the agent span:
| Operation | Span name | Kind |
|---|---|---|
| Agent run in your process | invoke_agent {gen_ai.agent.name} | INTERNAL |
| Model call | {gen_ai.operation.name} {gen_ai.request.model}, for example chat stub-model | CLIENT |
| Retrieval by your framework | retrieval | INTERNAL |
| Tool call | execute_tool {gen_ai.tool.name} | INTERNAL |
| Planning step | plan {gen_ai.agent.name} | INTERNAL |
The attributes that matter most:
gen_ai.operation.nameon every span:invoke_agent,chat,retrieval,execute_tool,plan.gen_ai.provider.nameandgen_ai.request.modelon model calls, set when the span starts so samplers can use them.gen_ai.usage.input_tokens,gen_ai.usage.output_tokensandgen_ai.response.finish_reasonson model calls.gen_ai.tool.nameandgen_ai.tool.call.idon tool calls, anderror.typeon any span that fails.
MCP fits into the same tree. An MCP client call is a tools/call {tool} span with gen_ai.operation.name set to execute_tool. When the MCP instrumentation can detect that a GenAI instrumentation already traces the tool call, it should add its mcp.* attributes to that span instead of creating a second one. That is why the figure shows mcp.method.name on the execute_tool row.
The first model call in the figure picks the tool. A framework that can tell planning apart from ordinary inference wraps such a call in a plan span. When it cannot, the conventions say not to emit one. The figure and the example have no plan span.
Prompts, answers, tool arguments and retrieval queries are not recorded by default. SPAN_ONLY, EVENT_ONLY or SPAN_AND_EVENT opt in to capture them on spans, events or both. For production, the conventions recommend a third option: store the content outside the telemetry pipeline and record only a reference on the span, in attributes such as gen_ai.input.messages_ref.
Where it helps, and where it does not yet#
Useful today:
- Cost and latency per step. Token counts and durations sit on the span that caused them, so you see which model call or tool is expensive, not just the total.
- Debugging tool failures. A failed
execute_toolspan carrieserror.typeand sits next to the model call that asked for it. - Comparing frameworks and backends. Two agent frameworks that both emit these conventions produce traces you can query with the same filters, in any backend that speaks OTLP.
Not yet, or with care:
- Stability. The status is Development. Expect more renames before a 1.0, and pin the version of your instrumentation library, which fixes the conventions version it emits.
- Instrumentation lag. v0.1.0 is one week old as of 28 November 2026. Check which conventions version your instrumentation library emits before you build on the new names.
- Privacy. Turning on content capture puts prompts, answers and tool results into your telemetry pipeline, with the same retention and access as your other traces.
Example: trace a stub agent in Python#
The script below creates the spans of one agent request by hand, with the v0.1.0 names. The model call and the tool are stubs: they return canned text and token counts, with no network call and no API key. The point is the shape of the telemetry, not the agent.
I tested it with Python 3.12.14 and two packages, opentelemetry-api and opentelemetry-sdk 1.45.2 (the SDK supports Python 3.10 and later). The ConsoleSpanExporter prints each span when it ends. A small formatter prints one line per span plus its attributes, instead of the default JSON.
"""One agent request, traced with the OpenTelemetry GenAI conventions v0.1.0.
The model and the tool are stubs: no network call, no API key.
"""
import os
import time
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
from opentelemetry.trace import SpanKind
MODEL = "stub-model"
CONVERSATION = "conv-7f3a"
def short(span):
"""One line per span plus its attributes, instead of the default JSON."""
ms = (span.end_time - span.start_time) / 1e6
span_id = f"{span.context.span_id:016x}"[-4:]
parent = f"{span.parent.span_id:016x}"[-4:] if span.parent else "none"
lines = [f"{span.name} {span.kind.name} span={span_id} parent={parent} {ms:.0f} ms"]
for key, value in span.attributes.items():
lines.append(f" {key} = {list(value) if isinstance(value, tuple) else value}")
return os.linesep.join(lines) + os.linesep
provider = TracerProvider(resource=Resource.create({"service.name": "support-agent"}))
provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter(formatter=short)))
trace.set_tracer_provider(provider)
tracer = trace.get_tracer("support-agent")
def stub_model(step):
"""Stands in for a model call: canned reply and token counts."""
time.sleep(0.05)
if step == "tool_choice":
return {"tool": "get_order_status", "call_id": "call_1",
"input_tokens": 412, "output_tokens": 38, "finish": "tool_call"}
return {"text": "Order A-1042 shipped on 26 November.",
"input_tokens": 655, "output_tokens": 61, "finish": "stop"}
def chat(step):
attrs = {"gen_ai.operation.name": "chat", "gen_ai.provider.name": "stub",
"gen_ai.request.model": MODEL, "gen_ai.conversation.id": CONVERSATION}
with tracer.start_as_current_span(f"chat {MODEL}", kind=SpanKind.CLIENT,
attributes=attrs) as span:
reply = stub_model(step)
span.set_attribute("gen_ai.response.model", MODEL)
span.set_attribute("gen_ai.response.finish_reasons", [reply["finish"]])
span.set_attribute("gen_ai.usage.input_tokens", reply["input_tokens"])
span.set_attribute("gen_ai.usage.output_tokens", reply["output_tokens"])
return reply
def retrieve(top_k):
with tracer.start_as_current_span("retrieval", attributes={
"gen_ai.operation.name": "retrieval", "gen_ai.retrieval.top_k": top_k}):
time.sleep(0.02)
return ["returns-policy.md#30-days"]
def execute_tool(name, call_id):
with tracer.start_as_current_span(f"execute_tool {name}", attributes={
"gen_ai.operation.name": "execute_tool", "gen_ai.agent.name": "support-agent",
"gen_ai.tool.name": name, "gen_ai.tool.type": "function",
"gen_ai.tool.call.id": call_id, "gen_ai.conversation.id": CONVERSATION}):
time.sleep(0.03)
return {"order": "A-1042", "status": "shipped"}
with tracer.start_as_current_span("invoke_agent support-agent", attributes={
"gen_ai.operation.name": "invoke_agent", "gen_ai.agent.name": "support-agent",
"gen_ai.request.model": MODEL, "gen_ai.conversation.id": CONVERSATION}):
choice = chat("tool_choice")
docs = retrieve(top_k=3)
result = execute_tool(choice["tool"], choice["call_id"])
answer = chat("answer")
provider.shutdown()
print("answer:", answer["text"])Install and run:
python3.12 -m venv .venv && . .venv/bin/activate
pip install opentelemetry-api==1.45.2 opentelemetry-sdk==1.45.2
python agent_trace.pyThe output, from a run on 28 November 2026 with Python 3.12.14 and SDK 1.45.2. Span ids are random and the durations come from the stub delays:
chat stub-model CLIENT span=1b19 parent=0dcf 55 ms
gen_ai.operation.name = chat
gen_ai.provider.name = stub
gen_ai.request.model = stub-model
gen_ai.conversation.id = conv-7f3a
gen_ai.response.model = stub-model
gen_ai.response.finish_reasons = ['tool_call']
gen_ai.usage.input_tokens = 412
gen_ai.usage.output_tokens = 38
retrieval INTERNAL span=e9c2 parent=0dcf 25 ms
gen_ai.operation.name = retrieval
gen_ai.retrieval.top_k = 3
execute_tool get_order_status INTERNAL span=1374 parent=0dcf 32 ms
gen_ai.operation.name = execute_tool
gen_ai.agent.name = support-agent
gen_ai.tool.name = get_order_status
gen_ai.tool.type = function
gen_ai.tool.call.id = call_1
gen_ai.conversation.id = conv-7f3a
chat stub-model CLIENT span=eb23 parent=0dcf 55 ms
gen_ai.operation.name = chat
gen_ai.provider.name = stub
gen_ai.request.model = stub-model
gen_ai.conversation.id = conv-7f3a
gen_ai.response.model = stub-model
gen_ai.response.finish_reasons = ['stop']
gen_ai.usage.input_tokens = 655
gen_ai.usage.output_tokens = 61
invoke_agent support-agent INTERNAL span=0dcf parent=none 168 ms
gen_ai.operation.name = invoke_agent
gen_ai.agent.name = support-agent
gen_ai.request.model = stub-model
gen_ai.conversation.id = conv-7f3a
answer: Order A-1042 shipped on 26 November.Three things to notice:
- Children end first. The exporter prints a span when it ends, so the root
invoke_agentcomes last. Theparentvalue of each child is thespanvalue of the root: one tree. - Sampling attributes come first. Operation, provider and model are passed when the span starts, as the conventions ask. Token counts and finish reasons are added after the reply.
- No content. The spans carry names, counts and durations, never the question or the answer.
- A local tool. The tool here is a plain function, so it has no
mcp.*attributes. The figure shows the same step as an MCP tool.
To send this to a real backend, replace ConsoleSpanExporter with the OTLP span exporter from the opentelemetry-exporter-otlp package, use BatchSpanProcessor instead of SimpleSpanProcessor, and point it at a Collector.
Pros, cons and limits#
| Aspect | Details |
|---|---|
| Pros | One vocabulary across frameworks, providers and backends. Covers agents, tools, retrieval, MCP and A2A, not only model calls. Vendor neutral, open source, no licence cost. |
| Cons | Development status: names still change, and v0.1.0 breaks dashboards built on the old metric and attribute names. Spans for planning are recommended only when the instrumentation can tell planning from ordinary inference. |
| Limits | The conventions name things; they do not instrument your code. You need an instrumentation library that follows v0.1.0, or manual spans as above. gen_ai.usage.* attributes are not additive across span types, so totals belong in the token metrics. |
| Privacy | Content capture is opt-in. If you need content in production, store it externally and keep references on the spans. Content that does reach the pipeline can be dropped or redacted in the Collector with the attributes, filter, redaction or transform processor. |
When to adopt it#
Adopt it now if you run agents in production and have no tracing yet, or if you build an instrumentation or a framework: the span tree and the metric split are worth having even with renames ahead. Pin the instrumentation version and treat each conventions release like a dependency upgrade.
Wait, or adopt it in a branch, if your dashboards and alerts depend on the pre-v0.1.0 names and your instrumentation library has not moved yet.
Next step: read the agent spans page in the conventions repository (opens in a new tab), then put an OpenTelemetry Collector between your agents and your backend before you turn on anything that captures content.

