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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.4.tar.gz
Algorithm Hash digest
SHA256 9498f0a8ce657ee3d30b14c941fe146f406e444127982a904e57831ffd5d1a0f
MD5 54896be9eb90317f8eb90e4d32cda0b8
BLAKE2b-256 b6a6d7e5226856d5575b5133efa47a6158cc873a947ae14d4b3f346cff767a4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.4-py3-none-any.whl
Algorithm Hash digest
SHA256 360dd742b7060796664f28c0a5ab4fd022dac24a7846b70d25d6328bd947f511
MD5 b9875770d7c306a25c6d4f41831dd19f
BLAKE2b-256 5d9c5652d08f416880af545125ae41201a6203d6ddc55751b8b271269d40f38e

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