> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google ADK SDK Quick Start

> Learn how to integrate Google ADK agents with Fiddler using the Fiddler ADK SDK for automatic instrumentation and comprehensive observability.

## What You'll Learn

In this guide, you'll learn how to:

* Set up a Fiddler application for monitoring Google ADK agents
* Install and configure the Fiddler ADK SDK
* Instrument ADK agents with automatic telemetry
* Run a multi-turn agent with tool calls
* Verify monitoring is working correctly

**Time to complete**: \~10 minutes

## Prerequisites

Before you begin, ensure you have:

* **Fiddler Account**: An active account with [access](/reference/access-control/role-based-access) to create applications
* **Python 3.10+**: Verify your version:

  ```bash theme={null}
  python --version
  ```
* **Fiddler ADK SDK**: Install the SDK:

  ```bash theme={null}
  # Using uv (recommended)
  uv add fiddler-adk

  # Or using pip
  pip install fiddler-adk
  ```
* **Google Gemini Access**: Either a Gemini API key or Vertex AI credentials:

  ```bash theme={null}
  # Option A: Gemini API key
  export GOOGLE_API_KEY=<your-gemini-api-key>

  # Option B: Vertex AI
  export GOOGLE_GENAI_USE_VERTEXAI=1
  export GOOGLE_CLOUD_PROJECT=<your-gcp-project>
  export GOOGLE_CLOUD_LOCATION=us-central1
  ```

<Info>
  If you prefer using a notebook, download it directly from [GitHub](https://github.com/fiddler-labs/fiddler-examples/blob/main/quickstart/latest/Fiddler_Quickstart_Google_ADK_Integration.ipynb) or open it in [Google Colab](https://colab.research.google.com/github/fiddler-labs/fiddler-examples/blob/main/quickstart/latest/Fiddler_Quickstart_Google_ADK_Integration.ipynb) to get started.
</Info>

<Steps>
  <Step title="Create a Fiddler Application">
    First, create a dedicated application in Fiddler to receive your agent traces.

    1. Sign in to your Fiddler instance
    2. Navigate to **GenAI Applications** in the left sidebar
    3. Click **Add Application**
    4. Enter the application details:
       * **Name**: `google-adk-monitoring`
       * **Project**: Select a project from the dropdown or press *Enter* to create a new one
    5. Click **Create** and copy the **Application UUID** (you'll need this for configuration)
  </Step>

  <Step title="Configure Credentials">
    Set up the required credentials. You need your Fiddler API key (from Settings) and the Application UUID from Step 1.

    Instructions for generating your API key can be found in the [Access guide](/reference/administration/settings#credentials).

    ```bash theme={null}
    # Fiddler credentials
    export FIDDLER_URL="https://your-fiddler-instance.com"
    export FIDDLER_API_KEY="<your-fiddler-api-key>"
    export FIDDLER_APPLICATION_ID="<application-uuid-from-step-1>"

    # Google Gemini credentials (choose one)
    export GOOGLE_API_KEY="<your-gemini-api-key>"
    # or for Vertex AI:
    # export GOOGLE_GENAI_USE_VERTEXAI=1
    # export GOOGLE_CLOUD_PROJECT="<your-gcp-project>"
    ```

    <Info>
      **Tip**: Save these in a `.env` file and load with `python-dotenv` for easy reuse.
    </Info>
  </Step>

  <Step title="Set Up Instrumentation">
    Add two lines to your application to enable Fiddler monitoring:

    ```python theme={null}
    import os
    from fiddler_otel import FiddlerClient
    from fiddler_adk import GoogleADKInstrumentor

    # Initialize Fiddler client
    client = FiddlerClient(
        api_key=os.environ["FIDDLER_API_KEY"],
        application_id=os.environ["FIDDLER_APPLICATION_ID"],
        url=os.environ["FIDDLER_URL"],
    )

    # Enable automatic instrumentation
    GoogleADKInstrumentor(client).instrument()
    ```

    That's it. All ADK agents created after this point are automatically traced.
  </Step>

  <Step title="Create and Run Your Agent">
    Create an ADK agent with tools and run it:

    ```python theme={null}
    import asyncio
    from google.adk.agents.llm_agent import Agent
    from google.adk.runners import Runner
    from google.adk.sessions import InMemorySessionService
    from google.genai import types


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


    # Create agent
    agent = Agent(
        model="gemini-2.5-flash",
        name="weather_agent",
        description="A helpful weather assistant",
        instruction="You help users check the weather. Be brief.",
        tools=[get_weather],
    )


    async def main():
        session_service = InMemorySessionService()
        runner = Runner(
            agent=agent, app_name="demo", session_service=session_service
        )
        session = await session_service.create_session(
            app_name="demo", user_id="user1"
        )

        # Send a message
        message = types.Content(
            role="user",
            parts=[types.Part(text="What's the weather in San Francisco?")],
        )

        async for event in runner.run_async(
            user_id="user1", session_id=session.id, new_message=message
        ):
            if hasattr(event, "content") and event.content:
                parts = getattr(event.content, "parts", []) or []
                text = "".join(
                    p.text for p in parts if getattr(p, "text", None)
                )
                if text:
                    print(f"Agent: {text}")

        # Flush traces before exit
        client.force_flush(timeout_millis=5000)


    asyncio.run(main())
    ```
  </Step>

  <Step title="Verify Monitoring in Fiddler">
    After running your agent:

    1. Navigate to your Fiddler instance
    2. Open the **GenAI Applications** page
    3. Click on your application (`google-adk-monitoring`)
    4. Open the **Trace Explorer**

    You should see a trace tree with:

    * **Agent** span (`invoke_agent`) - the agent execution
    * **LLM** span (`call_llm`) - the Gemini API call with input/output
    * **Tool** span (`execute_tool get_weather`) - the tool call with arguments and response

    Each LLM span shows the user's question, the model's response, system instructions, and token usage.
  </Step>
</Steps>

## Troubleshooting

### No Traces Appearing

* Verify `client.force_flush()` is called before the process exits
* Check for 401 errors in logs (wrong API key)
* Ensure the Application UUID matches an existing GenAI Application

### Gemini API Errors

* Verify `GOOGLE_API_KEY` or Vertex AI credentials are set
* For Vertex AI, ensure `gcloud auth application-default login` has been run

## Configuration Options

### Supported Models

Any Gemini model supported by Google ADK:

* `gemini-2.5-flash`, `gemini-2.5-pro`
* `gemini-2.0-flash`
* `gemini-1.5-flash`, `gemini-1.5-pro`

### Supported ADK Versions

* `google-adk >= 1.34.2` (both 1.x and 2.x lines)
* `opentelemetry-api >= 1.37.0`

## Next Steps

* [**Google ADK Integration Guide**](/integrations/agentic-ai/google-adk-sdk) - Full integration documentation
* [**Fiddler Evals SDK**](/integrations/agentic-ai/evals-sdk) - Evaluate agent quality
* [**Google ADK SDK Reference**](/sdk-api/adk/google-adk-instrumentor) - API documentation
