LangChainInstrumentor.
Tutorial on instrumenting a LangGraph application and sending traces to Arize AX.
As LangGraph is an extension of LangChain, the same
LangChainInstrumentor from OpenInference is used to capture traces. If you’ve already set up instrumentation for LangChain as described in the LangChain Tracing with Arize AX guide, your LangGraph applications will also be traced.API Key Setup
Before running your application, ensure you have the following environment variables set:Install Packages
Install the necessary packages for LangGraph, LangChain, OpenInference instrumentors, Arize AX OTel, and OpenTelemetry:Setup Tracing
Usearize.otel.register to configure the OpenTelemetry tracer. Then, apply the LangChainInstrumentor (which covers LangGraph) and, optionally, the OpenAIInstrumentor if you are using OpenAI directly or want deeper OpenAI traces.