mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Fix sentry de-duplication by migrating from event-processors to beforeSend (no-changelog) (#10947)
This commit is contained in:
parent
dcc1c72fc4
commit
a81256aff5
|
@ -29,7 +29,7 @@ export const initErrorHandling = async () => {
|
||||||
DEPLOYMENT_NAME: serverName,
|
DEPLOYMENT_NAME: serverName,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
const { init, captureException, addEventProcessor } = await import('@sentry/node');
|
const { init, captureException } = await import('@sentry/node');
|
||||||
|
|
||||||
const { RewriteFrames } = await import('@sentry/integrations');
|
const { RewriteFrames } = await import('@sentry/integrations');
|
||||||
const { Integrations } = await import('@sentry/node');
|
const { Integrations } = await import('@sentry/node');
|
||||||
|
@ -41,6 +41,8 @@ export const initErrorHandling = async () => {
|
||||||
'OnUnhandledRejection',
|
'OnUnhandledRejection',
|
||||||
'ContextLines',
|
'ContextLines',
|
||||||
];
|
];
|
||||||
|
const seenErrors = new Set<string>();
|
||||||
|
|
||||||
init({
|
init({
|
||||||
dsn,
|
dsn,
|
||||||
release,
|
release,
|
||||||
|
@ -62,10 +64,7 @@ export const initErrorHandling = async () => {
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
beforeSend(event, { originalException }) {
|
||||||
|
|
||||||
const seenErrors = new Set<string>();
|
|
||||||
addEventProcessor((event, { originalException }) => {
|
|
||||||
if (!originalException) return null;
|
if (!originalException) return null;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -90,6 +89,7 @@ export const initErrorHandling = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
ErrorReporterProxy.init({
|
ErrorReporterProxy.init({
|
||||||
|
|
Loading…
Reference in a new issue