opentelemetry-instrumentation-google-genai
OpenTelemetry
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you are already using OpenTelemetry in your application and need observability into Google GenAI SDK calls. The low install friction and permissive license make it a straightforward addition. However, be aware it is experimental with known blockers to stability—review TODOS.md before production use and expect potential API or behavior changes in future releases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; assumes OpenTelemetry tracing, logging, and metrics are already configured in your application.
- Low friction install with five runtime dependencies, all from the OpenTelemetry ecosystem.
- Active maintenance as of 2026-08-14 with recent release history; however, marked experimental with known defects listed in TODOS.md that are blockers to stability.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production environments.
last release 2026-07-13 (32 days) · last repo commit 2026-08-14 · 28 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,678,224 downloads/mo, #3,661 on PyPI
Alternatives
Verify before relying
pip install opentelemetry-instrumentation-google-genai
from opentelemetry.instrumentation.google_genai import GoogleGenAiSdkInstrumentor
from google.genai import Client
GoogleGenAiSdkInstrumentor().instrument()
client = Client()
response = client.models.generate_content(
model="gemini-1.5-flash-002",
contents="Write a short poem on OpenTelemetry."
)- Completeness of instrumentation coverage for all Google GenAI SDK operations beyond generate_content, embed_content, and interactions.create.
- Behavior and correctness of automatic function calling span nesting under generate_content spans.
- Performance impact of instrumentation on GenAI SDK operations at scale.
What it is and what it does
This package wraps the Google GenAI SDK with OpenTelemetry instrumentation to automatically capture observability data from GenAI operations. It emits trace spans for calls like generate_content and embed_content, records prompts and responses as events/logs, and aggregates metrics describing GenAI activity—all following OpenTelemetry's GenAI semantic conventions. The instrumentation works by patching the SDK's client methods, so once you call instrument() it traces all subsequent GenAI operations without requiring changes to your application code.
The package is still experimental and has known defects documented in TODOS.md that block full stability. It supports Python 3.10 through 3.14 and integrates with the standard OpenTelemetry ecosystem (opentelemetry-api, opentelemetry-instrumentation, and related packages). You can optionally capture message content and GenerateContentConfig parameters via environment variables, and uninstrument clients when needed.
Use it for
- Monitor GenAI API calls in production by emitting traces to your OpenTelemetry backend (e.g., Jaeger, Datadog, New Relic).
- Debug GenAI application behavior by capturing prompts, responses, and tool calls as span events and logs.
- Aggregate metrics on GenAI usage (request counts, latencies, token consumption) for cost and performance analysis.
- Correlate GenAI operations with other application traces to understand end-to-end request flow.
- Audit GenAI interactions by recording message content and configuration parameters when enabled.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you are already using OpenTelemetry in your application and need observability into Google GenAI SDK calls. The low install friction and permissive license make it a straightforward addition. However, be aware it is experimental with known blockers to stability—review TODOS.md before production use and expect potential API or behavior changes in future releases.
Install
opentelemetry-instrumentation-google-genai on PyPI
Before you install
Low friction install with five runtime dependencies, all from the OpenTelemetry ecosystem. Active maintenance as of 2026-08-14 with recent release history; however, marked experimental with known defects listed in TODOS.md that are blockers to stability.
Requires Python 3.10 or later; assumes OpenTelemetry tracing, logging, and metrics are already configured in your application.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production environments.
Quickstart
pip install opentelemetry-instrumentation-google-genai
from opentelemetry.instrumentation.google_genai import GoogleGenAiSdkInstrumentor
from google.genai import Client
GoogleGenAiSdkInstrumentor().instrument()
client = Client()
response = client.models.generate_content(
model="gemini-1.5-flash-002",
contents="Write a short poem on OpenTelemetry."
)
Verify before relying
- Completeness of instrumentation coverage for all Google GenAI SDK operations beyond generate_content, embed_content, and interactions.create.
- Behavior and correctness of automatic function calling span nesting under generate_content spans.
- Performance impact of instrumentation on GenAI SDK operations at scale.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesopentelemetry-apiopentelemetry-instrumentationopentelemetry-semantic-conventionsopentelemetry-util-genaiwrapt |
| Maintenance | Actively maintained 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,678,224 / month, #3,661 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: opentelemetry_instrumentation_google_genai-1.0b1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “opentelemetry google genai instrumentation”
- opentelemetry-instrumentation-google-genaiAdds OpenTelemetry instrumentation to the Google GenAI SDK,…
- openinference-instrumentation-google-genaiAutomatically instruments Google GenAI SDK calls to emit…
- opentelemetry-util-genaiProvides standardized instrumentation utilities for generative AI…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also opentelemetry-instrumentation-openai-v2 · opentelemetry-util-genai · opentelemetry-semantic-conventions-ai · loongsuite-util-genai · openinference-instrumentation-google-genai · opentelemetry-instrumentation-voyageai · opentelemetry-instrumentation-groq · google-genai · opentelemetry-instrumentation-aiokafka · newrelic-telemetry-sdk