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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.1.tar.gz
Algorithm Hash digest
SHA256 615a16ddc10d25d624eff8707a8abf002dee6c13297055e2016e61e1bb2e781c
MD5 dc2a3a4e3cd3e66a96aae1c95f82203c
BLAKE2b-256 5d3b3fde0622130241e87c823bc7c2d56a2a8827cac97cd1c13378166be9beb7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2580cdef1e860a7cbca6a2cd93fab1c6cf2fdada87b30d6674d5e9aa32d4544
MD5 d007a893c816e9d1a22ee2fbe16954d2
BLAKE2b-256 1be20cc7ea6eee84d0b937c1f2b21bd8258fd29a9abb9b9905912afd5420a09e

See more details on using hashes here.

Provenance

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