Registry / observability / openinference-instrumentation-vertexai

openinference-instrumentation-vertexai

JSON →
library0.1.16pypypi✓ verified 79d ago

OpenInference instrumentation for Google Vertex AI model calls, enabling tracing and observability via OpenTelemetry. Version 0.1.13 supports Python 3.10-3.13. Actively maintained.

pip install openinference-instrumentation-vertexai
INSTALL
IMPORT
SIG · OPENINFERENCE-INST
O
openinference-instrumentation-vertexai
observabilitypythonv0.1.16
Install
2.8s avg
Import
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.8s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VertexAIInstrumentor
from openinference.instrumentation.vertexai import VertexAIInstrumentor
from openinference_instrumentation_vertexai import VertexAIInstrumentor

Initialize OpenTelemetry tracing, instrument Vertex AI with VertexAIInstrumentor, then use Vertex AI normally.

from openinference_instrumentation_vertexai import VertexAIInstrumentor from opentelemetry import trace from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import SimpleSpanProcessor import vertexai import os # Set up OpenTelemetry tracing provider = TracerProvider() exporter = OTLPSpanExporter(endpoint=os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', '')) provider.add_span_processor(SimpleSpanProcessor(exporter)) trace.set_tracer_provider(provider) # Instrument Vertex AI VertexAIInstrumentor().instrument() # Now use Vertex AI normally vertexai.init(project=os.environ.get('GOOGLE_CLOUD_PROJECT', ''), location='us-central1')
Debug
Known issues
gotchaInstrumentation must be done before any Vertex AI client calls (e.g., before vertexai.init).
fix
Call VertexAIInstrumentor().instrument() before vertexai.init(...).
affects: all
gotchaThis instrumentation only captures synchronous calls; async Vertex AI methods (e.g., with asyncio) may not be traced.
fix
For async support, consider using the underlying gRPC instrumentation or waiting for future releases.
affects: <=0.1.13
Upgrade
Version history
0.1.16latest on PyPI · released May 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
4
Resources
openinference-instrumentation-vertexai — pip install openinference-instrumentation-vertexai · libregistry