diff --git a/.gitignore b/.gitignore index bfba0d1b7..f5b5944ee 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ src/terrasoApi/shared/graphqlSchema # Sentry Config File .sentryclirc + +# Sentry Config File +.sentryclirc diff --git a/local.env.sample b/local.env.sample index 02aa171d0..2a52fd1bd 100644 --- a/local.env.sample +++ b/local.env.sample @@ -4,5 +4,5 @@ REACT_APP_PLAUSIBLE_DOMAIN=app.local.terraso.org REACT_APP_SHARED_DATA_ACCEPTED_EXTENSIONS=csv,doc,docx,pdf,ppt,pptx,xlsx,xls REACT_APP_IMAGE_ACCEPTED_EXTENSIONS=jpeg,jpg REACT_APP_MAPBOX_ACCESS_TOKEN= +REACT_APP_SENTRY_DSN=https://xyz@o4506299756642304.ingest.sentry.io/abcd SENTRY_AUTH_TOKEN=sntrys_eyxxxxxxxxxxx -SENTRY_DSN=https://xyz@o4506299756642304.ingest.sentry.io/abcd diff --git a/package-lock.json b/package-lock.json index a773f7ae5..700305bd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "@mui/material": "^5.15.3", "@mui/x-data-grid": "^6.19.1", "@reduxjs/toolkit": "^1.9.7", - "@sentry/cli": "^2.22.3", - "@sentry/react": "^7.102.1", + "@sentry/cli": "^2.28.6", + "@sentry/react": "^7.103.0", "@turf/bbox": "^6.5.0", "@turf/center": "^6.5.0", "@turf/helpers": "^6.5.0", @@ -6656,66 +6656,67 @@ "dev": true }, "node_modules/@sentry-internal/feedback": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.102.1.tgz", - "integrity": "sha512-vY4hpLLMNLjICtWiizc7KeGbWOTUMGrF7C+9dPCztZww3CLgzWy9A7DvPj5hodRiYzpdRnAMl8yQnMFbYXh7bA==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.103.0.tgz", + "integrity": "sha512-2nYoCfP7FpiUR+xxO5y5BL2ajHrhM4fL7HSup6QKNn7gI7vLyllYOOuYFNHhSmsXCD0i00U8DBClGLcn+6DQqw==", "dependencies": { - "@sentry/core": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry/core": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=12" } }, "node_modules/@sentry-internal/replay-canvas": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.102.1.tgz", - "integrity": "sha512-GUX4RWI10uRjdjeyvCLtAAhWRVqnAnG6+yNxWfqUQ3qMA7B7XxG43KT2UhSnulmErNzODQ6hA68rGPwwYeRIww==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.103.0.tgz", + "integrity": "sha512-EyDRMdlSqtwY8zGFhOWwl+nwwo98hlhJz+bpF5PQ6VmFpbplh6Wqfx2p+cPXQr40TGMMC4+vPFlSWTOMjcO9zQ==", "dependencies": { - "@sentry/core": "7.102.1", - "@sentry/replay": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry/core": "7.103.0", + "@sentry/replay": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=12" } }, "node_modules/@sentry-internal/tracing": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.102.1.tgz", - "integrity": "sha512-RkFlFyAC0fQOvBbBqnq0CLmFW5m3JJz9pKbZd5vXPraWAlniKSb1bC/4DF9SlNx0FN1LWG+IU3ISdpzwwTeAGg==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.103.0.tgz", + "integrity": "sha512-sZ/Wao8HOvGaBs7WlOdflMpHGAFkOBWL6hBiirHaOy5d+IDm7n7et5U6zhvcfiyYBO4nY36gy1Tg5mw+aNO0Vw==", "dependencies": { - "@sentry/core": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry/core": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=8" } }, "node_modules/@sentry/browser": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.102.1.tgz", - "integrity": "sha512-7BOfPBiM7Kp6q/iy0JIbsBTxIASV+zWXByqqjuEMWGj3X2u4oRIfm3gv4erPU/l+CORQUVQZLSPGoIoM1gbB/A==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.103.0.tgz", + "integrity": "sha512-lP3Oplnwo1lY8ltk8SWzQURbxnSfVhYA099mVs1T95sdwXS16Za6SX7Ld/9T506ZW/WyoU4VCq7eKtG2kPFhMQ==", "dependencies": { - "@sentry-internal/feedback": "7.102.1", - "@sentry-internal/replay-canvas": "7.102.1", - "@sentry-internal/tracing": "7.102.1", - "@sentry/core": "7.102.1", - "@sentry/replay": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry-internal/feedback": "7.103.0", + "@sentry-internal/replay-canvas": "7.103.0", + "@sentry-internal/tracing": "7.103.0", + "@sentry/core": "7.103.0", + "@sentry/replay": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=8" } }, "node_modules/@sentry/cli": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.22.3.tgz", - "integrity": "sha512-VFHdtrHsMyTRSZhDLeMyXvit7xB4e81KugIEwMve95c7h5HO672bfmCcM/403CAugj4NzvQ+IR2NKF/2SsEPlg==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.28.6.tgz", + "integrity": "sha512-o2Ngz7xXuhwHxMi+4BFgZ4qjkX0tdZeOSIZkFAGnTbRhQe5T8bxq6CcQRLdPhqMgqvDn7XuJ3YlFtD3ZjHvD7g==", + "hasInstallScript": true, "dependencies": { "https-proxy-agent": "^5.0.0", "node-fetch": "^2.6.7", @@ -6730,19 +6731,19 @@ "node": ">= 10" }, "optionalDependencies": { - "@sentry/cli-darwin": "2.22.3", - "@sentry/cli-linux-arm": "2.22.3", - "@sentry/cli-linux-arm64": "2.22.3", - "@sentry/cli-linux-i686": "2.22.3", - "@sentry/cli-linux-x64": "2.22.3", - "@sentry/cli-win32-i686": "2.22.3", - "@sentry/cli-win32-x64": "2.22.3" + "@sentry/cli-darwin": "2.28.6", + "@sentry/cli-linux-arm": "2.28.6", + "@sentry/cli-linux-arm64": "2.28.6", + "@sentry/cli-linux-i686": "2.28.6", + "@sentry/cli-linux-x64": "2.28.6", + "@sentry/cli-win32-i686": "2.28.6", + "@sentry/cli-win32-x64": "2.28.6" } }, "node_modules/@sentry/cli-darwin": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.22.3.tgz", - "integrity": "sha512-A1DwFTffg3+fF68qujaJI07dk/1H1pRuihlvS5WQ9sD7nQLnXZGoLUht4eULixhDzZYinWHKkcWzQ6k40UTvNA==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.28.6.tgz", + "integrity": "sha512-KRf0VvTltHQ5gA7CdbUkaIp222LAk/f1+KqpDzO6nB/jC/tL4sfiy6YyM4uiH6IbVEudB8WpHCECiatmyAqMBA==", "optional": true, "os": [ "darwin" @@ -6752,9 +6753,9 @@ } }, "node_modules/@sentry/cli-linux-arm": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.22.3.tgz", - "integrity": "sha512-mDtLVbqbCu/5b/v2quTAMzY/atGlJVvrqO2Wvpro0Jb/LYhn7Y1pVBdoXEDcnOX82/pseFkLT8PFfq/OcezPhA==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.28.6.tgz", + "integrity": "sha512-ANG7U47yEHD1g3JrfhpT4/MclEvmDZhctWgSP5gVw5X4AlcI87E6dTqccnLgvZjiIAQTaJJAZuSHVVF3Jk403w==", "cpu": [ "arm" ], @@ -6768,9 +6769,9 @@ } }, "node_modules/@sentry/cli-linux-arm64": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.22.3.tgz", - "integrity": "sha512-PnBPb4LJ+A2LlqLjtVFn4mEizcVdxBSLZvB85pEGzq9DRXjZ6ZEuGWFHTVnWvjd79TB/s0me29QnLc3n4B6lgA==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.28.6.tgz", + "integrity": "sha512-caMDt37FI752n4/3pVltDjlrRlPFCOxK4PHvoZGQ3KFMsai0ZhE/0CLBUMQqfZf0M0r8KB2x7wqLm7xSELjefQ==", "cpu": [ "arm64" ], @@ -6784,9 +6785,9 @@ } }, "node_modules/@sentry/cli-linux-i686": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.22.3.tgz", - "integrity": "sha512-wxvbpQ2hiw4hwJWfJMp7K45BV40nXL62f91jLuftFXIbieKX1Li57NNKNu2JUVn7W1bJxkwz/PKGGTXSgeJlRw==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.28.6.tgz", + "integrity": "sha512-Tj1+GMc6lFsDRquOqaGKXFpW9QbmNK4TSfynkWKiJxdTEn5jSMlXXfr0r9OQrxu3dCCqEHkhEyU63NYVpgxIPw==", "cpu": [ "x86", "ia32" @@ -6801,9 +6802,9 @@ } }, "node_modules/@sentry/cli-linux-x64": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.22.3.tgz", - "integrity": "sha512-0GxsYNO5GyRWifeOpng+MmdUFZRA64bgA1n1prsEsXnoeLcm3Zj4Q63hBZmiwz9Qbhf5ibohkpf94a7dI7pv3A==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.28.6.tgz", + "integrity": "sha512-Dt/Xz784w/z3tEObfyJEMmRIzn0D5qoK53H9kZ6e0yNvJOSKNCSOq5cQk4n1/qeG0K/6SU9dirmvHwFUiVNyYg==", "cpu": [ "x64" ], @@ -6817,9 +6818,9 @@ } }, "node_modules/@sentry/cli-win32-i686": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.22.3.tgz", - "integrity": "sha512-YERPsd7ClBrxKcmCUw+ZrAvQfbyIZFrqh269hgDuXFodpsB7LPGnI33ilo0uzmKdq2vGppTb6Z3gf1Rbq0Hadg==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.28.6.tgz", + "integrity": "sha512-zkpWtvY3kt+ogVaAbfFr2MEkgMMHJNJUnNMO8Ixce9gh38sybIkDkZNFnVPBXMClJV0APa4QH0EwumYBFZUMuQ==", "cpu": [ "x86", "ia32" @@ -6833,9 +6834,9 @@ } }, "node_modules/@sentry/cli-win32-x64": { - "version": "2.22.3", - "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.22.3.tgz", - "integrity": "sha512-NUh56xWvgJo2KuC9lI6o6nTPXdzbpQUB4qGwJ73L9NP3HT2P1I27jtHyrC2zlXTVlYE23gQZGrL3wgW4Jy80QA==", + "version": "2.28.6", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.28.6.tgz", + "integrity": "sha512-TG2YzZ9JMeNFzbicdr5fbtsusVGACbrEfHmPgzWGDeLUP90mZxiMTjkXsE1X/5jQEQjB2+fyfXloba/Ugo51hA==", "cpu": [ "x64" ], @@ -6871,26 +6872,26 @@ } }, "node_modules/@sentry/core": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.102.1.tgz", - "integrity": "sha512-QjY+LSP3du3J/C8x/FfEbRxgZgsWd0jfTJ4P7s9f219I1csK4OeBMC3UA1HwEa0pY/9OF6H/egW2CjOcMM5Pdg==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.103.0.tgz", + "integrity": "sha512-LCI+PIDoF/RLqN41fNXum3ilmS6ukni6L7t38vSdibbe2G0804EbPLtOIpv2PkS8E6CFuRW5zOb+8OwEAAtZWw==", "dependencies": { - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=8" } }, "node_modules/@sentry/react": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.102.1.tgz", - "integrity": "sha512-X4j2DgbktlEifnd21YJKCayAmff5hnaS+9MNz9OonEwD0ARi0ks7bo0wtWHMjPK20992MO+JwczVg/1BXJYDdQ==", - "dependencies": { - "@sentry/browser": "7.102.1", - "@sentry/core": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.103.0.tgz", + "integrity": "sha512-EyWZi9u94RShzAK/vpkXNCdkocMtb98AbxRZOjuFL+pf4jjwxdPRekGGzXz7St0cf56Mv3oHNk6QGDA0PF7mlQ==", + "dependencies": { + "@sentry/browser": "7.103.0", + "@sentry/core": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0", "hoist-non-react-statics": "^3.3.2" }, "engines": { @@ -6901,33 +6902,33 @@ } }, "node_modules/@sentry/replay": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.102.1.tgz", - "integrity": "sha512-HR/j9dGIvbrId8fh8mQlODx7JrhRmawEd9e9P3laPtogWCg/5TI+XPb2VGSaXOX9VWtb/6Z2UjHsaGjgg6YcuA==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.103.0.tgz", + "integrity": "sha512-I37komyb+DruQG8lPPPOFxLLbOijNXeTxiWLsIn+KFZqRtKqxxQWdNnk56V4YSTpFzxnMEFMRCpXhncuTWu4LA==", "dependencies": { - "@sentry-internal/tracing": "7.102.1", - "@sentry/core": "7.102.1", - "@sentry/types": "7.102.1", - "@sentry/utils": "7.102.1" + "@sentry-internal/tracing": "7.103.0", + "@sentry/core": "7.103.0", + "@sentry/types": "7.103.0", + "@sentry/utils": "7.103.0" }, "engines": { "node": ">=12" } }, "node_modules/@sentry/types": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.102.1.tgz", - "integrity": "sha512-htKorf3t/D0XYtM7foTcmG+rM47rDP6XdbvCcX5gBCuCYlzpM1vqCt2rl3FLktZC6TaIpFRJw1TLfx6m+x5jdA==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.103.0.tgz", + "integrity": "sha512-NCvKyx8d2AGBQKPARrJemZmZ16DiMo688OEikZg4BbvFNDUzK5Egm2BH0vfLDhbNkU19o3maJowrYo42m8r9Zw==", "engines": { "node": ">=8" } }, "node_modules/@sentry/utils": { - "version": "7.102.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.102.1.tgz", - "integrity": "sha512-+8WcFjHVV/HROXSAwMuUzveElBFC43EiTG7SNEBNgOUeQzQVTmbUZXyTVgLrUmtoWqvnIxCacoLxtZo1o67kdg==", + "version": "7.103.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.103.0.tgz", + "integrity": "sha512-phkUJt3F0UOkVq+M4GfdAh2ewI3ASrNiJddx9aO7GnT0aDwwVBHZltnqt95qgAB8W+BipTSt1dAh8yUbbq1Ceg==", "dependencies": { - "@sentry/types": "7.102.1" + "@sentry/types": "7.103.0" }, "engines": { "node": ">=8" diff --git a/package.json b/package.json index f9e06fc0c..ce54309af 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "@mui/material": "^5.15.3", "@mui/x-data-grid": "^6.19.1", "@reduxjs/toolkit": "^1.9.7", - "@sentry/cli": "^2.22.3", - "@sentry/react": "^7.102.1", + "@sentry/cli": "^2.28.6", + "@sentry/react": "^7.103.0", "@turf/bbox": "^6.5.0", "@turf/center": "^6.5.0", "@turf/helpers": "^6.5.0", diff --git a/src/config.ts b/src/config.ts index f63ece3ad..1eb383cc9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -34,7 +34,7 @@ export const COOKIES_DOMAIN = const COOKIES_PARAMS = { path: '/', domain: COOKIES_DOMAIN }; -export const SENTRY_DSN = process.env.SENTRY_DSN; +export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN || ''; setAPIConfig({ terrasoAPIURL: TERRASO_API_URL, diff --git a/src/index.js b/src/index.js index dc1cf1956..ec9e35e9c 100644 --- a/src/index.js +++ b/src/index.js @@ -38,17 +38,25 @@ Sentry.init({ dsn: SENTRY_DSN, environment: TERRASO_ENV, integrations: [ - new Sentry.BrowserTracing({ - // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/], + // See docs for support of different versions of variation of react router + // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/ + Sentry.reactRouterV6BrowserTracingIntegration({ + useEffect: React.useEffect, }), - new Sentry.Replay(), + Sentry.replayIntegration(), ], - // Performance Monitoring - tracesSampleRate: 1.0, // Capture 100% of the transactions - // Session Replay - replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. - replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ['127.0.0.1', /^https:\/\/terraso\.org/], + + // Capture Replay for 10% of all sessions, + // plus for 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, }); createRoot(document.getElementById('root')).render(