Once initialized, ADK agent executions, tool calls, and underlying Gemini calls are captured automatically:
import asyncioimport tracerootfrom traceroot import Integrationfrom google.adk.agents import Agentfrom google.adk.runners import InMemoryRunnerfrom google.genai import typestraceroot.initialize(integrations=[Integration.GOOGLE_ADK])def get_weather(city: str) -> dict: """Get current weather for a city.""" return {"status": "success", "city": city, "temp": 72, "condition": "sunny"}agent = Agent( name="assistant", model="gemini-2.5-flash", description="Helpful assistant with access to tools.", instruction="You are a helpful AI assistant. Use tools when needed.", tools=[get_weather],)async def main(): runner = InMemoryRunner(agent=agent, app_name="traceroot-adk-demo") await runner.session_service.create_session( app_name="traceroot-adk-demo", user_id="demo-user", session_id="demo-session", ) # The full run, including tool calls and Gemini calls, is traced async for event in runner.run_async( user_id="demo-user", session_id="demo-session", new_message=types.Content( role="user", parts=[types.Part(text="What's the weather in Tokyo?")], ), ): if event.is_final_response() and event.content and event.content.parts: print(event.content.parts[0].text)if __name__ == "__main__": asyncio.run(main()) traceroot.flush()