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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.5.tar.gz
Algorithm Hash digest
SHA256 43fa10035c20e1bd11a8bf84ddf08fa140905b7d06502c36a72efdece5836b09
MD5 a8f39ca1faa3798beaa73b2b86dae662
BLAKE2b-256 efcd56c0a6a97985cfd648d34598a828dd8b61e37ab100551deead14eacf2aef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_google_generativeai-0.25.5-py3-none-any.whl
Algorithm Hash digest
SHA256 13842c855f8a120f6feb865fb52f648260ede1711b285ca1d4d7fc0f8a44fdf3
MD5 e3f222a2094662ebe475a2199ff0eaf3
BLAKE2b-256 ff73c55845e2df825c4e237698572b92a5182219681f82cbc962ec40b0816c91

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