Files
klz-cables.com/.pnpm-store/v10/files/71/1e5cd06156dc34c84ae22f7c298773bfe9d45b32d121fc315b5d260615d283d84aa62b40901628f20232e68ed12e4a4f11a0fbe0e454380bb7324925f40666
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

77 lines
2.3 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const instrumentation = require('@opentelemetry/instrumentation');
const core = require('@sentry/core');
const supportedVersions = ['>=0.0.0 <2.0.0'];
/**
* Sentry LangGraph instrumentation using OpenTelemetry.
*/
class SentryLangGraphInstrumentation extends instrumentation.InstrumentationBase {
constructor(config = {}) {
super('@sentry/instrumentation-langgraph', core.SDK_VERSION, config);
}
/**
* Initializes the instrumentation by defining the modules to be patched.
*/
init() {
const module = new instrumentation.InstrumentationNodeModuleDefinition(
'@langchain/langgraph',
supportedVersions,
this._patch.bind(this),
exports$1 => exports$1,
[
new instrumentation.InstrumentationNodeModuleFile(
/**
* In CJS, LangGraph packages re-export from dist/index.cjs files.
* Patching only the root module sometimes misses the real implementation or
* gets overwritten when that file is loaded. We add a file-level patch so that
* _patch runs again on the concrete implementation
*/
'@langchain/langgraph/dist/index.cjs',
supportedVersions,
this._patch.bind(this),
exports$1 => exports$1,
),
],
);
return module;
}
/**
* Core patch logic applying instrumentation to the LangGraph module.
*/
_patch(exports$1) {
const client = core.getClient();
const defaultPii = Boolean(client?.getOptions().sendDefaultPii);
const config = this.getConfig();
const recordInputs = config.recordInputs ?? defaultPii;
const recordOutputs = config.recordOutputs ?? defaultPii;
const options = {
recordInputs,
recordOutputs,
};
// Patch StateGraph.compile to instrument both compile() and invoke()
if (exports$1.StateGraph && typeof exports$1.StateGraph === 'function') {
const StateGraph = exports$1.StateGraph
;
StateGraph.prototype.compile = core.instrumentStateGraphCompile(
StateGraph.prototype.compile ,
options,
);
}
return exports$1;
}
}
exports.SentryLangGraphInstrumentation = SentryLangGraphInstrumentation;
//# sourceMappingURL=instrumentation.js.map