Files
klz-cables.com/.pnpm-store/v10/files/c5/a4a23048c29ec8091082a02ad937b195b843f33abcdd2d19819661a51c4932453d17f03a3f7e602fdc701f46db59025781dfa1b8ccfa2bdf92dc4844020408
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

47 lines
1.6 KiB
Plaintext

import { defineIntegration } from '../integration.js';
import { stripMetadataFromStackFrames, addMetadataToStackFrames } from '../metadata.js';
import { forEachEnvelopeItem } from '../utils/envelope.js';
/**
* Adds module metadata to stack frames.
*
* Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option.
*
* When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events
* under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams
* our sources
*/
const moduleMetadataIntegration = defineIntegration(() => {
return {
name: 'ModuleMetadata',
setup(client) {
// We need to strip metadata from stack frames before sending them to Sentry since these are client side only.
client.on('beforeEnvelope', envelope => {
forEachEnvelopeItem(envelope, (item, type) => {
if (type === 'event') {
const event = Array.isArray(item) ? (item )[1] : undefined;
if (event) {
stripMetadataFromStackFrames(event);
item[1] = event;
}
}
});
});
client.on('applyFrameMetadata', event => {
// Only apply stack frame metadata to error events
if (event.type) {
return;
}
const stackParser = client.getOptions().stackParser;
addMetadataToStackFrames(stackParser, event);
});
},
};
});
export { moduleMetadataIntegration };
//# sourceMappingURL=moduleMetadata.js.map