Install
- Python
Set up
- Python
Usage
Once initialized, ADK agent runs, tool calls, and Gemini calls are captured automatically:Usage with the ADK CLI
If you run your agent withadk 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 graphWorkflow. 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:- In the traceroot UI: Navigate to Tracing > Traces in traceroot Cloud. You should see a trace with root span
invocation [<app>], orinvoke_workflow <name>for workflow runs (requires atracerootrelease newer than 0.2.0). - Via the CLI: Run
traceroot traces listto inspect your recent traces from the terminal.
What gets captured
Limitations
- Model aliases such as
gemini-flash-latestare not priced; pin a concrete model ID (such asgemini-3.8-flash) to capture token costs. adk webandadk api_serverinstall their own OpenTelemetry tracer provider beforeagent.pyloads; 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.