Skip to main content

OpenTelemetry instrumentation for Google ADK (Agent Development Kit)

Project description

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 invocation span with input/output values, user ID, and session ID
  • BaseAgent.run_async — creates an agent_run span 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otel_instrumentation_google_adk-0.2.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otel_instrumentation_google_adk-0.2.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file otel_instrumentation_google_adk-0.2.2.tar.gz.

File metadata

  • Download URL: otel_instrumentation_google_adk-0.2.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for otel_instrumentation_google_adk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0bea9e9bef5f7e153d971bc660fef2ade67ad76c86f8335389328119432a5933
MD5 1d12357c25e3081facc825f810f1d35f
BLAKE2b-256 23227471ebfbea8fdcee065890b60ee335add4163ed78b7ff6a0b5f851f3c4fb

See more details on using hashes here.

File details

Details for the file otel_instrumentation_google_adk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: otel_instrumentation_google_adk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for otel_instrumentation_google_adk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eddc114c2a687e3ba7b39f7a779fdaa905796964f492b3b3f20227c381b62175
MD5 46872644a3d45375e4a2a594d562f3a8
BLAKE2b-256 1a0d5cf0e19bf783d83d7996b96801ae12a08f49fab71c51bbcf1b13b2e45ff6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page