CALL FOR PARTICIPATION




OpenTelemetry GenAI Semantic Conventions, Agent Spans: Official Docs Breakdown for Developers

As generative AI moves from a single model call to systems that plan, call tools, hand work to specialists, and retain context, tracing needs to show more than latency. The OpenTelemetry GenAI semantic conventions agent spans official docs provide a shared vocabulary for recording that work in a format observability platforms can understand. For developers, this means fewer mystery gaps between a user request and a final answer, plus a clearer path to diagnosing cost, reliability, safety, and orchestration problems.

Pydantic Logfire brings AI observability and evaluation together

Pydantic Logfire is a full-stack AI observability and evaluation platform built on OpenTelemetry. It helps teams trace agent workflows, inspect LLM interactions, monitor tool calls, and investigate application performance across different frameworks and languages. Pydantic Logfire supports Pydantic AI, LangChain, the OpenAI SDK, and other OpenTelemetry-compatible frameworks without requiring teams to change their existing AI stack.

By bringing agent traces, model activity, API requests, and infrastructure telemetry into one platform, Pydantic Logfire helps developers identify failures and improve production AI applications. Its evaluation capabilities also allow teams to assess agent behavior, compare experiments, and detect regressions, connecting observability with continuous improvement.

What GenAI semantic conventions standardize

OpenTelemetry is an open standard for collecting telemetry, including traces, metrics, and logs. A trace follows a unit of work through an application, while a span records one timed operation within that work, such as handling an HTTP request, querying a database, generating an embedding, or asking a model to produce text.

GenAI semantic conventions extend this approach to AI systems. Instead of each framework creating its own unrelated field names, the conventions provide a shared set of attributes for operations such as chat generation, embeddings, tool execution, and agent invocation. This common language becomes especially valuable when an application relies on several components, including a model provider, agent framework, tool server, and tracing backend. Each part of the system can describe related activity in a consistent format, making the resulting trace easier to follow.

The conventions do not prescribe how an agent should reason or which framework a team should adopt. Their purpose is to record what occurred during execution in a way that remains useful across tools and providers. As a result, dashboards, alerts, and debugging workflows become less tied to one proprietary SDK, which is helpful when teams introduce a new framework or change model providers.

The role of attributes

A span name gives a concise summary of an operation, while attributes supply the surrounding detail. In a GenAI trace, those attributes may identify the operation type, model, provider, token usage, tool details, or agent identity. The exact fields available will depend on the operation being tracked and the version of the semantic conventions used by the instrumentation.

These fields should be treated as operational context rather than a place to collect every prompt, response, or item of customer data. Recording large volumes of content can increase telemetry costs, while capturing sensitive information can create privacy and security concerns. A well-designed trace provides enough context to explain what happened without exposing data that should remain private.

Stability and version awareness

GenAI semantic conventions are developing quickly because AI tooling and agent patterns are evolving at the same pace. Attribute names, recommended values, and the way certain operations are modeled may change as the OpenTelemetry community gains more implementation experience.

Developers should therefore pin instrumentation package versions and consult the official specification that corresponds to the version they use. Reusing an attribute from an older example without checking its current status can lead to inconsistent telemetry and make a future migration more difficult.

The aim is not to follow a sample mechanically, but to maintain interoperable, dependable trace data as the ecosystem matures.

How agent spans fit into an AI trace

An agent span represents the work performed by an agent acting as an orchestrator. Rather than recording only a single model request, it captures the broader task: the agent receives an objective, decides which actions are needed, calls a model or tool when appropriate, delegates work to other agents if necessary, and produces an outcome or hands control back to the application.

A typical trace begins with a request span, such as an incoming API call or user action. Within it, an agent invocation span can record the agent’s work. That agent span may include child spans for model calls, tool executions, handoffs, and subagent activity. The hierarchy mirrors the actual workflow, allowing developers to see both the overall task and the individual steps that contributed to it.

