Files
klz-cables.com/.pnpm-store/v10/files/89/8202f33890a92bebd35929e9349ffd6b3379383bc703dda1ca66f45df2a020cd6ce03313be74cf691551aa89c294188c866e07e33f7acf707301364d4421e6
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

75 lines
2.6 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const instrument = require('../../otel/instrument.js');
const httpServerIntegration = require('./httpServerIntegration.js');
const httpServerSpansIntegration = require('./httpServerSpansIntegration.js');
const SentryHttpInstrumentation = require('./SentryHttpInstrumentation.js');
const INTEGRATION_NAME = 'Http';
const instrumentSentryHttp = instrument.generateInstrumentOnce(
`${INTEGRATION_NAME}.sentry`,
options => {
return new SentryHttpInstrumentation.SentryHttpInstrumentation(options);
},
);
/**
* The http integration instruments Node's internal http and https modules.
* It creates breadcrumbs for outgoing HTTP requests which will be attached to the currently active span.
*/
const httpIntegration = core.defineIntegration((options = {}) => {
const serverOptions = {
sessions: options.trackIncomingRequestsAsSessions,
sessionFlushingDelayMS: options.sessionFlushingDelayMS,
ignoreRequestBody: options.ignoreIncomingRequestBody,
maxRequestBodySize: options.maxIncomingRequestBodySize,
};
const serverSpansOptions = {
ignoreIncomingRequests: options.ignoreIncomingRequests,
ignoreStaticAssets: options.ignoreStaticAssets,
ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,
};
const httpInstrumentationOptions = {
breadcrumbs: options.breadcrumbs,
propagateTraceInOutgoingRequests: true,
ignoreOutgoingRequests: options.ignoreOutgoingRequests,
};
const server = httpServerIntegration.httpServerIntegration(serverOptions);
const serverSpans = httpServerSpansIntegration.httpServerSpansIntegration(serverSpansOptions);
// In node-core, for now we disable incoming requests spans by default
// we may revisit this in a future release
const spans = options.spans ?? false;
const disableIncomingRequestSpans = options.disableIncomingRequestSpans ?? false;
const enabledServerSpans = spans && !disableIncomingRequestSpans;
return {
name: INTEGRATION_NAME,
setup(client) {
if (enabledServerSpans) {
serverSpans.setup(client);
}
},
setupOnce() {
server.setupOnce();
instrumentSentryHttp(httpInstrumentationOptions);
},
processEvent(event) {
// Note: We always run this, even if spans are disabled
// The reason being that e.g. the remix integration disables span creation here but still wants to use the ignore status codes option
return serverSpans.processEvent(event);
},
};
});
exports.httpIntegration = httpIntegration;
exports.instrumentSentryHttp = instrumentSentryHttp;
//# sourceMappingURL=index.js.map