Skip to main content
Automatically capture agent runs, workflow graphs, tool executions, and the underlying Gemini calls within the Google Agent Development Kit (ADK).

Install

Set up

Usage

Once initialized, ADK agent runs, tool calls, and Gemini calls are captured automatically:

Usage with the ADK CLI

If you run your agent with adk run or adk web, initialize traceroot at the top of agent.py:
adk web and adk api_server install their own OpenTelemetry tracer provider before agent.py loads. From traceroot 0.3.0, @observe spans are traced alongside ADK’s spans in these modes. On 0.2.0, ADK’s spans still arrive but @observe spans are dropped; use adk run or your own runner instead.

Usage with Workflows

ADK 2.x runs agents, tools, and plain Python functions as nodes of a graph Workflow. Each workflow run, node, fan-out, and join is traced:
Workflow and node spans need the first traceroot release after 0.2.0. On 0.2.0, only the Agent nodes of a workflow appear.

Verify

Run your code and confirm the trace arrives:
  1. In the traceroot UI: Navigate to Tracing > Traces in traceroot Cloud. You should see a trace with root span invocation [<app>], or invoke_workflow <name> for workflow runs (requires a traceroot release newer than 0.2.0).
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Limitations

  • Model aliases such as gemini-flash-latest are not priced; pin a concrete model ID (such as gemini-3.8-flash) to capture token costs.
  • adk web and adk api_server install their own OpenTelemetry tracer provider before agent.py loads; traceroot >= 0.3.0 is recommended when using these modes.

Run the example

Clone the repo and run a complete agent end-to-end.

Agent

Run the Python agent example

Workflow

Run the Python workflow example

Next steps

Python SDK Reference

Explore the full Python SDK reference and instrumentation options.

Cost Tracking

Learn how traceroot calculates token costs and tracks model spend.