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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.2.tar.gz
Algorithm Hash digest
SHA256 fa53663419ac666b6710111d42c4cfc0893d5c6b3f9e7ce077acd4060ca71752
MD5 fe786248d655f35081956feea3aca771
BLAKE2b-256 0bb6e8df5f123e3b35aae0667e8ffe9d74b4087376a38d25aaa3e135a6681aee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c9d1daeea85263f7b8d9b257582103a33a75c009e15755eb712a413edf78afd
MD5 a23f95adbceb2702cd84d4f9747c3169
BLAKE2b-256 0cc9565154e67ce4e3ff7c2ccd062e21a69899a77eb0c8b53e75c49cdd9f519a

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