Skip to main content

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.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openinference-instrumentation-google-genai 1.4.11
File Size Uploaded
openinference_instrumentation_google_genai-1.4.11.tar.gz 156.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openinference-instrumentation-google-genai 1.4.11
File Interpreter ABI Platform
openinference_instrumentation_google_genai-1.4.11-py3-none-any.whl Python 3 none any Details

Total release size: 195.6 kB

Release files / openinference_instrumentation_google_genai-1.4.11.tar.gz

Download URL openinference_instrumentation_google_genai-1.4.11.tar.gz
Size 156.6 kB
Tags Source
SHA-256 checksum
How to use checksums
09695e40ee9fc367773423d2f694e3e8c419f865d5c24f9194f5ac68fcdac27e
BLAKE2b-256 checksum
How to use checksums
27c9f39f39f9d6ba22139c24949aa3b455941b4f6ac6794fed0dd3b55cbf93d3
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 Oct 7, 2026.

Transparency log

Release files / openinference_instrumentation_google_genai-1.4.11-py3-none-any.whl

Download URL openinference_instrumentation_google_genai-1.4.11-py3-none-any.whl
Size 38.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92b08acc20af3ac4a3767fc0de655f80dfe34ffe3f1989af2480cd74c98c362e
BLAKE2b-256 checksum
How to use checksums
47031a63f28953a7bdf8567528f9d9c616af771de5324eb7c4abf9214240499b
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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.13

2 release files

This release

1.4.11 This release

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page