This structure is important because an agent is not simply another name for a model call. It may call a model several times while planning, checking information, or refining an answer. In other cases, it may rely on cached state, use a deterministic tool, request human approval, or route the task to a specialist agent without making a model request at all. By keeping these actions beneath the same parent span, the trace shows how the workflow was coordinated from start to finish.

Agent identity and operation context

GenAI conventions provide agent-specific context so telemetry can distinguish the agent that managed the work from the model that generated part of the result. A clear agent name, such as support_triage or research_assistant, gives developers a readable label in a trace viewer. A stable identifier can provide an additional way to separate different configured instances, even where they share the same display name.

The operation type is equally important. An agent invocation should be recorded as orchestration work rather than being mistaken for a direct model completion or embedding request. This distinction makes it easier to filter traces, compare the performance of different agents, and identify where a workflow begins to slow down or fail.

Names should reflect the agent’s actual responsibility and remain consistent across deployments. Avoid placing changing user information in span names, since that creates noisy data and can introduce privacy concerns. Clear, stable identifiers make dashboards more useful and allow teams to compare performance trends over time.

Parent-child relationships tell the real story

Trace structure is just as important as attributes. If a tool call is triggered by an agent, the tool span should normally be a child of the agent span or otherwise linked in a way that preserves causality. If a specialist subagent takes over, its invocation can become a nested child span.

This lets an engineer answer practical questions quickly. Did the root cause originate in the planning agent, the model provider, an external API, or a downstream specialist? Did the workflow spend most of its time waiting for a tool, generating output, or retrying a failed step?

A flat list of events cannot answer those questions nearly as well, but a connected trace can.

Reading the core GenAI operations

The conventions distinguish operations because each has different performance, reliability, and cost characteristics. A chat or text-generation operation is not the same as an embedding request, while a tool execution has different failure modes from either one.

At the model layer, a span can capture the requested model and provider context, along with measurements such as duration and usage where supported. Token information is especially valuable because it provides a bridge between application activity and model spending.

At the agent layer, the trace can show why several model calls occurred under one user request. A planning loop, a correction attempt after a schema validation failure, and a final response may each be visible as distinct work within the same agent invocation.

The table below provides a practical reading guide.

Span or operation area

What it represents

Useful information to capture

Common diagnostic value

Agent invocation

An agent coordinating a task

Agent name, stable ID, operation context, outcome

Shows which orchestrator owned the workflow

Model generation

A call to generate text or structured output

Provider, model, request settings, token usage, response status

Helps investigate latency, spend, failures, and model behavior

Embedding

A request to turn content into vectors

Model, input count, dimensions where available, duration

Reveals retrieval indexing or search bottlenecks

Tool execution

A tool or function called by an agent

Tool name, tool type, status, duration, error details

Identifies slow, failing, or overused integrations

Subagent invocation

Delegation to another specialized agent

Parent agent, child agent identity, result status

Explains multi-agent routing and delegation paths

Tool spans are not an afterthought

Tool calls frequently determine whether an agent is useful. A model may decide to look up an order, search a knowledge base, query an internal service, execute code, or update a ticket. If that action is untraced, the trace can misleadingly suggest that the model was slow or unreliable.

A tool span should make the called capability understandable without revealing secrets. Capture the tool’s logical name, timing, success or failure state, and safe error context. Do not place credentials, authorization headers, raw personal data, or confidential tool arguments into ordinary attributes.

Errors need context, not just a red status

When an operation fails, the trace should indicate where the failure occurred and what class of problem it was. A provider timeout, invalid tool input, permission problem, rate limit, unavailable service, and output validation failure call for different fixes.

OpenTelemetry error recording can preserve exception details where appropriate, but teams should redact sensitive messages before export. The goal is to leave enough context for investigation without treating a trace store as an unrestricted debugging dump.

A well-instrumented failure can shorten incident response dramatically. It can also reveal patterns that ordinary application logs miss.

Practical implementation choices for developers

