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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.22.0.tar.gz
Algorithm Hash digest
SHA256 380250da20f8d8dbee3ea8866f7eeb0f573f038a505fa67238698064945808cb
MD5 6bd1f39e3d36d4396ad52d64e5c77020
BLAKE2b-256 a3cd1bf77cf5bf0a56404a9c561da28b982341d3d8037f1fc322e8346083d444

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e025666823cfad4976ccdbc19c39cbf26f393d7f6afd5cadc1175e7f8a00e19f
MD5 7126076d2db0658bf5bef4f94cb465e0
BLAKE2b-256 f7475b1c9f5d677b1b89c606e8736691d4ecf37439c1215c44b0cfdbaa8ce7db

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