Installation
Install the instrumentation package:Usage
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.
TypeScript Example with Custom Tracer Provider
You can specify a custom tracer provider when creating the LangChain instrumentation. This is useful when you want to use a non-global tracer provider or have more control over the tracing configuration.Compatibility
| @langchain/core Version | @arizeai/openinference-instrumentation-langchain Version |
|---|---|
| ^1.0.0 | ^4.0.0 |
| ^0.3.0 | ^4.0.0 |
@langchain/core. Older versions may work but are not officially supported. For full compatibility with the 0.X versions of LangChain.js, a dedicated package called @arizeai/openinference-instrumentation-langchain-v0 is available.