LangGraph Step-by-Step Integration & Setup
A developer-focused guide to instrumenting LangGraph agents, setting custom node spans, capturing tool invocations, and enforcing execution budgets on cyclic workflows.
What Observyze Captures in LangGraph
Observyze provides telemetry across both model providers and graph orchestration layers:
Automatic Model Telemetry
Supported model and provider calls (OpenAI, Anthropic, Gemini, Groq) are captured automatically via client wrappers.
Custom Node & Span Demarcation
Add custom spans around LangGraph nodes while supported model calls are captured through the Observyze SDK instrumentation.
Instrumenting a LangGraph Node
Use custom spans inside your LangGraph node definitions to link LLM executions to graph state:
import { ObservyzeClient } from "@observyze/sdk";
import OpenAI from "openai";
const observyze = new ObservyzeClient({
apiKey: process.env.OBSERVYZE_API_KEY!,
projectId: process.env.OBSERVYZE_PROJECT_ID!,
executionBudget: { maxCostUsd: 0.50, maxSteps: 10 },
});
const openai = observyze.wrapOpenAI(new OpenAI());
// LangGraph node with custom span:
export async function agentReasoner(state: { messages: any[]; runId: string }) {
const trace = observyze.startTrace("langgraph.execution", {
sessionId: state.runId,
});
const span = trace.startSpan("node.reasoner");
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: state.messages,
});
span.end();
await trace.end();
return { messages: [...state.messages, response.choices[0].message] };
}Frequently Asked Questions
Technical details, integration patterns, and operational controls.
No. You wrap the underlying model client (OpenAI, Anthropic, Gemini) with the Observyze SDK and demarcate custom node spans using observyze.startTrace() and trace.startSpan(), giving you full control over span boundaries.
Explore Related Solutions
Runtime Architecture & Tooling
LangGraph Observability Architecture
Learn the architectural concepts behind multi-agent graph tracing and cycle control.
AI Agent Circuit Breakers
Protect cyclic agent workflows with automatic error-rate and spend circuit breakers.
AI Agent Cost Monitoring
Track per-agent token attribution and set organization-wide execution limits.
Want to test without installing anything?
Explore 6 pre-configured production scenarios in our interactive Demo Mode.