Skip to main content

Google Gen AI OpenTelemetry Integration

Overview

This integration provides support for using OpenTelemetry with the Google Gen AI framework. It enables tracing and monitoring of applications built with Google Gen AI.

Installation

  1. Install traceAI Google Gen AI
pip install traceAI-google-genai

Set Environment Variables

Set up your environment variables to authenticate with FutureAGI

import os

os.environ["FI_API_KEY"] = FI_API_KEY
os.environ["FI_SECRET_KEY"] = FI_SECRET_KEY

Quickstart

Register Tracer Provider

Set up the trace provider to establish the observability pipeline. The trace provider:

from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType

trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="google_genai_project"
)

Configure Google Gen AI Instrumentation

Instrument the Google Gen AI client to enable telemetry collection. This step ensures that all interactions with the Google Gen AI SDK are tracked and monitored.

from traceai_google_genai import GoogleGenAIInstrumentor

GoogleGenAIInstrumentor().instrument(tracer_provider=trace_provider)

Make a request

Set up your Google Gen AI client with built-in observability.

from google import genai
from google.genai import types

client = genai.Client(vertexai=True, project="your_project_name", location="global")

content = types.Content(
    role="user",
    parts=[
        types.Part.from_text(text="Hello how are you?"),
    ],
)
response = client.models.generate_content(
    model="gemini-2.0-flash-001", contents=content
)

print(response)

Metadata

Release files for traceAI-google-genai 0.1.3

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

Source distribution (sdist)

Source distribution for traceAI-google-genai 0.1.3
File Size Uploaded Provenance Actions
traceai_google_genai-0.1.3.tar.gz 14.6 kB With provenance Details for traceai_google_genai-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-google-genai 0.1.3
File Interpreter ABI Platform Actions
traceai_google_genai-0.1.3-py3-none-any.whl Python 3 none any Details for traceai_google_genai-0.1.3-py3-none-any.whl

Total release size: 32.8 kB

Release files / traceai_google_genai-0.1.3.tar.gz

Download URL traceai_google_genai-0.1.3.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
edea3b0a5de0b4b008cf5bf2fdf8ade2d2498e8b18936416a5a62a3705f166f9
BLAKE2b-256 checksum
How to use checksums
0bc8204ee7eccfccb62b1d12e6dc3c6f722dce2d82e50c3ce5fcae54e719e483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Release files / traceai_google_genai-0.1.3-py3-none-any.whl

Download URL traceai_google_genai-0.1.3-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
731c1ff1c5cd654eeed64cacebfb0391af90c012fd52aed501ef989e9a268099
BLAKE2b-256 checksum
How to use checksums
fdd44925967466377855fb827350c1f372e00a1df65e096da4414552b97a884b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 31, 2026.

Transparency log

Security for traceAI-google-genai 0.1.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for traceai_google_genai-0.1.3.tar.gz

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 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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