# OpenTelemetry Google Generative AI Instrumentation
<a href="https://pypi.org/project/opentelemetry-instrumentation-google-generativeai/">
<img src="https://badge.fury.io/py/opentelemetry-instrumentation-google-generativeai.svg">
</a>
This library allows tracing Google Gemini prompts and completions sent with the official [Google Generative AI library](https://github.com/google-gemini/generative-ai-python).
## Installation
```bash
pip install opentelemetry-instrumentation-google-generativeai
```
## Example usage
```python
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`.
```bash
TRACELOOP_TRACE_CONTENT=false
```
Raw data
{
"_id": null,
"home_page": null,
"name": "opentelemetry-instrumentation-google-generativeai",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Gal Kleinman",
"author_email": "gal@traceloop.com",
"download_url": "https://files.pythonhosted.org/packages/4e/c7/2124e6bd4647f39fec56aee522294328adf84ebff0777a44901bdeb30048/opentelemetry_instrumentation_google_generativeai-0.44.1.tar.gz",
"platform": null,
"description": "# OpenTelemetry Google Generative AI Instrumentation\n\n<a href=\"https://pypi.org/project/opentelemetry-instrumentation-google-generativeai/\">\n <img src=\"https://badge.fury.io/py/opentelemetry-instrumentation-google-generativeai.svg\">\n</a>\n\nThis library allows tracing Google Gemini prompts and completions sent with the official [Google Generative AI library](https://github.com/google-gemini/generative-ai-python).\n\n## Installation\n\n```bash\npip install opentelemetry-instrumentation-google-generativeai\n```\n\n## Example usage\n\n```python\nfrom opentelemetry.instrumentation.google_generativeai import GoogleGenerativeAiInstrumentor\n\nGoogleGenerativeAiInstrumentor().instrument()\n```\n\n## Privacy\n\n**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.\n\nHowever, 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.\n\nTo disable logging, set the `TRACELOOP_TRACE_CONTENT` environment variable to `false`.\n\n```bash\nTRACELOOP_TRACE_CONTENT=false\n```\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "OpenTelemetry Google Generative AI instrumentation",
"version": "0.44.1",
"project_urls": {
"Repository": "https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-google-generativeai"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5ce92a36517143a065982e5f91c8abc3ea541fc1fefdf8f0059382e648640444",
"md5": "7246e0373068f396ec61de6a756af6f1",
"sha256": "6c04fbc72cde046ca9248b5d55d517f68f0e4a643c1bdc1f00a68b4fd2e82175"
},
"downloads": -1,
"filename": "opentelemetry_instrumentation_google_generativeai-0.44.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7246e0373068f396ec61de6a756af6f1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 9789,
"upload_time": "2025-08-04T08:39:26",
"upload_time_iso_8601": "2025-08-04T08:39:26.019846Z",
"url": "https://files.pythonhosted.org/packages/5c/e9/2a36517143a065982e5f91c8abc3ea541fc1fefdf8f0059382e648640444/opentelemetry_instrumentation_google_generativeai-0.44.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4ec72124e6bd4647f39fec56aee522294328adf84ebff0777a44901bdeb30048",
"md5": "04d149571d4ef2951b257e1b8f2acb6a",
"sha256": "e12ab2e5874866406efa96cfa5c84c15f9fdf9672122cc255d429b4534874a63"
},
"downloads": -1,
"filename": "opentelemetry_instrumentation_google_generativeai-0.44.1.tar.gz",
"has_sig": false,
"md5_digest": "04d149571d4ef2951b257e1b8f2acb6a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 7110,
"upload_time": "2025-08-04T08:40:01",
"upload_time_iso_8601": "2025-08-04T08:40:01.477211Z",
"url": "https://files.pythonhosted.org/packages/4e/c7/2124e6bd4647f39fec56aee522294328adf84ebff0777a44901bdeb30048/opentelemetry_instrumentation_google_generativeai-0.44.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-04 08:40:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "traceloop",
"github_project": "openllmetry",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "opentelemetry-instrumentation-google-generativeai"
}