From f1bf540711ff18c5fe95e1f82a60695f4bbdfcac Mon Sep 17 00:00:00 2001 From: syuchen1 Date: Wed, 27 Oct 2021 18:22:00 -0400 Subject: [PATCH 1/3] added sentry --- server/config/plugins.js | 36 +++++++++---------- server/package.json | 1 + server/yarn.lock | 75 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 18 deletions(-) diff --git a/server/config/plugins.js b/server/config/plugins.js index 6c85082e..0963df48 100644 --- a/server/config/plugins.js +++ b/server/config/plugins.js @@ -1,22 +1,22 @@ -require('dotenv').config({ path: '../.env' }) - +require('dotenv').config({ path: '../.env' }); module.exports = () => ({ - // ... - email: { - provider: 'nodemailer', - providerOptions: { - host: 'smtp-relay.sendinblue.com', - port: 587, - auth: { - user: process.env.EMAIL_SMTP_USER, - pass: process.env.EMAIL_SMTP_PASS, - }, - }, - settings: { - defaultFrom: 'no-reply@casmm.org', - defaultReplyTo: 'no-reply@casmm.org', + email: { + provider: 'nodemailer', + providerOptions: { + host: 'smtp-relay.sendinblue.com', + port: 587, + auth: { + user: process.env.EMAIL_SMTP_USER, + pass: process.env.EMAIL_SMTP_PASS, }, }, - // ... - }) \ No newline at end of file + settings: { + defaultFrom: 'no-reply@casmm.org', + defaultReplyTo: 'no-reply@casmm.org', + }, + }, + sentry: { + dsn: 'https://1211be7d90e04b218083d8a8b760e4d6@o1050432.ingest.sentry.io/6031665', + }, +}); diff --git a/server/package.json b/server/package.json index 231d5a76..d57ddb79 100644 --- a/server/package.json +++ b/server/package.json @@ -22,6 +22,7 @@ "strapi-plugin-content-manager": "3.6.7", "strapi-plugin-content-type-builder": "3.6.7", "strapi-plugin-email": "3.6.7", + "strapi-plugin-sentry": "^3.6.8", "strapi-plugin-users-permissions": "3.6.7", "strapi-provider-email-nodemailer": "^3.6.8", "strapi-utils": "3.6.7" diff --git a/server/yarn.lock b/server/yarn.lock index ac47386b..9a722c29 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -1445,6 +1445,17 @@ "@sentry/utils" "6.3.0" tslib "^1.9.3" +"@sentry/core@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.7.1.tgz#c3aaa6415d06bec65ac446b13b84f073805633e3" + integrity sha512-VAv8OR/7INn2JfiLcuop4hfDcyC7mfL9fdPndQEhlacjmw8gRrgXjR7qyhnCTgzFLkHI7V5bcdIzA83TRPYQpA== + dependencies: + "@sentry/hub" "6.7.1" + "@sentry/minimal" "6.7.1" + "@sentry/types" "6.7.1" + "@sentry/utils" "6.7.1" + tslib "^1.9.3" + "@sentry/hub@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.3.0.tgz#4225b3b0f31fe47f24d80753b257a4b57de5d651" @@ -1454,6 +1465,15 @@ "@sentry/utils" "6.3.0" tslib "^1.9.3" +"@sentry/hub@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.7.1.tgz#d46d24deec67f0731a808ca16796e6765b371bc1" + integrity sha512-eVCTWvvcp6xa0A5GGNHMQEWslmKPlisE5rGmsV/kjvSUv3zSrI0eIDfb51ikdnCiBjHpK2NBWP8Vy8cZOEJegg== + dependencies: + "@sentry/types" "6.7.1" + "@sentry/utils" "6.7.1" + tslib "^1.9.3" + "@sentry/minimal@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.3.0.tgz#e64d87c92a4676a11168672a96589f46985f2b22" @@ -1463,6 +1483,15 @@ "@sentry/types" "6.3.0" tslib "^1.9.3" +"@sentry/minimal@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.7.1.tgz#babf85ee2f167e9dcf150d750d7a0b250c98449c" + integrity sha512-HDDPEnQRD6hC0qaHdqqKDStcdE1KhkFh0RCtJNMCDn0zpav8Dj9AteF70x6kLSlliAJ/JFwi6AmQrLz+FxPexw== + dependencies: + "@sentry/hub" "6.7.1" + "@sentry/types" "6.7.1" + tslib "^1.9.3" + "@sentry/node@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.3.0.tgz#8d55f32930d531b9a2a3b594754392925b1e3816" @@ -1478,6 +1507,21 @@ lru_map "^0.3.3" tslib "^1.9.3" +"@sentry/node@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.7.1.tgz#b09e2eca8e187168feba7bd865a23935bf0f5cc0" + integrity sha512-rtZo1O8ROv4lZwuljQz3iFZW89oXSlgXCG2VqkxQyRspPWu89abROpxLjYzsWwQ8djnur1XjFv51kOLDUTS6Qw== + dependencies: + "@sentry/core" "6.7.1" + "@sentry/hub" "6.7.1" + "@sentry/tracing" "6.7.1" + "@sentry/types" "6.7.1" + "@sentry/utils" "6.7.1" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + "@sentry/tracing@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.3.0.tgz#5da2ce67bb5f9cf4f3aa9b6dff06089478f0c501" @@ -1489,11 +1533,27 @@ "@sentry/utils" "6.3.0" tslib "^1.9.3" +"@sentry/tracing@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.7.1.tgz#b11f0c17a6c5dc14ef44733e5436afb686683268" + integrity sha512-wyS3nWNl5mzaC1qZ2AIp1hjXnfO9EERjMIJjCihs2LWBz1r3efxrHxJHs8wXlNWvrT3KLhq/7vvF5CdU82uPeQ== + dependencies: + "@sentry/hub" "6.7.1" + "@sentry/minimal" "6.7.1" + "@sentry/types" "6.7.1" + "@sentry/utils" "6.7.1" + tslib "^1.9.3" + "@sentry/types@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.3.0.tgz#919cc1870f34b7126546c77e3c695052795d3add" integrity sha512-xWyCYDmFPjS5ex60kxOOHbHEs4vs00qHbm0iShQfjl4OSg9S2azkcWofDmX8Xbn0FSOUXgdPCjNJW1B0bPVhCA== +"@sentry/types@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.7.1.tgz#c8263e1886df5e815570c4668eb40a1cfaa1c88b" + integrity sha512-9AO7HKoip2MBMNQJEd6+AKtjj2+q9Ze4ooWUdEvdOVSt5drg7BGpK221/p9JEOyJAZwEPEXdcMd3VAIMiOb4MA== + "@sentry/utils@6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.3.0.tgz#e28645b6d4acd03a478e58bfe112ea02f81e94a0" @@ -1502,6 +1562,14 @@ "@sentry/types" "6.3.0" tslib "^1.9.3" +"@sentry/utils@6.7.1": + version "6.7.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.7.1.tgz#909184ad580f0f6375e1e4d4a6ffd33dfe64a4d1" + integrity sha512-Tq2otdbWlHAkctD+EWTYKkEx6BL1Qn3Z/imkO06/PvzpWvVhJWQ5qHAzz5XnwwqNHyV03KVzYB6znq1Bea9HuA== + dependencies: + "@sentry/types" "6.7.1" + tslib "^1.9.3" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -9691,6 +9759,13 @@ strapi-plugin-email@3.6.7: strapi-provider-email-sendmail "3.6.7" strapi-utils "3.6.7" +strapi-plugin-sentry@^3.6.8: + version "3.6.8" + resolved "https://registry.yarnpkg.com/strapi-plugin-sentry/-/strapi-plugin-sentry-3.6.8.tgz#f3d1e9ee18f22a13a19676c8cfa5db34457b2596" + integrity sha512-EPS+lq/uSiw4KqtA6P0miqJ2t0GyanQuyuT8wP/CTXnw7nD/k+Wq30jY5xCkzDEXd61Q5RU8oLhOyG3KBCMRpQ== + dependencies: + "@sentry/node" "6.7.1" + strapi-plugin-users-permissions@3.6.7: version "3.6.7" resolved "https://registry.yarnpkg.com/strapi-plugin-users-permissions/-/strapi-plugin-users-permissions-3.6.7.tgz#6a893806c8fba20da5de089e9ec2e892b5e6809e" From c5d97b62c4664c82c6e9b6a655868fd16451ca6e Mon Sep 17 00:00:00 2001 From: syuchen1 Date: Sat, 30 Oct 2021 21:17:31 -0400 Subject: [PATCH 2/3] update sentry env --- server/config/plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/config/plugins.js b/server/config/plugins.js index 0963df48..ea8b7f4e 100644 --- a/server/config/plugins.js +++ b/server/config/plugins.js @@ -17,6 +17,6 @@ module.exports = () => ({ }, }, sentry: { - dsn: 'https://1211be7d90e04b218083d8a8b760e4d6@o1050432.ingest.sentry.io/6031665', + dsn: process.env.SENTRY_DNS || '', }, }); From 6236367ad582ddef34a4f4cf7efb366f412d23d6 Mon Sep 17 00:00:00 2001 From: syuchen1 Date: Sat, 30 Oct 2021 21:47:35 -0400 Subject: [PATCH 3/3] added trace intergration --- server/config/plugins.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/config/plugins.js b/server/config/plugins.js index ea8b7f4e..821f7314 100644 --- a/server/config/plugins.js +++ b/server/config/plugins.js @@ -1,4 +1,6 @@ require('dotenv').config({ path: '../.env' }); +const Sentry = require('@sentry/node'); +const Tracing = require('@sentry/tracing'); module.exports = () => ({ email: { @@ -18,5 +20,7 @@ module.exports = () => ({ }, sentry: { dsn: process.env.SENTRY_DNS || '', + integrations: [new Sentry.Integrations.Http({ tracing: true })], + tracesSampleRate: 1.0, }, });