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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.3.tar.gz
Algorithm Hash digest
SHA256 a91ad2c450c2719a3973e93af1d1ebe752d73855b583b7f147f694adb00f9297
MD5 67803751132c970266fb90d802af8780
BLAKE2b-256 36d9ae469bc8ab4a2a259e0390b79c73830fc47bd478e396d099874ab7634c97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.3-py3-none-any.whl
Algorithm Hash digest
SHA256 911b52e488fdbdaceb45771495d54eee286bcd05de270ec0f0ae5112a53fe985
MD5 b4b931ad55c12b77255615c3dfdcfdab
BLAKE2b-256 dbb4ee108d718b307887c0770b84b4aaba8aa2438b5932bbd89356a06bed5a4e

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