Skip to main content
The LangGraph integration automatically instruments LangGraph applications, capturing agent creation, invocation, and state management.

Installation

The integration is enabled by default in Node.js:

Basic Usage

Just use LangGraph normally:

Configuration

Default Behavior

By default, inputs and outputs are not captured:

Capture Inputs and Outputs

Enable for all AI integrations:

Integration Options

boolean
default:"sendDefaultPii"
Capture input messages from graph state
boolean
default:"sendDefaultPii"
Capture output messages and responses

Captured Operations

The integration captures two main operations:

Agent Creation

Captured Data:
  • Agent name
  • Available tools
  • Graph configuration

Agent Invocation

Captured Data:
  • Input messages (if recordInputs: true)
  • Output messages (if recordOutputs: true)
  • Tool calls made during execution
  • Graph state transitions

Practical Examples

Simple Agent

Agent with Tools

Multi-Agent System

Stateful Conversation

Captured Span Attributes

When recordInputs and recordOutputs are enabled:

Viewing LangGraph Data

LangGraph operations appear as spans:

Performance Monitoring

  • Agent Execution Time: Track workflow performance
  • Tool Performance: Monitor tool call latency
  • State Transitions: Identify bottlenecks
  • Error Rates: Track failures in agent execution

Source Code

The LangGraph integration is implemented in: packages/node/src/integrations/tracing/langgraph/index.ts:11

Best Practices

Use descriptive node names for better observability in traces.

Add Custom Context

Troubleshooting

Spans Not Appearing

Ensure tracing is enabled:

Missing Tool Data

Enable output recording to capture tool calls: