File tree Expand file tree Collapse file tree
packages/node/src/integrations/tracing/langchain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,8 +251,7 @@ export class SentryLangChainInstrumentation extends InstrumentationBase<LangChai
251251 * Unlike chat models which use LangChain's callback system, the Embeddings base class
252252 * has no callback support. We wrap the methods directly on the prototype.
253253 *
254- * Uses duck-type detection: finds any exported class whose prototype has both
255- * embedQuery and embedDocuments as functions.
254+ * Instruments any exported class whose prototype has both embedQuery and embedDocuments as functions.
256255 */
257256 private _patchEmbeddingsMethods ( exports : PatchedLangChainExports , options : LangChainOptions ) : void {
258257 const exportsToPatch = ( exports . universal_exports ?? exports ) as Record < string , unknown > ;
@@ -271,11 +270,10 @@ export class SentryLangChainInstrumentation extends InstrumentationBase<LangChai
271270
272271 const targetProto = embeddingClass . prototype ;
273272
274- // Separate dedup guard from chat model patching
275- if ( targetProto . __sentry_patched_embeddings__ ) {
273+ if ( targetProto . __sentry_patched__ ) {
276274 return ;
277275 }
278- targetProto . __sentry_patched_embeddings__ = true ;
276+ targetProto . __sentry_patched__ = true ;
279277
280278 instrumentLangChainEmbeddings ( targetProto , options ) ;
281279 }
You can’t perform that action at this time.
0 commit comments