# OpenTelemetry Langchain Instrumentation
<a href="https://pypi.org/project/opentelemetry-instrumentation-langchain/">
<img src="https://badge.fury.io/py/opentelemetry-instrumentation-langchain.svg">
</a>
This library allows tracing complete LLM applications built with [Langchain](https://github.com/langchain-ai/langchain).
## Installation
```bash
pip install opentelemetry-instrumentation-langchain
```
## Example usage
```python
from opentelemetry.instrumentation.langchain import LangchainInstrumentor
LangchainInstrumentor().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-langchain",
"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/69/a8/9548000604aff6ef59b9f99a7371161238a59a33f1e5e61fc4f00aae6232/opentelemetry_instrumentation_langchain-0.43.1.tar.gz",
"platform": null,
"description": "# OpenTelemetry Langchain Instrumentation\n\n<a href=\"https://pypi.org/project/opentelemetry-instrumentation-langchain/\">\n <img src=\"https://badge.fury.io/py/opentelemetry-instrumentation-langchain.svg\">\n</a>\n\nThis library allows tracing complete LLM applications built with [Langchain](https://github.com/langchain-ai/langchain).\n\n## Installation\n\n```bash\npip install opentelemetry-instrumentation-langchain\n```\n\n## Example usage\n\n```python\nfrom opentelemetry.instrumentation.langchain import LangchainInstrumentor\n\nLangchainInstrumentor().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 Langchain instrumentation",
"version": "0.43.1",
"project_urls": {
"Repository": "https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-langchain"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8b25ea96d73d5ba4895d4e19a5e10f26c9344689c6835b5c80f3a7b3bc864a36",
"md5": "703b3d613dca76a5791750ae36633a64",
"sha256": "316e197dad4e86137ac9a7c5e72b3019b460b225319ade32fb5f61d29e3dd663"
},
"downloads": -1,
"filename": "opentelemetry_instrumentation_langchain-0.43.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "703b3d613dca76a5791750ae36633a64",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 16776,
"upload_time": "2025-07-23T14:39:05",
"upload_time_iso_8601": "2025-07-23T14:39:05.342139Z",
"url": "https://files.pythonhosted.org/packages/8b/25/ea96d73d5ba4895d4e19a5e10f26c9344689c6835b5c80f3a7b3bc864a36/opentelemetry_instrumentation_langchain-0.43.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "69a89548000604aff6ef59b9f99a7371161238a59a33f1e5e61fc4f00aae6232",
"md5": "dc1a77e0f9dd93e24bdf9bde2020a758",
"sha256": "09d5ed097128015f5a7b553c594e98a3bc8e76ebc32fb1acbca0f8ef2af433d6"
},
"downloads": -1,
"filename": "opentelemetry_instrumentation_langchain-0.43.1.tar.gz",
"has_sig": false,
"md5_digest": "dc1a77e0f9dd93e24bdf9bde2020a758",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 13092,
"upload_time": "2025-07-23T14:39:40",
"upload_time_iso_8601": "2025-07-23T14:39:40.450144Z",
"url": "https://files.pythonhosted.org/packages/69/a8/9548000604aff6ef59b9f99a7371161238a59a33f1e5e61fc4f00aae6232/opentelemetry_instrumentation_langchain-0.43.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-23 14:39:40",
"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-langchain"
}