Initialize the LangChain Instrumentor to enable automatic tracing. This step ensures that all interactions with the LangChain are tracked and monitored.
from traceai_langchain import LangChainInstrumentorLangChainInstrumentor().instrument(tracer_provider=trace_provider)
import { LangChainInstrumentation } from "@traceai/langchain";import * as CallbackManagerModule from "langchain/callbacks";// Pass the custom tracer provider to the instrumentationconst lcInstrumentation = new LangChainInstrumentation({ tracerProvider: tracerProvider,});// Manually instrument the LangChain modulelcInstrumentation.manuallyInstrument(CallbackManagerModule);
5. Create LangChain Components
Set up your LangChain pipeline as you normally would. Our Instrumentor will automatically trace and send the telemetry data to our platform.