LangGraph (tracing)
LangGraph (tracing)
LangGraph is a framework for building stateful, multi-step agent workflows as graphs. Nodes represent operations such as LLM calls, tools, and routing decisions, while edges define the flow between them. Respan gives you full observability over every graph run, node, tool call, and LLM generation — and gateway routing through the OpenAI-compatible Respan endpoint.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Use Respan Gateway
See LangGraph gateway setup to route this integration through the Respan gateway.
Example projects
Setup
Set environment variables
RESPAN_API_KEY is used to export traces to Respan. Set OPENAI_API_KEY too when graph nodes call provider-backed models.
Initialize and run
Use respan-instrumentation-langchain for LangGraph because LangGraph runs through LangChain callback managers.
View your trace
Open the Traces page to see the graph execution with node spans, LLM calls, and state transitions.
Configuration
Attributes
In Respan()
Set defaults at initialization — these apply to all spans.
With propagate_attributes
Override per-request using a context scope.
Decorators (optional)
Decorators are not required. Attach the Respan callback config to the graph invocation to trace graph and node runs. Use @workflow and @task (Python) or withWorkflow and withTask (TypeScript) to group graph runs inside larger application workflows.
Examples
Streaming updates
Stream graph node updates while keeping the same trace.
Tool nodes
Tool calls inside graph nodes are captured as tool spans.