LangChainInstrumentor.
Google Colab
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.
Run LangGraph Example
By instrumenting LangChain, spans from your LangGraph applications will be created and sent to Arize AX. Here is an example from the Arize AX documentation:Observe in Arize AX
Now that you have tracing set up, all invocations and steps within your LangGraph agents will be streamed to your Arize AX project for observability and evaluation.Resources
Arize AX LangGraph Tracing Tutorial (Colab)
LangGraph Documentation
Arize AX LangChain Tracing Guide
OpenInference LangChain Instrumentor
used for LangGraph