OpenInference Google VertexAI Instrumentation
Python auto-instrumentation library for VertexAI SDK and the Google Cloud AI Platform. 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-vertexai
Quickstart
Install openinference-instrumentation-vertexai and arize-phoenix.
pip install -U \
openinference-instrumentation-vertexai \
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.
python -m phoenix.server.main serve
Instrumenting vertexai is simple.
from openinference.instrumentation.vertexai import VertexAIInstrumentor
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)))
VertexAIInstrumentor().instrument(tracer_provider=tracer_provider)
Now, all calls by generative_models are instrumented and can be viewed in the phoenix UI.
import vertexai
from vertexai.generative_models import GenerativeModel
vertexai.init(location="us-central1")
model = GenerativeModel("gemini-1.5-flash")
print(model.generate_content("Why is sky blue?"))
More Info
Metadata
Release files for openinference-instrumentation-vertexai 0.1.28
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_vertexai-0.1.28.tar.gz | 23.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openinference_instrumentation_vertexai-0.1.28-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.5 kB
Release files / openinference_instrumentation_vertexai-0.1.28.tar.gz
| Download URL | openinference_instrumentation_vertexai-0.1.28.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5dcc64ea954d9d7e05168dbbd4bea2f9c92cd4f62ff04164a3812d760e50b8f
|
|
BLAKE2b-256 checksum How to use checksums |
64706d0fb41c92baf0eb510ad13125557f6c66214768678d41615dcd098d96c7
|
| 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 logRelease files / openinference_instrumentation_vertexai-0.1.28-py3-none-any.whl
| Download URL | openinference_instrumentation_vertexai-0.1.28-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b90e1e5dc044e43a2d45da65f7a4ee835c6d2581815fdaf3ba1f7cd9f01e6da
|
|
BLAKE2b-256 checksum How to use checksums |
805346eb08c7273b1521b8899b41b1a5c10713fed61c75f082c2990ca0d792c5
|
| 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