Skip to main content
LangSmith supports tracing Google Agent Development Kit (ADK) applications through the OpenTelemetry integration. This guide shows you how to automatically capture traces from your Google ADK agents and send them to LangSmith for monitoring and analysis.

Installation

Install the required packages using your preferred package manager:
Requires LangSmith Python SDK version langsmith>=0.4.26 for optimal OpenTelemetry support.

Setup

1. Configure environment variables

Set your LangSmith API key and project name:

2. Configure OpenTelemetry integration

In your Google ADK application, import and configure the LangSmith OpenTelemetry integration. This will automatically instrument Google ADK spans for OpenTelemetry.
Alternatively, you can use the Openinference GoogleADKInstrumentor:
You do not need to set any OpenTelemetry environment variables or configure exporters manually—configure() handles everything automatically.

3. Create and run your ADK agent

Once configured, your Google ADK application will automatically send traces to LangSmith: This example includes a minimal app that sets up an agent, session, and runner, then sends a message and streams events.

View traces in LangSmith

  • Agent conversations: Complete conversation flows between users and your ADK agents.
  • Tool calls: Individual function calls made by your agents.
  • Model interactions: LLM requests and responses using Gemini models.
  • Session information: User and session context for organizing related traces.
  • Model interactions: LLM requests and responses using Gemini models
LangSmith dashboard with raw input from run and trace information.

Advanced usage

Custom metadata and tags

You can add custom metadata to your traces by setting span attributes in your ADK application:

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.