Skip to content

Tracing the Agent: OpenTelemetry's GenAI Conventions Start to Make Reasoning Observable

Published: at 03:50 AMSuggest Changes

The difference between monitoring a model and operating an agent is the difference between watching a single API call and watching a small organisation make a decision. A model round-trip has a latency, a token count and a finish reason. An agent has an intent, a plan, a sequence of tool calls, and a chain of consequences across your estate. When the agent gets it wrong, the answer to “where did it go wrong” is not in any one model call. It lives in the reasoning between the calls.

For years that reasoning was the blind spot. Agents ship on top of general-purpose frameworks — CrewAI, LangGraph, the OpenAI Agents SDK, Microsoft Agent Framework, ADK — and each emits its own notion of a unit of work. Your observability remains stranded in the model calls and the HTTP client, while the actual decision sequence, the thing your incident response needs, is invisible.

OpenTelemetry’s GenAI semantic conventions have started to close that gap. They now define a set of agent and framework spans — create_agent, invoke_agent, invoke_workflow, plan, execute_tool — that carry gen_ai.* attributes describing the model, the agent, the messages, the tool calls and the token usage. This is the emerging vendor-neutral contract for showing the intent-to-plan-to-tool chain as one correlated trace. It is not finished, and not automatic, but it is the structure the industry is coalescing around.

What the agent spans actually define

The conventions are not a single “agent span”. They split the lifecycle into distinct operations, each with its own span kind and its own gen_ai.operation.name. Reading them in order gives you the shape of a trace the way a good operator actually wants to see it.

create_agent is a client-side span describing agent creation, typically against a hosted agent service. Its span name should be create_agent {gen_ai.agent.name}, and it attaches the identity fields — gen_ai.agent.id, the stable unique identifier; gen_ai.agent.name, the human-readable name; and gen_ai.agent.version. When the agent runs in-process, invoke_agent is reported as an internal span for the entrypoint invocation. Crucially, the spec distinguishes two control-flow shapes. invoke_agent is for when the model drives the control flow through tool calls, which is how LangChain, OpenAI Agents and CrewAI Agent are meant to be classified. invoke_workflow is for when the application defines the control flow, the pattern behind LangGraph StateGraph, Microsoft Agent Framework Workflow and CrewAI Crew. A framework entrypoint that is neither is reported as invoke_{framework_entrypoint}, so ADK and OpenAI Agents Runner.run becomes invoke_runner.

The plan span represents the decision phase. It should only be emitted when the instrumentation can reliably tell planning from reasoning; the model call that generates the plan sits as its child while the tool spans that follow are siblings under the same invoke_agent. Then the tool work gets a dedicated execute_tool span, named execute_tool {gen_ai.tool.name}, with gen_ai.tool.call.id tying the call back to the model that requested it, and optional gen_ai.tool.call.arguments and gen_ai.tool.call.result.

Alongside the agent identity fields, the shared gen_ai.* vocabulary carries what makes the trace interpretable. gen_ai.operation.name names the operation on every span. gen_ai.request.model and the request parameters describe the model configuration. gen_ai.usage.input_tokens and gen_ai.usage.output_tokens — alongside cache and reasoning counters — carry the token usage. And gen_ai.conversation.id allows every span in one session to be correlated, an identifier the conventions say to populate whenever the framework gives you one.

The discipline in the spec is worth noting. gen_ai.agent.name must be low cardinality: you are told not to record framework defaults or type names such as StateGraph, and not to capture a name at all when there is no meaningful one. A name like that is meant to be an identity you can aggregate, version and blame, not a debug string.

Instrumentation without attribution is a latency chart

The case for this structure is not prettier dashboards. It is that agents introduce failure modes a black-box latency chart cannot show you.

Consider the incident pattern that keeps recurring in multi-agent estates. A fulfilment agent issued a refund from a plausible but wrong order status, produced three hops earlier by an orchestration agent that trusted a stale cache entry. Every model call looked healthy. Tokens in band, HTTP 200, no error type, latency acceptable. Nothing was red. The failure was the gap between the spans — a step where a reasoning agent chose a course of action on the basis of information that was wrong.

That is exactly the question the span shapes are built to answer. Which step? Which tool? Which agent’s permission and identity? create_agent tells you the version of the agent that was live. invoke_workflow tells you which state graph decision it was running through. plan tells you the reasoning step where the decision was formed. execute_tool tells you which tool it acted on, with gen_ai.tool.call.id tying each tool call to the model that requested it. And gen_ai.conversation.id lets you pull every span that belongs to one session out of a noisy stream. Chain those together and “which agent, which step, which tool” becomes a query, not a hypothesis.

