Skip to main content
This module provides automatic instrumentation for LangChain.js, more specifically, the @langchain/core module. which may be used in conjunction with @opentelemetry/sdk-trace-node.

Install

Setup

To load the LangChain instrumentation, manually instrument the @langchain/core/callbacks/manager module. The callbacks manager must be manually instrumented due to the non-traditional module structure in @langchain/core.
Once instrumentation is setup, your agent will automatically export traces to Phoenix.

Support

Instrumentation version >=4.0.0 supports LangChain 1.0 and above. If you are still using older versions of LangChain we recommend using the dedicated package @arizeai/openinference-instrumentation-langchain-v0 which will receive patches for the older versions.

Resources