> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LangGraphInstrumentor

> An OpenTelemetry instrumentor for LangGraph applications.

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()`](#uninstrument). Calling [`instrument()`](#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**:

```python theme={null}
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**:

```python theme={null}
# Clean up instrumentation when shutting down
instrumentor.uninstrument()
```

Initialise the LangGraphInstrumentor.

## Parameters

<ParamField path="client" type="FiddlerClient" required={true}>
  The [`FiddlerClient`](/sdk-api/langgraph/fiddler-client) instance to use for tracing.
</ParamField>

## 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.
