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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.7.tar.gz
Algorithm Hash digest
SHA256 215ed39f0256bc7d54bbdd0206e0852d3a166b5fc9cce6fb7f4cfbbd7e75ddda
MD5 dbef85b91d56f63d3abd74b6f7ecc3e1
BLAKE2b-256 a86a9ae3919b4eab36faa370e7cff28742a7feeca6d0a1bdcbccd5b0ed8d722e

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_google_generativeai-0.33.7.tar.gz:

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c664dd8649bc3ec3f490ba06247644474e4274e33c73ebe9bae9a3227616cb2f
MD5 02a3cca5c0cd8d34ace15cc3329312d1
BLAKE2b-256 30041b63a0a4f8cfdaa0cd20dbeb9369e73cd568f7e298ceb3457bebb864f17f

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_google_generativeai-0.33.7-py3-none-any.whl:

Publisher: release.yml on traceloop/openllmetry

Attestations:

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