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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.26.5.tar.gz
Algorithm Hash digest
SHA256 f1e069e0fd516c7a9c1c2e454f07d677aed460fe12b0ec80c04ceb1667cda000
MD5 7f41e1aef4444d0c529b874799534086
BLAKE2b-256 96abc65f56f5f0fd1f630143ebd68a08f473fd2e1c733c040749c29973f88378

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.26.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1feb5a2a71ba5e3434dc7efd548cd2f1a96bde11380d88201f6fc17af05db3aa
MD5 9789118dd62b2dcf035b409ce08ddb1c
BLAKE2b-256 ddbfb675851f155d6f2c2f8fcb75c02a8e567524e9659665b01caf62c3bf7c5f

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