chore(core): Upgrade backend @sentry packages to 8.42.0 (#12061)

This commit is contained in:
Tomi Turtiainen 2024-12-10 14:13:11 +02:00 committed by GitHub
parent 43009b6aa8
commit db09d0e77e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 703 additions and 106 deletions

View file

@ -35,7 +35,6 @@
},
"dependencies": {
"@n8n/config": "workspace:*",
"@sentry/integrations": "catalog:",
"@sentry/node": "catalog:",
"acorn": "8.14.0",
"acorn-walk": "8.3.4",

View file

@ -1,6 +1,12 @@
import { RewriteFrames } from '@sentry/integrations';
import { init, setTag, captureException, close } from '@sentry/node';
import type { ErrorEvent, EventHint } from '@sentry/types';
import {
init,
setTag,
captureException,
close,
rewriteFramesIntegration,
type EventHint,
type ErrorEvent,
} from '@sentry/node';
import * as a from 'assert/strict';
import { createHash } from 'crypto';
import { ApplicationError } from 'n8n-workflow';
@ -52,7 +58,7 @@ export class ErrorReporter {
beforeSend: async (event, hint) => await this.beforeSend(event, hint),
integrations: (integrations) => [
...integrations.filter(({ name }) => ENABLED_INTEGRATIONS.includes(name)),
new RewriteFrames({ root: process.cwd() }),
rewriteFramesIntegration({ root: process.cwd() }),
],
});

View file

@ -98,7 +98,6 @@
"@n8n_io/license-sdk": "2.13.1",
"@oclif/core": "4.0.7",
"@rudderstack/rudder-sdk-node": "2.0.9",
"@sentry/integrations": "catalog:",
"@sentry/node": "catalog:",
"aws4": "1.11.0",
"axios": "catalog:",

View file

@ -7,7 +7,6 @@ import { InternalServerError } from '@/errors/response-errors/internal-server.er
const init = jest.fn();
jest.mock('@sentry/integrations');
jest.mock('@sentry/node', () => ({
init,
setTag: jest.fn(),

View file

@ -94,11 +94,8 @@ export abstract class AbstractServer {
const { app } = this;
// Augment errors sent to Sentry
const {
Handlers: { requestHandler, errorHandler },
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
const { setupExpressErrorHandler } = await import('@sentry/node');
setupExpressErrorHandler(app);
}
private setupCommonMiddlewares() {

View file

@ -33,8 +33,7 @@ export const initErrorHandling = async () => {
const { init, captureException, setTag } = await import('@sentry/node');
const { RewriteFrames } = await import('@sentry/integrations');
const { Integrations } = await import('@sentry/node');
const { requestDataIntegration, rewriteFramesIntegration } = await import('@sentry/node');
const enabledIntegrations = [
'InboundFilters',
@ -54,8 +53,8 @@ export const initErrorHandling = async () => {
beforeBreadcrumb: () => null,
integrations: (integrations) => [
...integrations.filter(({ name }) => enabledIntegrations.includes(name)),
new RewriteFrames({ root: process.cwd() }),
new Integrations.RequestData({
rewriteFramesIntegration({ root: process.cwd() }),
requestDataIntegration({
include: {
cookies: false,
data: false,

View file

@ -48,7 +48,7 @@ export class MessageEventBusDestinationSentry
environment,
release: N8N_VERSION,
transport: Sentry.makeNodeTransport,
integrations: Sentry.defaultIntegrations,
integrations: Sentry.getDefaultIntegrations({}),
stackParser: Sentry.defaultStackParser,
});
}

View file

@ -133,11 +133,8 @@ export class TaskRunnerServer {
// Augment errors sent to Sentry
if (this.globalConfig.sentry.backendDsn) {
const {
Handlers: { requestHandler, errorHandler },
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
const { setupExpressErrorHandler } = await import('@sentry/node');
setupExpressErrorHandler(app);
}
}

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,7 @@ packages:
- cypress
catalog:
'@sentry/integrations': 7.87.0
'@sentry/node': 7.87.0
'@sentry/node': 8.42.0
'@types/basic-auth': ^1.1.3
'@types/express': ^4.17.21
'@types/lodash': ^4.14.195