openinference

OpenInference Instrumentation for Google ADK Java

A Java agent (-javaagent) that decorates the OpenTelemetry spans created by Google ADK for Java with OpenInference attributes:

Usage

Build or download the fat -all jar and pass it to the JVM. The application must register a global OpenTelemetry SDK before its first ADK call; ADK’s Telemetry class captures GlobalOpenTelemetry when it is loaded.

./gradlew :instrumentation:openinference-instrumentation-adk-java:shadowJar
java -javaagent:openinference-instrumentation-adk-java-<version>-all.jar -cp <classpath> com.example.Main

Tracing can be suppressed with SuppressTracing.begin() and sensitive fields masked through TraceConfig (register an OITracer with OpenInferenceAgent.register(...)), as with the other OpenInference Java instrumentors.

Examples

See java/examples/adk-java-example for a runnable agent with a function tool that exports to a local Phoenix.