openinference-instrumentation-google-genai
OpenInference Google GenAI Instrumentation
What it is and what it does
This package wraps Google GenAI SDK calls to emit structured traces compatible with OpenTelemetry, enabling you to observe and debug generative AI workloads. It hooks into the SDK's generate_content method and captures invocation details and message parsing, sending them to any OpenTelemetry collector—such as Arize Phoenix or Arize AX—for visualization and analysis.
The instrumentation is designed to integrate seamlessly into existing OpenTelemetry pipelines. You configure a TracerProvider with a span exporter, call the GoogleGenAIInstrumentor's instrument method, and all subsequent GenAI calls are automatically traced. The package is marked Production/Stable and actively maintained, though tool definition capture remains a work-in-progress feature.
Use it for:
- Monitor and debug individual GenAI API calls in production applications to understand latency and failure modes.
- Collect structured traces of multi-turn conversations to analyze model behavior and response quality.
- Integrate GenAI observability into existing OpenTelemetry-based monitoring stacks without custom instrumentation.
- Track session metadata and custom spans across GenAI calls for end-to-end request tracing.
- Audit GenAI usage patterns and costs by analyzing invocation traces in a centralized collector.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automatically instruments Google GenAI SDK calls to emit OpenTelemetry-compatible traces for observability and debugging.
Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a concrete observability gap for Google GenAI users. It integrates cleanly into standard OpenTelemetry pipelines and is marked Production/Stable. The incomplete tool definition capture is a minor limitation unlikely to block most use cases.
Install
openinference-instrumentation-google-genai on PyPI
pip
pip install openinference-instrumentation-google-genaiuv
uv add openinference-instrumentation-google-genaipoetry
poetry add openinference-instrumentation-google-genaiInstalling openinference-instrumentation-google-genai
Before you install
Low friction install with a pure-Python wheel and six straightforward dependencies. The package is actively maintained with a release within the last week and marked Production/Stable.
License in practice
Apache-2.0 permissive license allows use in commercial and private projects with minimal restrictions; attribution required.
Quickstart
pip install openinference-instrumentation-google-genai
from openinference.instrumentation.google_genai import GoogleGenAIInstrumentor
from opentelemetry.sdk.trace import TracerProvider
tracer_provider = TracerProvider()
GoogleGenAIInstrumentor().instrument(tracer_provider=tracer_provider)
Requires Python 3.10 or later; OpenTelemetry SDK and exporter packages needed for full tracing pipeline.
Verify before relying
- Whether tool definition capture (marked incomplete in progress) affects production readiness for your use case.
- Performance overhead of instrumentation on high-volume GenAI calls.
- Compatibility with specific Google GenAI SDK versions beyond the stated Python version support.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 652,673/month — #5,543 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openinference_instrumentation_google_genai-1.4.0-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
openinference-instrumentation-crewaiAutomatically instruments CrewAI agent…
permissive · top 15,000 on PyPI
openinference-instrumentation-dspyAuto-instruments DSPy applications to generate…
permissive · top 15,000 on PyPI
openinference-instrumentation-litellmAuto-instruments LiteLLM function calls…
permissive · top 15,000 on PyPI
openinference-instrumentation-openaiAuto-instruments OpenAI Python SDK calls to…
permissive · top 5,000 on PyPI
openinference-instrumentation-agnoAuto-instruments Agno Agent applications to…
permissive · top 15,000 on PyPI
openinference-instrumentation-langchainAuto-instruments LangChain applications to…
permissive · top 5,000 on PyPI
openinference-instrumentation-pydantic-aiAuto-instruments PydanticAI agents to emit…
permissive · top 15,000 on PyPI
openinference-instrumentation-claude-agent-sdkAuto-instruments Claude Agent SDK calls to emit…
permissive · top 15,000 on PyPI
openinference-instrumentation-haystackAuto-instruments Haystack LLM pipelines and…
permissive · top 15,000 on PyPI
openinference-instrumentation-google-adkAuto-instruments Google ADK applications to…
permissive · top 15,000 on PyPI