Musterby Elitery
Integrations

Google Agent Development Kit (ADK)

Trace Google ADK agents in Muster via the OpenInference instrumentation.

Google's Agent Development Kit (ADK) streamlines building, orchestrating, and tracing generative-AI agents out of the box. Muster captures ADK runs through the OpenInference instrumentation.

Setup

1. Install dependencies

%pip install langfuse google-adk openinference-instrumentation-google-adk -q

2. Configure credentials

import os

os.environ["LANGFUSE_PUBLIC_KEY"] = "pk-lf-..."
os.environ["LANGFUSE_SECRET_KEY"] = "sk-lf-..."
os.environ["LANGFUSE_BASE_URL"] = "https://app.getmuster.io"

# Gemini API key from Google AI Studio
os.environ["GOOGLE_API_KEY"] = "..."
from langfuse import get_client

langfuse = get_client()

if langfuse.auth_check():
    print("Muster client is authenticated and ready!")

3. Instrument ADK

from openinference.instrumentation.google_adk import GoogleADKInstrumentor

GoogleADKInstrumentor().instrument()

4. Build a hello-world agent

Every tool call and model completion is captured as an OpenTelemetry span and forwarded to Muster.

from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types

def say_hello():
    return {"greeting": "Hello Muster 👋"}

agent = Agent(
    name="hello_agent",
    model="gemini-2.0-flash",
    instruction="Always greet using the say_hello tool.",
    tools=[say_hello],
)

APP_NAME = "hello_app"
USER_ID = "demo-user"
SESSION_ID = "demo-session"

session_service = InMemorySessionService()
await session_service.create_session(app_name=APP_NAME, user_id=USER_ID, session_id=SESSION_ID)

runner = Runner(agent=agent, app_name=APP_NAME, session_service=session_service)

user_msg = types.Content(role="user", parts=[types.Part(text="hi")])
for event in runner.run(user_id=USER_ID, session_id=SESSION_ID, new_message=user_msg):
    if event.is_final_response():
        print(event.content.parts[0].text)

5. View the trace

Google ADK example trace in Muster

See also