Available for: Python and TypeScript.
TypeScript
Installation
Four integration patterns
Choose the integration pattern that fits your setup:instrumentADK — recommended for production
instrumentADK wraps both your coordinator agent and its runner in a single call. Use this when building production ADK applications.
wrapADKRunner — runner-level wrapping
Wraps InMemoryRunner.runEphemeral() and Runner.run() by intercepting the ADK event stream. Emits one span per agent author turn, one span per tool call, and handoff spans on delegation.
wrapADKRunner options:
string
required
Display name for the root agent span in Zespan.
string
default:"coordinator"
Role hint for the agent registry. Use
"coordinator" for orchestrators and "specialist" for sub-agents.string
The model name used by the root agent. Shown in the trace detail panel.
string
Associates all spans from this run with a session in the Sessions view.
ZespanADKCallbackHandler — native ADK callbacks
Uses ADK’s built-in callback system (beforeAgentCallback, afterModelCallback, etc.). Create one handler instance and spread .callbacks into your LlmAgent config. Captures agent spans, LLM spans with full token counts, and tool call spans.
ZespanADKCallbackHandler is also exported as ADKCallbackHandler for shorter imports:
wrapADKAgent — agent-level wrapping
Wraps agent.run() directly. Best for unit tests and simple scripts. Recursively wraps subAgents by default.
What gets captured
All three wrappers capture the same data from the ADK event stream:Python
Installation
Three integration patterns
ZespanADKCallbackHandler — native ADK callbacks
Uses ADK’s built-in callback system. Create one handler and spread .callbacks into each LlmAgent constructor. Captures agent spans, LLM spans with full token counts, and tool spans.
ADK Python is async — run agents with InMemoryRunner inside asyncio.run().
Single agent:
invocation_id across coordinator and sub-agents, so all spans are automatically linked under one trace.
dict or any JSON-serializable value.
ZespanADKTracer — attach to an existing agent
Pass your ADK agent to ZespanADKTracer after creating it. The tracer intercepts agent.run to capture every model call, tool invocation, and agent session as hierarchical spans.
wrap_adk_agent — callback-handler style
wrap_adk_agent is the functional equivalent: it attaches tracing and returns the same agent. Use this when you want a one-liner or are composing agents inline.
ZespanADKTracer and wrap_adk_agent accept an optional guardrails argument:
Multi-agent systems
Attach
ZespanADKTracer (or call wrap_adk_agent) after the agent is fully configured. Attaching before sub_agents are set means sub-agent spans won’t be linked correctly.How multi-agent traces look in the dashboard
A coordinator + specialist ADK run produces a trace like this:
Session and user context
To associate ADK traces with a user session for the Sessions dashboard view, setsessionId and userId in the wrapper options (TypeScript) or via with_zespan_context (Python):
- TypeScript
- Python

