Framework Integration Guide

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.

Early Access · 90 Days Free · No credit card requiredBuilt by the Observyze engineering team for production AI systems.
Technical Architecture

What Observyze Captures in LangGraph

Observyze provides telemetry across both model providers and graph orchestration layers:

Layer 01

Automatic Model Telemetry

Supported model and provider calls (OpenAI, Anthropic, Gemini, Groq) are captured automatically via client wrappers.

Exact per-node token counts and dollar spend
Streaming time-to-first-token latency
Tool call arguments and schema payloads
Layer 02

Custom Node & Span Demarcation

Add custom spans around LangGraph nodes while supported model calls are captured through the Observyze SDK instrumentation.

Custom spans for database / vector lookups
Node-level error handling and retry logging
Session correlation across multi-turn agent runs
Implementation Code

Instrumenting a LangGraph Node

Use custom spans inside your LangGraph node definitions to link LLM executions to graph state:

langgraph-node-setup.ts
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] };
}
Developer FAQ

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.