diff --git a/package-lock.json b/package-lock.json index 0576c589..aabad644 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,8 @@ "license": "AGPL-3.0-only", "dependencies": { "@aws-sdk/client-s3": "^3.385.0", - "@sentry/integrations": "^7.61.1", - "@sentry/node": "^7.61.1", - "@sentry/tracing": "^7.61.1", + "@sentry/integrations": "^7.66.0", + "@sentry/node": "^7.66.0", "ajv": "8.6.2", "ajv-formats": "2.1.1", "amqplib": "^0.10.3", @@ -1245,40 +1244,13 @@ "node": "6.* || 8.* || >=10.*" } }, - "node_modules/@sentry-internal/tracing": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.63.0.tgz", - "integrity": "sha512-Fxpc53p6NGvLSURg3iRvZA0k10K9yfeVhtczvJnpX30POBuV41wxpkLHkb68fjksirjEma1K3Ut1iLOEEDpPQg==", - "dependencies": { - "@sentry/core": "7.63.0", - "@sentry/types": "7.63.0", - "@sentry/utils": "7.63.0", - "tslib": "^2.4.1 || ^1.9.3" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/core": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.63.0.tgz", - "integrity": "sha512-13Ljiq8hv6ieCkO+Am99/PljYJO5ynKT/hRQrWgGy9IIEgUr8sV3fW+1W6K4/3MCeOJou0HsiGBjOD1mASItVg==", - "dependencies": { - "@sentry/types": "7.63.0", - "@sentry/utils": "7.63.0", - "tslib": "^2.4.1 || ^1.9.3" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@sentry/integrations": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.63.0.tgz", - "integrity": "sha512-+P8GNqFZNH/yS/KPbvUfUDERneoRNUrqp9ayvvp8aq4cTtrBdM72CYgI21oG6cti42SSM1VDLYZomTV3ElPzSg==", + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.66.0.tgz", + "integrity": "sha512-2PNEnihG9e9Rjbz205+A4BYtFcS2XdgwsN6obAU6Yir7VIbskwZXxx87lKZuz6S53sOWPHleC7uvUBjL+Q6vYg==", "dependencies": { - "@sentry/types": "7.63.0", - "@sentry/utils": "7.63.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", "localforage": "^1.8.1", "tslib": "^2.4.1 || ^1.9.3" }, @@ -1286,15 +1258,35 @@ "node": ">=8" } }, - "node_modules/@sentry/node": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.63.0.tgz", - "integrity": "sha512-tSMyfQNbfjX1w8vJDZtvWeaD4QQ/Z4zVW/TLXfL/JZFIIksPgDZmqLdF+NJS4bSGTU5JiHiUh4pYhME4mHgNBQ==", + "node_modules/@sentry/integrations/node_modules/@sentry/types": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.66.0.tgz", + "integrity": "sha512-uUMSoSiar6JhuD8p7ON/Ddp4JYvrVd2RpwXJRPH1A4H4Bd4DVt1mKJy1OLG6HdeQv39XyhB1lPZckKJg4tATPw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/integrations/node_modules/@sentry/utils": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.66.0.tgz", + "integrity": "sha512-9GYUVgXjK66uXXcLXVMXVzlptqMtq1eJENCuDeezQiEFrNA71KkLDg00wESp+LL+bl3wpVTBApArpbF6UEG5hQ==", "dependencies": { - "@sentry-internal/tracing": "7.63.0", - "@sentry/core": "7.63.0", - "@sentry/types": "7.63.0", - "@sentry/utils": "7.63.0", + "@sentry/types": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/node": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.66.0.tgz", + "integrity": "sha512-PxqIqLr4Sh5xcDfECiBQ4PuZ7v8yTgLhaRkruWrZPYxQrcJFPkwbFkw/IskzVnhT2VwXUmeWEIlRMQKBJ0t83A==", + "dependencies": { + "@sentry-internal/tracing": "7.66.0", + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", "cookie": "^0.4.1", "https-proxy-agent": "^5.0.0", "lru_map": "^0.3.3", @@ -1304,31 +1296,47 @@ "node": ">=8" } }, - "node_modules/@sentry/tracing": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.63.0.tgz", - "integrity": "sha512-91gjqM/3CD6XdN1JVSLnUTD7HAI77NodP48+FZ2kgRkNmD2jojJBWsTC9NHG4UEO0PppjjwDPPJR1iHwybaO8g==", + "node_modules/@sentry/node/node_modules/@sentry-internal/tracing": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.66.0.tgz", + "integrity": "sha512-3vCgC2hC3T45pn53yTDVcRpHoJTBxelDPPZVsipAbZnoOVPkj7n6dNfDhj3I3kwWCBPahPkXmE+R4xViR8VqJg==", "dependencies": { - "@sentry-internal/tracing": "7.63.0" + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" }, "engines": { "node": ">=8" } }, - "node_modules/@sentry/types": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.63.0.tgz", - "integrity": "sha512-pZNwJVW7RqNLGuTUAhoygt0c9zmc0js10eANAz0MstygJRhQI1tqPDuiELVdujPrbeL+IFKF+7NvRDAydR2Niw==", + "node_modules/@sentry/node/node_modules/@sentry/core": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.66.0.tgz", + "integrity": "sha512-WMAEPN86NeCJ1IT48Lqiz4MS5gdDjBwP4M63XP4msZn9aujSf2Qb6My5uT87AJr9zBtgk8MyJsuHr35F0P3q1w==", + "dependencies": { + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, "engines": { "node": ">=8" } }, - "node_modules/@sentry/utils": { - "version": "7.63.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.63.0.tgz", - "integrity": "sha512-7FQv1RYAwnuTuarruP+1+Jd6YQuN7i/Y7KltwPMVEwU7j5mzYQaexLr/Jz1XIdR2KYVdkbXQyP8jj8BmA6u9Jw==", + "node_modules/@sentry/node/node_modules/@sentry/types": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.66.0.tgz", + "integrity": "sha512-uUMSoSiar6JhuD8p7ON/Ddp4JYvrVd2RpwXJRPH1A4H4Bd4DVt1mKJy1OLG6HdeQv39XyhB1lPZckKJg4tATPw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/node/node_modules/@sentry/utils": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.66.0.tgz", + "integrity": "sha512-9GYUVgXjK66uXXcLXVMXVzlptqMtq1eJENCuDeezQiEFrNA71KkLDg00wESp+LL+bl3wpVTBApArpbF6UEG5hQ==", "dependencies": { - "@sentry/types": "7.63.0", + "@sentry/types": "7.66.0", "tslib": "^2.4.1 || ^1.9.3" }, "engines": { diff --git a/package.json b/package.json index 70e4ae84..3994670b 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,8 @@ }, "dependencies": { "@aws-sdk/client-s3": "^3.385.0", - "@sentry/integrations": "^7.61.1", - "@sentry/node": "^7.61.1", - "@sentry/tracing": "^7.61.1", + "@sentry/integrations": "^7.66.0", + "@sentry/node": "^7.66.0", "ajv": "8.6.2", "ajv-formats": "2.1.1", "amqplib": "^0.10.3", diff --git a/src/util/util/Sentry.ts b/src/util/util/Sentry.ts index e302da0c..74a23a1e 100644 --- a/src/util/util/Sentry.ts +++ b/src/util/util/Sentry.ts @@ -16,13 +16,12 @@ along with this program. If not, see . */ -import { Config } from "./Config"; import { yellow } from "picocolors"; +import { Config } from "./Config"; -import express from "express"; -import * as SentryNode from "@sentry/node"; -import * as Tracing from "@sentry/tracing"; import * as Integrations from "@sentry/integrations"; +import * as SentryNode from "@sentry/node"; +import express from "express"; // Work around for when bundle calls api/etc let errorHandlersUsed = false; @@ -46,16 +45,28 @@ export const Sentry = { ); } + const integrations = [ + new SentryNode.Integrations.Http({ tracing: true }), + new Integrations.RewriteFrames({ + root: __dirname, + }), + new SentryNode.Integrations.Http({ + tracing: true, + breadcrumbs: true, + }), + ...SentryNode.autoDiscoverNodePerformanceMonitoringIntegrations(), + ]; + + if (app) + integrations.push( + new SentryNode.Integrations.Express({ + app, + }), + ); + SentryNode.init({ dsn: endpoint, - integrations: [ - new SentryNode.Integrations.Http({ tracing: true }), - new Tracing.Integrations.Express({ app }), - new Tracing.Integrations.Mysql(), - new Integrations.RewriteFrames({ - root: __dirname, - }), - ], + integrations, tracesSampleRate: traceSampleRate, // naming? environment, });