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.26.1.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.26.1.tar.gz
Algorithm Hash digest
SHA256 556ed88dce6a9d7577c79f430355f852ae6a0a631b2d7ebf0bcb338db55e14d7
MD5 343e4c9c4df55e750e96808cc884d789
BLAKE2b-256 77bf5043c3943a08b1ea86be798e581f23e8721cf6892173895fc4fdb74cf758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 694106e7bd1d8165cc57299fff34518d8c5562ad63cc358cea23358123b08f91
MD5 de357589f985e7d500dbe6643b7aee95
BLAKE2b-256 aa4756507f21c44fd7d6321edfb4ac542a9502371dc97ce6a98f735a1cc82f19

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