Skip to main content
npm

Overview

The @fiddler-ai/langgraph package provides OpenTelemetry-based instrumentation for LangGraph JS applications, enabling automatic trace capture for agentic workflows monitored by Fiddler AI observability. Mirrors the Python fiddler-langgraph SDK API.
npm install @fiddler-ai/langgraph
import { LangGraphInstrumentor, setConversationId } from '@fiddler-ai/langgraph';

Components

Callback-Handler

The LangChain callback handler that emits Fiddler spans. FiddlerCallbackHandler hooks into LangGraph/LangChain run-lifecycle events and translates them into OpenTelemetry spans.

Context

Conversation, session, and retrieval-context helpers. setConversationId/getConversationId tag spans with a conversation ID, addSessionAttributes/getSessionAttributes attach session-wide attributes, setLlmContext/getLlmContext attach retrieval context, and runWithContext scopes them to a callback.

Instrumentor

One-time instrumentation setup. LangGraphInstrumentor patches the LangChain callback manager (CallbackManagerModule) so every LangGraph run automatically emits Fiddler spans.

Utils

Internal helpers for span serialization and formatting — message formatting (formatMessages, extractTextContent), provider detection (getProviderFromModel), and safe truncation/stringification (truncate, safeStringify).