This is not theory. A team at Alibaba Cloud published an OTel agent harness in November that drives a CrewAI plugin to emit these exact shapes — wrapping Crew.kickoff, Agent.execute_task and the tool-use path, and validating the output against the semantic-convention registry with Weaver. Their own reported feedback loop is the sharpest argument for the conventions: they flatly say a reviewing model sometimes approved telemetry that violated the spec until they replaced human judgment of output with a machine check against the registry. When you cannot even trust an LLM to tell you whether the telemetry is correct, you want the contract to be explicit and checkable, not tribal.

The honest gaps: Development status, and mapping that needs humans

For all that structure, the conventions carry two facts you should plan around, not gloss over.

First, this is Development-status work. Every agent and framework span in the spec is marked Development, and the conventions live in a dedicated semantic-conventions-genai repository that is still evolving. That is the normal OpenTelemetry pattern — the vocabulary firms up through use before it stabilises — but attribute names can rename and span shapes can tighten. Anyone building on these today should expect the mapping to move and budget for it.

Second, and more subversive for the automation-minded: deciding which span a framework operation maps to is not mechanical. The conventions themselves acknowledge this by requiring frameworks to document which of their operations they report as invoke_agent versus invoke_workflow versus invoke_{framework_entrypoint}. The exercise is genuinely judgement. Is a CrewAI Crew an agent or a workflow? The convention says workflow, because the application defines the control flow, while a CrewAI Agent is an invoke_agent because the model drives it. But that classification depends on understanding what the framework actually does, and the Alibaba team reports the same from the other side: an instrumentation left to pick its own targets wrapped methods bluntly, and even an agent-driven plan missed framework lifecycle details unless an engineer who knew the framework reviewed it first. The first draft often gets the strategy wrong; human review is where the mapping corrects, and the registry check where violations are caught.

There is a third, quieter gap the spec hints at. The conventions point out that prompts and completions carry personal data and should be captured with care, as separate events or external storage rather than as free-running span attributes. gen_ai.tool.call.arguments and gen_ai.tool.call.result are explicitly opt-in for that reason. Your token-telemetry volume, and your privacy posture, have to be designed together, not bolted on after the first audit.

A plan to adopt the contract

You cannot buy your way out of the judgement problem, but you can structure your way through it. A few practical moves follow from how the conventions are actually built.

Define your operation names once. Decide, for each framework and each agent in your estate, which operation it reports — document the invoke_agent versus invoke_workflow versus invoke_{framework_entrypoint} mapping in one place, mirroring what the spec asks of framework maintainers. That single document is the contract your platform team, your process owners and your on-call rotation all read.

Propagate gen_ai.conversation.id through every span. It is the cheapest correlation you will ever emit, and it is the field that turns a hundred interleaved tool calls from two concurrent sessions into two separable stories. If your framework exposes a session, thread or conversation handle, set the attribute from it.

Budget for token-telemetry volume before you scale. A single agent run can emit many inference spans, each with input, output, cache and reasoning token counters. Decide what you retain in hot storage, what you aggregate into metrics, and what you drop. The usage attributes are high signal for cost and drift, but they multiply.

Then pin your versions and your conventions. With Development-status specifications and a live repository, the safe stance is to pin both the semantic-convention registry definition and your instrumentation versions, keep every attribute name in one configuration the way the shared GenAI utilities do, and review the pin on a cadence. Renames will arrive; let them arrive as a deliberate migration, not as a background surprise.

Finally, retain what you need to replay. The whole point of the correlated trace is that it answers the attribution questions — which step, which tool, which agent version, under whose authority — after the fact. A trace you can reason over, next to the release assembly that produced it, is the difference between explaining an incident and guessing at one.

The contract is forming

The GenAI semantic conventions will keep moving. The span names and attribute shapes in the Development spec will tighten, and next year’s vocabulary will not match this year’s. But the direction is settled. Observability for agents is becoming a first-class telemetry contract, with real span kinds and real attribute names, and it is being validated against actual framework instrumentation as it lands.

The practical question for platform leaders is less whether to adopt it than how fast. Agents multiply the ways a decision can go wrong, and every one of those ways is invisible if all you watch is the model call. The organisation that treats the reasoning-to-tool chain as observable infrastructure, propagates a conversation id, and pins its conventions will answer “which agent, which step, which tool” in minutes instead of hoping. The instrumentation is emerging on its own. Your job is to decide what it means for the estate you operate.

Sources


Related reading

Next Post
Open-Weight or Closed: The Model Sourcing Decision Belongs on the Board's Agenda