Skip to main content
Agentex provides three built-in tracing providers that automatically create spans for LLM calls, tool invocations, or both. Each provider integrates with a different framework and has different tracing coverage. Configure the SGP processor first using the Agentex Tracing Quick Start, then use the integration for your framework below.
Built-in providers give you a baseline — auto-traced LLM calls, tool calls, or both, depending on the provider — but truly useful traces require manual instrumentation by the agent implementer: turn-level spans, custom reasoning steps, structured input/output, and proper parent-child linking. Think of built-in providers as the foundation, not the finished product. See Span Hierarchy & Best Practices for how to build on top of them.

Comparison


Providers

Worker and Workflow Setup

For Temporal-style agents using the OpenAI Agents SDK, LLM calls are auto-traced via TemporalStreamingModelProvider. TemporalTracingModelProvider was removed in agentex-sdk 0.19.0. For non-Agentex usage of the OpenAI Agents SDK with the SGP tracing SDK directly, see the OpenAI Agents Integration page.Import TemporalStreamingModelProvider, ContextInterceptor, and the stream_lifecycle_content activity from agentex.lib.core.temporal.plugins.openai_agents. Register TemporalStreamingModelProvider with the worker’s OpenAIAgentsPlugin, register ContextInterceptor in the worker’s interceptor list, and add stream_lifecycle_content to the worker’s activities. Follow the Temporal OpenAI worker template for the complete worker configuration.The tracing flow is:
  1. Your workflow sets _task_id, _trace_id, and _parent_span_id on the workflow instance
  2. ContextInterceptor, registered on the worker, carries these IDs to each activity the workflow starts
  3. TemporalStreamingModel, the model the provider returns, creates a span for each get_response() call. It raises a ValueError if the task, trace or parent span ID is missing.

Auto-Traced Span Structure

Each LLM call produces a single span named streaming_model_get_response:
The span name is always streaming_model_get_response. The model name appears in the span’s input data. When the model input includes tool calls or tool results, the output also lists them under tool_calls and tool_outputs.

Run a Turn with Tool Tracing

Call this method inside your configured workflow class. It creates the parent span, sets the model activity context, and passes the same context to the default tool hooks:
run_turn creates TemporalStreamingHooks by default, passes them trace_id and parent_span_id, and closes any tool spans left open when the run ends. If you supply custom hooks, pass trace_id and parent_span_id to their constructor yourself; run_turn does not apply those values to custom hooks.

Streaming Hooks

When you call Runner.run directly, create TemporalStreamingHooks yourself. It streams tool lifecycle events to the UI in real time. With trace_id set, it also opens a span for each tool call:
With TemporalStreamingModelProvider, the model posts each tool request (ToolRequestContent) itself, so emit_tool_requests=False keeps it from appearing twice. The hooks stream:
  • ToolResponseContent when a tool finishes (name, result)
  • TextContent on agent handoffs
If the run stops in the middle of a tool call, close_open_tool_spans() ends that tool’s span, which is otherwise never written.Each tool span takes the bare tool name (no tool: prefix) and is a child of parent_span_id. Its input holds the tool arguments under arguments, and its output holds the result, cut to 2,000 characters, under result.

Tracing Gap: Tool Calls

Tool executions get their own spans only when you pass trace_id to TemporalStreamingHooks. Without it, tool calls appear only inside the model span’s output.new_items array as function_call entries.If you need more detail than the tool span records, create manual spans around your tool logic. See Manual Spans.

Choosing a Provider

Use TemporalStreamingModelProvider for automatic LLM call tracing. The temporal-openai-agents CLI template passes it to OpenAIAgentsPlugin as model_provider and adds ContextInterceptor to the worker’s interceptors.For tool-level tracing, call run_turn with trace_id and parent_span_id, or pass them to TemporalStreamingHooks. For other custom logic, create manual spans using adk.tracing.span(). See Manual Spans for examples.
Use the adk.providers.litellm methods. All four methods automatically create tracing spans when you pass trace_id and parent_span_id. Wrap your own tool executions in manual spans.The auto_send variants are convenient for chat-style agents since they handle both tracing and UI message creation in one call.
Wrap graph.astream() in LangGraphTurn and deliver it with UnifiedEmitter, passing trace_id and parent_span_id. Tool calls and reasoning get their own spans; LLM calls do not, so add manual spans inside model nodes as needed.You still need to create turn-level parent spans manually to group operations by conversation turn.