File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
packages/node/src/integrations/tracing/langgraph Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff 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 /**
You can’t perform that action at this time.
0 commit comments