skillfed

openinference-instrumentation-google-genai

OpenInference Google GenAI Instrumentation

openinference-instrumentation-google-genai v1.4.0 652.7K downloads/30d#5,543 on PyPI1,147
Permissive license Apache-2.0 Active released

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-genai

uv

uv add openinference-instrumentation-google-genai

poetry

poetry add openinference-instrumentation-google-genai

Installing 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

Development Status :: 5 - Production/StableIntended 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

Tags

opentelemetry instrumentation genaigoogle genai tracingllm observability tracesgenai sdk monitoringopeninference googleai model call tracinggenai debugging
observabilitygenai-instrumentationopentelemetry

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

openinference-instrumentation-crewai

Automatically instruments CrewAI agent…

permissive · top 15,000 on PyPI

openinference-instrumentation-dspy

Auto-instruments DSPy applications to generate…

permissive · top 15,000 on PyPI

openinference-instrumentation-litellm

Auto-instruments LiteLLM function calls…

permissive · top 15,000 on PyPI

openinference-instrumentation-openai

Auto-instruments OpenAI Python SDK calls to…

permissive · top 5,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-langchain

Auto-instruments LangChain applications to…

permissive · top 5,000 on PyPI

openinference-instrumentation-pydantic-ai

Auto-instruments PydanticAI agents to emit…

permissive · top 15,000 on PyPI

openinference-instrumentation-claude-agent-sdk

Auto-instruments Claude Agent SDK calls to emit…

permissive · top 15,000 on PyPI

openinference-instrumentation-haystack

Auto-instruments Haystack LLM pipelines and…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-adk

Auto-instruments Google ADK applications to…

permissive · top 15,000 on PyPI

Further reading