Google Agent Development Kit Integration

Full observability for Google ADK agents. Capture Gemini model calls, function calls, and multi-turn conversations with automatic instrumentation.

Google ADK >= 0.1.0GeminiFunction CallingMulti-Turn

Installation

Terminal
pip install turingpulse_sdk turingpulse_sdk_google_adk google-adk

Quick Start

1. Initialize & Instrument

setup.py
from turingpulse_sdk import init, TuringPulseConfig
from turingpulse_sdk_google_adk import instrument_google_adk

# Initialize TuringPulse
init(TuringPulseConfig(
    api_key="sk_live_your_api_key",
    workflow_name="my-project",
))

# Enable auto-instrumentation for Google ADK
instrument_google_adk()

2. Use Google ADK Normally

main.py
from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService

agent = Agent(
    name="weather_agent",
    model="gemini-2.0-flash",
    description="An agent that provides weather information.",
    instruction="You help users with weather queries.",
)

session_service = InMemorySessionService()
runner = Runner(agent=agent, app_name="weather-app", session_service=session_service)

# Create a session and run - traces are captured automatically
session = await session_service.create_session(app_name="weather-app", user_id="user-1")

async for event in runner.run_async(
    user_id="user-1",
    session_id=session.id,
    new_message="What's the weather in London?",
):
    if event.content:
        print(event.content.parts[0].text)
ℹ️
Zero Code Changes
Once auto-instrumentation is enabled, all Google ADK agent runs, Gemini calls, and function invocations are automatically traced.

What Gets Captured

Data PointDescriptionExample
Agent RunsFull trace for each agent executionrunner.run_async(new_message="...")
Gemini CallsModel name, generation config, safety settingsgemini-2.0-flash, temp=0.9
Function CallsTool/function invocations with arguments and resultsget_weather(city='London')
Multi-Turn ConversationsSession history and conversation contextsession_id: abc123, turns: 5
Token UsageInput and output token counts per callprompt: 200, completion: 120
LatencyEnd-to-end and per-step timingtotal: 1800ms, model: 1200ms
ErrorsExceptions with context and retry informationResourceExhausted: quota exceeded

Advanced Configuration

config.py
from turingpulse_sdk import KPIConfig
from turingpulse_sdk_google_adk import instrument_google_adk

run = instrument_google_adk(
    agent,
    name="google-adk-service",
    model="gemini-2.0-flash",
    provider="google",
    kpis=[
        KPIConfig(kpi_id="latency_ms", use_duration=True, alert_threshold=8000),
        KPIConfig(kpi_id="tokens", alert_threshold=8000, comparator="gt"),
    ],
)

Function Calling

functions.py
from google.adk.tools import FunctionTool

def get_weather(city: str) -> dict:
    """Get the current weather for a city."""
    return {"city": city, "temp_f": 72, "condition": "Sunny"}

def search_flights(origin: str, destination: str, date: str) -> dict:
    """Search for available flights."""
    return {"flights": [{"airline": "UA", "price": 450}]}

weather_tool = FunctionTool(func=get_weather)
flights_tool = FunctionTool(func=search_flights)

agent = Agent(
    name="travel_agent",
    model="gemini-2.0-flash",
    description="A travel planning agent.",
    instruction="Help users plan their trips.",
    tools=[weather_tool, flights_tool],
)

# Function calls are automatically captured with inputs, outputs, and timing
💡
Multi-Agent Support
Google ADK supports multi-agent architectures. TuringPulse traces the full delegation chain across parent and child agents.

Next Steps