skillfed

openinference-instrumentation-langchain

OpenInference LangChain Instrumentation

openinference-instrumentation-langchain v0.1.70 3.5M downloads/30d#2,612 on PyPI1,147
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps LangChain to automatically capture execution traces and send them to OpenTelemetry collectors like Arize Phoenix or Arize AX. It hooks into langchain-core to intercept calls across all LangChain packages (langchain-openai, langchain-anthropic, langchain-google-vertexai, etc.) and works with both the modern LangChain 1.x agent framework and the legacy LangChain Classic chains API.

Once instrumented, every LangChain operation—agent steps, tool calls, LLM invocations, prompt templates—generates a span that can be viewed in a web dashboard for debugging, performance analysis, and tracing AI application behavior. It requires an OpenTelemetry exporter and collector endpoint to function; Arize Phoenix is the recommended local option.

Use it for:

  • Debug LangChain agent behavior by viewing step-by-step execution traces in Arize Phoenix.
  • Monitor LLM API calls and token usage across langchain-openai, langchain-anthropic, and other partner packages.
  • Trace tool execution and error propagation in multi-step agent workflows.
  • Collect structured metadata and session information from LangChain runs for post-analysis.
  • Migrate legacy LangChain Classic applications while maintaining observability during the transition to LangChain 1.x.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Auto-instruments LangChain applications to generate OpenTelemetry-compatible traces for observability and debugging, compatible with both LangChain 1.x and LangChain Classic.

Yes, if you are building or maintaining LangChain applications and need visibility into execution. The package is actively maintained, has no known vulnerabilities, installs with low friction, and integrates seamlessly with standard observability infrastructure. The Apache-2.0 license poses no barrier. Install it alongside an OpenTelemetry collector (Arize Phoenix is free and local) to enable immediate tracing.

Install

openinference-instrumentation-langchain on PyPI

pip

pip install openinference-instrumentation-langchain

uv

uv add openinference-instrumentation-langchain

poetry

poetry add openinference-instrumentation-langchain

Installing openinference-instrumentation-langchain

Before you install

Low friction install with a pure-Python wheel. The package is actively maintained (last commit 2026-08-14, release 7 days old) and supports current Python versions (3.10–3.14). Six runtime dependencies are all standard observability libraries.

License in practice

Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions; attribution required.

Quickstart

pip install openinference-instrumentation-langchain

from openinference.instrumentation.langchain import LangChainInstrumentor
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter

tracer_provider = trace_sdk.TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter("http://localhost:6006/v1/traces")))
LangChainInstrumentor().instrument()

Requires an OpenTelemetry collector endpoint (e.g., Arize Phoenix) to receive and view traces; local Phoenix server can be started with `python -m phoenix.server.main serve`.

Verify before relying

  • Whether instrumentation overhead is measurable for high-throughput LangChain applications.
  • Support status and compatibility timeline for LangChain Classic vs. LangChain 1.x migration path.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 3,470,274/month — #2,612 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openinference_instrumentation_langchain-0.1.70-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

langchain tracing instrumentationopentelemetry langchainlangchain observabilitylangchain span collectionlangchain debugging tracesai agent monitoringllm application tracing
observabilitylangchainopentelemetry

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

openinference-instrumentation-openai

Auto-instruments OpenAI Python SDK calls to…

permissive · top 5,000 on PyPI

openinference-semantic-conventions

Defines semantic conventions and standardized…

permissive · top 5,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-adk

Auto-instruments Google ADK applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation

Provides utility functions to convert typed…

permissive · top 5,000 on PyPI

openinference-instrumentation-claude-agent-sdk

Auto-instruments Claude Agent SDK calls to emit…

permissive · top 15,000 on PyPI

openinference-instrumentation-llama-index

Auto-instruments LlamaIndex applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-openai-agents

Auto-instruments OpenAI Agents SDK to emit…

permissive · top 5,000 on PyPI

braintrust-langchain

Provides a LangChain callback handler to log…

permissive · top 5,000 on PyPI