--- id: openinference-instrumentation-google-genai version: "1.4.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openinference-instrumentation-google-genai — OpenInference Google GenAI Instrumentation License: permissive · Maintenance: active · Downloads: 652.7K/mo ## 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 above — 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 pip install openinference-instrumentation-google-genai uv add openinference-instrumentation-google-genai 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_current - Install friction: low - Maintenance: active - Downloads: 652.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry instrumentation genai, google genai tracing, llm observability traces, genai sdk monitoring, openinference google, ai model call tracing, genai debugging, observability, genai-instrumentation, opentelemetry [View on SkillFed](https://skillfed.io/packages/openinference-instrumentation-google-genai) · [View on PyPI](https://pypi.org/project/openinference-instrumentation-google-genai/)