Skip to main content
Google ADK creates OpenTelemetry spans. The OpenInference Java agent enriches those spans and sends them to Phoenix without changes to your agent code.

Prerequisites

Install

Add the ADK, OpenTelemetry, and OpenInference agent dependencies to your Gradle application:
The all classifier is the shaded Java agent jar. The harness attaches it to the Gradle run task.

Setup

Register OpenTelemetry before the first ADK call. ADK captures the global OpenTelemetry instance when its telemetry class loads.

Run Google ADK

Set GOOGLE_API_KEY to authenticate requests. The example uses a tool call so Phoenix receives both agent and LLM spans.

Observe

Open the unique project created by the example in Phoenix. The Java agent decorates ADK’s OpenTelemetry spans with OpenInference span kinds, model names, prompts, responses, tool schemas, and token counts.

Resources