Trace anatomy

For an SDK-centered workflow, an end-to-end trace is built from spans, and those spans carry timing information, trace and parent identifiers, plus data specific to the span type.

Native tracing

The Agents SDK includes tracing as a built-in capability and enables it unless the application changes that setting.

Its automatic instrumentation can create visibility for runner activity, model interactions, agents, language-model generation, function tools, safety checks, handoffs, transcription, speech, and developer-created events.

The SDK provides global controls through environment and code configuration, and a run can also receive its own tracing setting through RunConfig. If a hierarchy is too noisy, automatic task and turn spans can be omitted while preserving several lower-level operational spans.

Export timing and retention constraints

The standard batch exporter works asynchronously: it sends accumulated trace data on a periodic schedule or after its queue reaches its configured threshold, then attempts a final send during shutdown.

A worker can therefore finish a unit of work before its trace appears in the dashboard. For long-lived processes, the documented pattern is to call flush_traces() after leaving the trace context when immediate end-of-unit delivery is needed.

The documentation states that this tracing is not available to organizations operating under a Zero Data Retention policy.

OpenTelemetry GenAI attributes

OpenTelemetry’s GenAI conventions describe common attribute concepts for agent description, agent ID, agent name, agent version, conversation ID, operation name, incoming messages, and outgoing messages.

The supplied OpenTelemetry reference also says that its listed GenAI attributes have been relocated to the GenAI semantic-conventions repository, so implementation work should check the current repository and version.

The supplied material does not provide a ready-made mapping from SDK span fields to every OpenTelemetry attribute.

Custom processor destinations

The SDK supports custom trace processors that may replace its usual destination or add another destination.

Limits of the available material

The supplied excerpts do not include a complete SDK-to-OpenTelemetry field map, and the configuration excerpt stops as its websocket-transport discussion begins.

Accordingly, this article offers an implementation planning framework, not a compatibility certification or a security assessment.