Skip to content

Commit 335ee5a

Browse files
committed
Use two modules
1 parent da96451 commit 335ee5a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/node/src/integrations/tracing/langgraph/instrumentation.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export class SentryLangGraphInstrumentation extends InstrumentationBase<LangGrap
3131
/**
3232
* Initializes the instrumentation by defining the modules to be patched.
3333
*/
34-
public init(): InstrumentationModuleDefinition {
35-
const module = new InstrumentationNodeModuleDefinition(
34+
public init(): InstrumentationModuleDefinition[] {
35+
const mainModule = new InstrumentationNodeModuleDefinition(
3636
'@langchain/langgraph',
3737
supportedVersions,
3838
this._patch.bind(this),
@@ -50,6 +50,15 @@ export class SentryLangGraphInstrumentation extends InstrumentationBase<LangGrap
5050
this._patch.bind(this),
5151
exports => exports,
5252
),
53+
],
54+
);
55+
56+
const prebuiltModule = new InstrumentationNodeModuleDefinition(
57+
'@langchain/langgraph/prebuilt',
58+
supportedVersions,
59+
this._patch.bind(this),
60+
exports => exports,
61+
[
5362
new InstrumentationNodeModuleFile(
5463
/**
5564
* Patch the prebuilt subpath exports for CJS.
@@ -62,7 +71,8 @@ export class SentryLangGraphInstrumentation extends InstrumentationBase<LangGrap
6271
),
6372
],
6473
);
65-
return module;
74+
75+
return [mainModule, prebuiltModule];
6676
}
6777

6878
/**

0 commit comments

Comments
 (0)