Skip to main content
An OpenTelemetry instrumentor for LangGraph applications. Provides automatic instrumentation for applications built with LangGraph by monkey-patching LangChain’s callback system to inject a custom callback handler that captures trace data. Once instrumented, all LangGraph operations automatically generate telemetry data. Instrumentation persists for the lifetime of the application unless explicitly removed by calling uninstrument(). Calling instrument() multiple times is safe — it will not create duplicate handlers. Thread Safety: The instrumentation applies globally to the process and affects all threads. In concurrent environments (multi-threading, async), all contexts share the same instrumented callback system. Basic usage:
from fiddler_langgraph import FiddlerClient, LangGraphInstrumentor

client = FiddlerClient(
    application_id="...",
    api_key="...",
    url="https://your-instance.fiddler.ai",
)
instrumentor = LangGraphInstrumentor(client=client)
instrumentor.instrument()
Removing instrumentation:
# Clean up instrumentation when shutting down
instrumentor.uninstrument()
Initialise the LangGraphInstrumentor.

Parameters

client
FiddlerClient
required
The FiddlerClient instance to use for tracing.

Raises

ImportError – If LangGraph is not installed or its version is incompatible.

instrument()

Instrument LangGraph by monkey-patching BaseCallbackManager. Calling this method multiple times is safe; subsequent calls are no-ops.

Raises

ValueError – If the tracer is not initialized in the FiddlerClient.

uninstrument()

Remove the instrumentation from LangGraph.