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.1.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.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: otel_instrumentation_google_adk-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1ee5551503911f03d322a71ba0f97202e2dbadd54eaf44a22ab8fe8b3404a3ce
MD5 571b6cd5664c8c29150d536469a089fe
BLAKE2b-256 b8f58a35eea90cf5d49568325d5ae5bca0b895aee85eab89c66625a3ac28425b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: otel_instrumentation_google_adk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc81b96f79910f2a4351cb1567fe54832d8c5561d153b7e410555104647e4928
MD5 ea1af290e4aeb5a659222756b524e88f
BLAKE2b-256 a4ee217373eac99a1e9a7c714686588278a96eddce39b3556039edce96b8d3fa

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