OpenInference Google GenAI Instrumentation
Python auto-instrumentation library for GenAI SDK. Traces are fully OpenTelemetry compatible and can be sent to any OpenTelemetry collector for viewing, such as Arize Phoenix or Arize AX.
Installation
pip install -Uqqq openinference-instrumentation-google-genai
Quickstart
Install openinference-instrumentation-google-genai and arize-phoenix.
pip install -U \
openinference-instrumentation-google-genai \
arize-phoenix \
opentelemetry-sdk \
opentelemetry-exporter-otlp \
"opentelemetry-proto>=1.12.0"
Start the phoenix server so that it is ready to receive traces.
The phoenix server runs entirely on your machine and does not send data over the internet.
phoenix serve
Instrumenting genai is simple.
from openinference.instrumentation.google_genai import GoogleGenAIInstrumentor
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
endpoint = "http://127.0.0.1:4317"
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
GoogleGenAIInstrumentor().instrument(tracer_provider=tracer_provider)
Now, all calls by generate_content are instrumented and can be viewed in the phoenix UI.
Progress
This instrumentation is a work in progress
- parse messages and invocation
- capture tool definitions
More Info
Metadata
Release files for openinference-instrumentation-google-genai 1.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openinference_instrumentation_google_genai-1.4.8.tar.gz | 155.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openinference_instrumentation_google_genai-1.4.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 194.0 kB
Release files / openinference_instrumentation_google_genai-1.4.8.tar.gz
| Download URL | openinference_instrumentation_google_genai-1.4.8.tar.gz |
|---|---|
| Size | 155.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4d9854173fb3848dfece5455267be8901da3cc41e0d1805621feab01b74de2d
|
|
BLAKE2b-256 checksum How to use checksums |
7d85a718d57ee5f0d06b860733338df6126e56a69b17e22ea5f0ccf899811d68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / openinference_instrumentation_google_genai-1.4.8-py3-none-any.whl
| Download URL | openinference_instrumentation_google_genai-1.4.8-py3-none-any.whl |
|---|---|
| Size | 38.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c855392c293c4f8a6aa3e02e1c4522e3c996e660e1d9835526969291297f16fe
|
|
BLAKE2b-256 checksum How to use checksums |
efdc0c380b9e63c586d57f0a124d04fa8273d53e0b6d642ae1404c3bef0dcccc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log