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

  • Java and Gradle
  • A Gemini API key
  • The shaded OpenInference ADK Java agent JAR

Run the example

No uv? pip install arize-phoenix && phoenix serve does the same thing. See Terminal setup for customization.
Phoenix serves its UI and OTLP HTTP on port 6006, and OTLP gRPC on port 4317. For a local instance that’s http://localhost:6006 — leave it running while you work.
The Phoenix example includes the ADK agent, OpenTelemetry configuration, and Gradle launch task. Set the path to your shaded OpenInference agent JAR, then run it:
Open Phoenix and select the google-adk-java project.

Instrument your application

Register a global OpenTelemetry SDK with an OTLP exporter and the openinference.project.name resource attribute. Do this before constructing any ADK object because ADK captures the global OpenTelemetry instance when its telemetry class loads. The following is taken from the example’s WeatherAgent.java:
Launch your application with the shaded agent JAR:
For Phoenix Cloud or an authenticated deployment, follow Connect your app to Phoenix to configure the endpoint and headers.
For short-lived applications, flush and shut down the tracer provider before the process exits.

Resources

Complete Java example

OpenInference ADK Java agent