otel-instrumentation-google-adk
OpenTelemetry instrumentation for Google ADK (Agent Development Kit).
This instrumentor patches the Google ADK runner, agent, LLM, and tool layers to produce spans that follow the OpenTelemetry GenAI semantic conventions (gen_ai.* attributes). It is designed to work inside Google Agent Engine (GAE) where other telemetry libraries may be stripped.
Installation
pip install otel-instrumentation-google-adk
Usage
from otel_instrumentation_google_adk import GoogleADKInstrumentor
GoogleADKInstrumentor().instrument(tracer_provider=tracer_provider)
What gets instrumented
- Runner.run_async — creates an
invocationspan with input/output values, user ID, and session ID - BaseAgent.run_async — creates an
agent_runspan per agent with agent name and output - LLM calls — enriches spans with model name, input/output messages, token usage, temperature, and tool definitions
- Tool calls — enriches spans with tool name, description, input arguments, and output
Span attributes
Spans follow the OpenTelemetry GenAI semantic conventions:
| Attribute | Description |
|---|---|
gen_ai.operation.name |
invoke_agent, chat, or execute_tool |
gen_ai.system |
gcp.vertex_ai |
gen_ai.request.model |
Model name from the LLM request |
gen_ai.agent.name |
Agent name |
gen_ai.input.messages |
JSON-serialized input messages |
gen_ai.output.messages |
JSON-serialized output messages |
gen_ai.usage.input_tokens |
Input token count |
gen_ai.usage.output_tokens |
Output token count (candidates + thoughts) |
gen_ai.tool.name |
Tool name |
gen_ai.request.tools |
JSON-serialized tool definitions |
License
Apache-2.0
Metadata
Release files for otel-instrumentation-google-adk 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| otel_instrumentation_google_adk-0.2.2.tar.gz | 13.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| otel_instrumentation_google_adk-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / otel_instrumentation_google_adk-0.2.2.tar.gz
| Download URL | otel_instrumentation_google_adk-0.2.2.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bea9e9bef5f7e153d971bc660fef2ade67ad76c86f8335389328119432a5933
|
|
BLAKE2b-256 checksum How to use checksums |
23227471ebfbea8fdcee065890b60ee335add4163ed78b7ff6a0b5f851f3c4fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / otel_instrumentation_google_adk-0.2.2-py3-none-any.whl
| Download URL | otel_instrumentation_google_adk-0.2.2-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eddc114c2a687e3ba7b39f7a779fdaa905796964f492b3b3f20227c381b62175
|
|
BLAKE2b-256 checksum How to use checksums |
1a0d5cf0e19bf783d83d7996b96801ae12a08f49fab71c51bbcf1b13b2e45ff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|