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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.29.1.tar.gz
Algorithm Hash digest
SHA256 413afb6e9c53d29c54935ecc3f6447223371e9b058f97c60a6b556d8eb446cdb
MD5 4605b7415acf1789f69ca29829ab28dc
BLAKE2b-256 9b561ae62300de3454d293b4728e54b6ead963e347bf9c5866726687edaa9e95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.29.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aad74c9aef1d1a9e37c719a5bd0df751f9a5cf755c5943781c0ab5850c97379
MD5 eee2cab32eace0fb7acccf1aee7bb5fc
BLAKE2b-256 dbf8e90a46ef7bc756b5857855c48c7fb9419a98eda8b4afc69cd236f95357e5

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