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

> Auto-instruments LangChain/LangGraph by monkey-patching `CallbackManager._configureSync` (or `.configure`) to inject a FiddlerCallbackHandler into every invocation.

**Node.js only** — requires `@langchain/core` as a peer dependency, and
the injected FiddlerCallbackHandler uses `node:async_hooks` for
context propagation.

Uses a WeakSet to track patched modules so frozen ESM exports
are handled correctly.

## Methods

### `constructor(client: FiddlerClient)`

**client** `FiddlerClient` *required*

An initialized FiddlerClient used by the
callback handler to create spans.

### `async instrument(): Promise<void>`

Auto-instrument by dynamically importing
`@langchain/core/callbacks/manager` and patching its
`CallbackManager`.

### `isInstrumented(): boolean`

Check whether the instrumentor has successfully patched a
`CallbackManager` module.

**return**

`true` if auto-instrumentation is active.

### `manuallyInstrument(module: CallbackManagerModule)`

Manually instrument a specific `@langchain/core/callbacks/manager`
module reference.

Use this in bundled environments (Webpack, esbuild, etc.) where
dynamic `import()` of `@langchain/core` may not resolve correctly.

**module** `CallbackManagerModule` *required*

The imported `@langchain/core/callbacks/manager` module.

### `uninstrument()`

Remove the patch and restore the original `CallbackManager` behavior.

Safe to call even if the instrumentor was never activated.
