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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.31.1.tar.gz
Algorithm Hash digest
SHA256 ebc990ca929d46f58fde3b74d1ee5995a173f8a675b709bf076b7de78c54e770
MD5 b1eb4a567556bfe7ae5aa28992fcba4e
BLAKE2b-256 dec7c926a22e7f9571a1ec40a6881dfa2a9c4c98f7c34f1bb7f01bf16d60df19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.31.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ab9e5b6e29c3773bcde1b64fa5f6abcee29cd95a2cca2ed454e07e1a3ff5ded
MD5 22c59162d5bbdf79b8ba7b1c1ad5c1e0
BLAKE2b-256 dc6fa9ce7aab21b10880185d5f6c8eccca62c17afd071021db7b49dab2479513

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