Start by tracing the boundary where your application receives work. This might be an HTTP endpoint, queue consumer, scheduled task, or workflow trigger. From there, preserve context as the request enters the agent runtime, calls a model, uses tools, and returns a result.

Then decide which identifiers are safe and useful. A request ID, tenant-safe correlation ID, agent name, model name, operation category, status, and duration are usually strong candidates. User messages, tool arguments, retrieved documents, and model responses need explicit privacy rules before being collected.

This approach keeps telemetry intentional. It also prevents traces from becoming expensive, noisy archives.

Sample trace shape

A customer asks a support assistant to explain an invoice discrepancy. The application receives the request and creates a root span. The assistant’s agent span begins beneath it, then the assistant calls a model to determine whether it needs account data.

The model requests a billing lookup, so the agent creates a tool span for the billing service. After the service responds, the agent may make another model call to turn the result into a clear explanation. The final answer completes the agent span, followed by the original request span.

A trace viewer can display that sequence as a tree. An engineer can immediately see whether a delay came from the model or billing system.

Avoiding noisy instrumentation

More attributes do not automatically produce better observability. Recording volatile values as attributes can create high-cardinality data, making queries slower and more costly. Storing full prompts and outputs by default can create a more serious problem: accidental collection of private or regulated information.

Prefer concise, bounded values. Use approved sampling policies, redact sensitive fields before export, and reserve detailed content capture for tightly controlled debugging workflows. Where a prompt or result must be inspected, consider secure application logs with access controls rather than broad telemetry attributes.

Making agent traces useful in production

The most valuable traces connect technical events to operational outcomes. A slow agent is not necessarily a bad agent if it completes a complex research task correctly, while a fast agent that repeatedly calls an outdated tool can still damage the customer experience.

Define a small set of questions before building dashboards. Which agents use the most model tokens? Which tool calls fail most often? Which workflows exceed a latency target? Where do retries occur? Which model or prompt changes introduced regressions?

Those questions shape the fields worth collecting. They also keep instrumentation aligned with real decisions.

Pair tracing with evaluation

Tracing explains what happened during a particular run. Evaluation assesses whether the result was good. Used together, they give teams a stronger feedback loop: traces reveal the sequence that produced an answer, while evaluations indicate whether that answer met quality, safety, or task-completion expectations.

For instance, a quality decline might correlate with a model change, a new tool version, a longer retrieval path, or a rise in validation retries. Without traces, teams may know that a score changed but struggle to identify the responsible component.

A trace is evidence of execution. An evaluation is evidence of outcome. Both are needed for mature AI operations.

Establish conventions within your own team

The OpenTelemetry specification provides the shared foundation, but every engineering organization should document a few local rules. Decide how agent names are formatted, which data is redacted, when a subagent gets its own span, and how errors are classified.

Keep that guidance short enough that developers will use it. A naming convention such as domain_task_role can be sufficient if it remains consistent, for example, support_invoice_triage or research_source_checker.

Consistency turns raw telemetry into a system that can be queried and compared over time. That is where semantic conventions deliver their real value.

From scattered events to understandable agent behavior

OpenTelemetry GenAI semantic conventions give AI systems a vocabulary for showing their work. Agent spans add the orchestration layer that makes a multi-step workflow understandable, while model and tool spans expose the actions beneath it. Together, they help developers move from a vague report that an agent was slow or failed to a concrete explanation of what occurred.

The strongest implementation is focused rather than exhaustive. Capture the relationships, names, durations, safe operational attributes, and error context that answer real questions. With careful version management, sensible privacy controls, and a trace hierarchy that reflects the actual workflow, developers can make agentic applications easier to operate, improve, and trust.



Key Dates
  • 24 March 2010
    Call For Participation Open
  • 13 April 2010
    Call For Participation Closes
  • 16 April 2010
    Speaker Acceptance/Rejection Notification
  • 18-19 May 2010
    Lucene and Solr Pre-conference Training Sessions
  • 20-21 May 2010
    Apache Lucene EuroCon


To submit a 45-minute presentation proposal, please send an email to .