Skip to main content

OpenTelemetry Google Generative AI instrumentation

Project description

OpenTelemetry Google Generative AI Instrumentation

This library allows tracing Google Gemini prompts and completions sent with the official Google Generative AI library.

Installation

pip install opentelemetry-instrumentation-google-generativeai

Example usage

from opentelemetry.instrumentation.google-generativeai import GoogleGenerativeAiInstrumentor

GoogleGenerativeAiInstrumentor().instrument()

Privacy

By default, this instrumentation logs prompts, completions, and embeddings to span attributes. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs.

However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also simply want to reduce the size of your traces.

To disable logging, set the TRACELOOP_TRACE_CONTENT environment variable to false.

TRACELOOP_TRACE_CONTENT=false

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file opentelemetry_instrumentation_google_generativeai-0.25.4.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.4.tar.gz
Algorithm Hash digest
SHA256 dfd0666516042927d376cb4ce92645878adbc8479dfd3e110e376c62d297e1e3
MD5 5eac54f3367b769f265b3e098b85672a
BLAKE2b-256 375a6006d8cece391b53fae5de6d053c2010e4cbcc7ecaf34b1529659270d170

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_google_generativeai-0.25.4-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c20affeef08225d7177f8a95862caf1573f575dcf774563bd47868313338d22
MD5 7ed06bde9cccad53e29242751874dedb
BLAKE2b-256 767481dd5d655ad4298e2ff4487909adaca8f06d2f4046002674395b1d08ab4f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page