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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.9.tar.gz
Algorithm Hash digest
SHA256 2ee334304985196e6c261951629e77cea5c922fe33da0423fbf11df91e920a40
MD5 aa37a105cb300f0e087c494c9cf9fd0c
BLAKE2b-256 e3ade3b0dd0b372981c56de363abe2b377c5ff3c66c862ededc6b472acabbd15

See more details on using hashes here.

Provenance

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

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.33.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cbd53fc6998013a03458f0df65b9b90b8216a94e04e4783f5d7285d30d6d3bb9
MD5 607c65a8e1c6450aa067c399d3b8e9b0
BLAKE2b-256 4382446b6b7c5fc0d489e2fa23682355e76c2c9a7fae4b57e9f587796c40f727

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_google_generativeai-0.33.9-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