What is Agentex Tracing?
Modern AI agents execute complex, multi-step workflows: reasoning, calling tools, making LLM requests, and coordinating with other agents. Without tracing, these workflows are opaque. When something goes wrong or runs slowly, you’re left guessing. Agentex Tracing gives you deep visibility into your Temporal-style agents by capturing structured spans for every meaningful operation. You get:- One trace per task by default: use your Agentex
task_idastrace_id, or propagate an orchestrator trace ID across agents - A structured span hierarchy: turns, LLM calls, tool invocations, and custom logic all nest via
parent_id - Tool and model I/O capture: see exactly what went into and came out of each operation
- Profiler-ready data: consistent span naming enables aggregated performance analysis across all your traces
This guide covers tracing specific to Agentex agents. For general tracing concepts (spans, traces, the Traces UI), see Introduction to Tracing.
Architecture
Registered processors run in your agent SDK process and write independently to their backends. Since SDK 0.11.1, the Agentex processor is no longer registered by default. Storing a span in Agentex does not forward it to SGP. Configure the SGP processor in every process that emits spans, including separate Temporal activity workers; add the Agentex processor too if you need both destinations.Key Identity Relationships
Core Concepts
trace_id = task_id
Use the Agentex task ID astrace_id for a standalone task so you can find its spans by searching for that ID. For a unified multi-agent trace, pass the orchestrator’s trace ID to its children as described in Multi-Agent Tracing; child task IDs still route their messages.
Span Hierarchy
Spans form a tree viaparent_id relationships. A turn-level span is the parent of the LLM calls and tool invocations that happen during that turn. This hierarchy is what the Traces UI renders as an expandable tree and Gantt chart.
Span Data Model
Quick Start
Start with a configured Agentex project and install the ADK package,agentex-sdk, which provides the agentex.lib modules used here. The slim agentex-client package alone does not provide the ADK. See the SDK setup guidance.
1
Initialize Tracing in Your Agent Process
Set Registering the SGP processor also initializes the SGP tracing SDK, so
SGP_API_KEY, SGP_ACCOUNT_ID, and SGP_CLIENT_BASE_URL for your SGP deployment. Add this initialization to your acp.py; for Temporal agents, also configure each worker process that creates spans. If any of these variables is missing, the agent fails at startup.scale_gp_beta.lib.tracing.create_span() works in the same process without a separate tracing.init() call.2
Create a Turn Span and a Traced LLM Call
In the The turn span groups the child LLM span. The auto-send method delivers the response to the Agentex chat UI.
acp.py of an async agent that uses the base ACP type, use this event handler after the initialization above. If your project already defines acp, keep that instance and add the handler to it.3
View in the Traces UI
Run your agent using its manifest, create a task, and send a user message. Open the SGP Traces page, search for the task ID, and inspect the turn span and its child LLM span.

For a complete reference on the SGP Tracing SDK, see Creating Traces and Spans.
The Two Tracing Systems
Agentex Native Tracing (adk.tracing)
This is the primary system for Temporal agents. When the Agentex processor is registered, spans are sent to the Agentex backend API; a configured SGP processor independently receives the same SDK span events.
adk.tracing.span()creates a span with a UUID4 id- When the span ends, the processor writes the complete span, with its output and end time, to the Agentex database
- If inside a Temporal workflow: routes through Temporal activities instead of direct HTTP
SGP Tracing (scale_gp_beta.lib.tracing)
This is the SGP platform’s native tracing SDK. You can use it directly or as a dual-write processor alongside Agentex tracing.
When the SGP processor is registered, it sends each adk.tracing span to SGP and adds these keys to the span’s metadata:
__source__:"agentex"__agent_name__,__agent_id__,__acp_type__: the agent’s name, ID and ACP type
Which Should You Use?
- For Temporal agents: Use
adk.tracing.span(), which handles Temporal activity routing automatically - For standalone scripts: Use
scale_gp_beta.lib.tracing.create_span()directly - For dual-write: Explicitly register both
AgentexTracingProcessorConfig()andSGPTracingProcessorConfig(...), as shown in the Quick Start
Next Steps
- Want to understand what’s auto-traced for you? See the Built-in Tracing Providers guide for the OpenAI Agents SDK, LiteLLM, and LangGraph integrations.
- For naming conventions, input/output patterns, and profiler-friendly trace structure, see Span Hierarchy & Best Practices.
- Building a multi-agent system? See Multi-Agent Tracing to propagate trace context across orchestrator and sub-agents.
- For general tracing concepts and the SGP Tracing SDK, see Introduction to Tracing and Creating Traces and Spans.
- To understand the Traces UI, see the Traces Table, Profiler, and Trace Detail View pages.
- New to Agentex? Start with the Agentex Overview and Agentex Agent Types.