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
Release files for opentelemetry-instrumentation-google-generativeai 0.62.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opentelemetry_instrumentation_google_generativeai-0.62.3.tar.gz | 94.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_instrumentation_google_generativeai-0.62.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 109.6 kB
Release files / opentelemetry_instrumentation_google_generativeai-0.62.3.tar.gz
| Download URL | opentelemetry_instrumentation_google_generativeai-0.62.3.tar.gz |
|---|---|
| Size | 94.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
854328b6927ce9f1d20f15e3f4afcc5c961f642ea9f682806fe801346ce10f6a
|
|
BLAKE2b-256 checksum How to use checksums |
c31186a99c7cb143c39e070696554787569d8245d9caeebf4966b0b087c03edc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / opentelemetry_instrumentation_google_generativeai-0.62.3-py3-none-any.whl
| Download URL | opentelemetry_instrumentation_google_generativeai-0.62.3-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
949c65d4b4f5be48b4014dfab64f0e684f269df13cd79ca359a50d785c0edb9f
|
|
BLAKE2b-256 checksum How to use checksums |
06cc8ef23a05c5b5db64536ffa46d40b2a5955a96bef40964b295a3b7da530d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency log