Skip to content

Commit abeed16

Browse files
committed
.
1 parent 584ad27 commit abeed16

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)