From 1434b0ccc8ccff17d8bdb673ed42267fbb41c78f Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Tue, 19 Dec 2023 09:35:44 -0500 Subject: [PATCH 1/5] Update vue sentry sdk - Rename `tracingOrigins` to `tracePropagationTargets` (https://docs.sentry.io/platforms/javascript/guides/nextjs/performance/instrumentation/automatic-instrumentation/#tracepropagationtargets) - Remove deprecated package (https://github.com/getsentry/sentry-javascript/blob/7.47.0/MIGRATION.md/#remove-requirement-for-sentrytracing-package-since-7460) --- web/package.json | 5 +- web/src/main.ts | 6 +- web/yarn.lock | 151 ++++++++++++++++++++++++----------------------- 3 files changed, 82 insertions(+), 80 deletions(-) diff --git a/web/package.json b/web/package.json index df715be90..9cf57db61 100644 --- a/web/package.json +++ b/web/package.json @@ -12,9 +12,8 @@ "@apidevtools/json-schema-ref-parser": "^9.0.7", "@girder/oauth-client": "^0.8.0", "@koumoul/vjsf": "^2.21.4", - "@sentry/integrations": "^7.13.0", - "@sentry/tracing": "^7.13.0", - "@sentry/vue": "^7.13.0", + "@sentry/integrations": "^7.88.0", + "@sentry/vue": "^7.88.0", "ajv": "^8.12.0", "axios": "^0.21.2", "dompurify": "^3.0.1", diff --git a/web/src/main.ts b/web/src/main.ts index 7bde5327d..242501cd3 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -6,7 +6,6 @@ import VueSocialSharing from 'vue-social-sharing'; // @ts-ignore missing definitions import * as Sentry from '@sentry/vue'; import { CaptureConsole } from '@sentry/integrations'; -import { BrowserTracing } from '@sentry/tracing'; // Import plugins first (order may matter) import pinia from '@/plugins/pinia'; @@ -23,13 +22,14 @@ Sentry.init({ dsn: import.meta.env.VITE_APP_SENTRY_DSN, environment: import.meta.env.VITE_APP_SENTRY_ENVIRONMENT, integrations: [ - new BrowserTracing({ - tracingOrigins: [import.meta.env.VITE_APP_DANDI_API_ROOT || ''], + new Sentry.BrowserTracing({ + routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), new CaptureConsole({ levels: ['error'], }), ], + tracePropagationTargets: [import.meta.env.VITE_APP_DANDI_API_ROOT || ''], tracesSampleRate: 0.01, trackComponents: true, }); diff --git a/web/yarn.lock b/web/yarn.lock index 1fcd90e35..672562091 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -248,82 +248,85 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz#5f1b518ec5fa54437c0b7c4a821546c64fed6922" integrity sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA== -"@sentry-internal/tracing@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.77.0.tgz#f3d82486f8934a955b3dd2aa54c8d29586e42a37" - integrity sha512-8HRF1rdqWwtINqGEdx8Iqs9UOP/n8E0vXUu3Nmbqj4p5sQPA7vvCfq+4Y4rTqZFc7sNdFpDsRION5iQEh8zfZw== - dependencies: - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" - -"@sentry/browser@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.77.0.tgz#155440f1a0d3a1bbd5d564c28d6b0c9853a51d72" - integrity sha512-nJ2KDZD90H8jcPx9BysQLiQW+w7k7kISCWeRjrEMJzjtge32dmHA8G4stlUTRIQugy5F+73cOayWShceFP7QJQ== - dependencies: - "@sentry-internal/tracing" "7.77.0" - "@sentry/core" "7.77.0" - "@sentry/replay" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" - -"@sentry/core@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.77.0.tgz#21100843132beeeff42296c8370cdcc7aa1d8510" - integrity sha512-Tj8oTYFZ/ZD+xW8IGIsU6gcFXD/gfE+FUxUaeSosd9KHwBQNOLhZSsYo/tTVf/rnQI/dQnsd4onPZLiL+27aTg== - dependencies: - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" - -"@sentry/integrations@^7.13.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.77.0.tgz#f2717e05cb7c69363316ccd34096b2ea07ae4c59" - integrity sha512-P055qXgBHeZNKnnVEs5eZYLdy6P49Zr77A1aWJuNih/EenzMy922GOeGy2mF6XYrn1YJSjEwsNMNsQkcvMTK8Q== - dependencies: - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" +"@sentry-internal/feedback@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.88.0.tgz#fa4db4a27d1fa7fe51dc67af185b13519d7fbc76" + integrity sha512-lbK6jgO1I0M96nZQ99mcLSZ55ebwPAP6LhEWhkmc+eAfy97VpiY+qsbmgsmOzCEPqMmEUCEcI0rEZ7fiye2v2Q== + dependencies: + "@sentry/core" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" + +"@sentry-internal/tracing@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.88.0.tgz#c820bde835c4af576781f8b818eed5085e417927" + integrity sha512-xXQdcYhsS+ourzJHjXNjZC9zakuc97udmpgaXRjEP7FjPYclIx+YXwgFBdHM2kzAwZLFOsEce5dr46GVXUDfZw== + dependencies: + "@sentry/core" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" + +"@sentry/browser@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.88.0.tgz#80e3afe00e19bffbed09be392061e64dd6196796" + integrity sha512-il4x3PB99nuU/OJQw2RltgYYbo8vtnYoIgneOeEiw4m0ppK1nKkMkd3vDRipGL6E/0i7IUmQfYYy6U10J5Rx+g== + dependencies: + "@sentry-internal/feedback" "7.88.0" + "@sentry-internal/tracing" "7.88.0" + "@sentry/core" "7.88.0" + "@sentry/replay" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" + +"@sentry/core@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.88.0.tgz#46f1526e9b98de96a0e93fd69917a990db5d5a37" + integrity sha512-Jzbb7dcwiCO7kI0a1w+32UzWxbEn2OcZWzp55QMEeAh6nZ/5CXhXwpuHi0tW7doPj+cJdmxMTMu9LqMVfdGkzQ== + dependencies: + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" + +"@sentry/integrations@^7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.88.0.tgz#38179405ff6673a9526cebbea656c7c6c69ccd06" + integrity sha512-YBYPAtJeylMaaCmGntgiDpp1nk3IT6+FBXsmHxMdTKlrpt5ELj/jcc8gEgaRNeSBjx4Kv1OVzmZcYyWwEhkR4Q== + dependencies: + "@sentry/core" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" localforage "^1.8.1" -"@sentry/replay@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.77.0.tgz#21d242c9cd70a7235237216174873fd140b6eb80" - integrity sha512-M9Ik2J5ekl+C1Och3wzLRZVaRGK33BlnBwfwf3qKjgLDwfKW+1YkwDfTHbc2b74RowkJbOVNcp4m8ptlehlSaQ== - dependencies: - "@sentry-internal/tracing" "7.77.0" - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" - -"@sentry/tracing@^7.13.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.77.0.tgz#39d7c30834f503fe9eb20ce1c8c8bd28f7d7c9ce" - integrity sha512-zr6eSCW3NJ124uj4Fy/6hh77cziy43dpYE1WpgvO/yhl1+kdrY2XVJ0bXGqwHU0KBm/eSgHD7yecUxmZUXiabA== - dependencies: - "@sentry-internal/tracing" "7.77.0" - -"@sentry/types@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.77.0.tgz#c5d00fe547b89ccde59cdea59143bf145cee3144" - integrity sha512-nfb00XRJVi0QpDHg+JkqrmEBHsqBnxJu191Ded+Cs1OJ5oPXEW6F59LVcBScGvMqe+WEk1a73eH8XezwfgrTsA== - -"@sentry/utils@7.77.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.77.0.tgz#1f88501f0b8777de31b371cf859d13c82ebe1379" - integrity sha512-NmM2kDOqVchrey3N5WSzdQoCsyDkQkiRxExPaNI2oKQ/jMWHs9yt0tSy7otPBcXs0AP59ihl75Bvm1tDRcsp5g== - dependencies: - "@sentry/types" "7.77.0" - -"@sentry/vue@^7.13.0": - version "7.77.0" - resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-7.77.0.tgz#044c9e0853bbb17c0440d86934da666a1e3acf3e" - integrity sha512-mYGkahnLAL9t3XKTTonHC+cv5EN/hjlW4tCRMiOVbR3eN3hXTtFCc4bKC5lHGLTLhx4U7Flc7JXmajw3tJOLBQ== - dependencies: - "@sentry/browser" "7.77.0" - "@sentry/core" "7.77.0" - "@sentry/types" "7.77.0" - "@sentry/utils" "7.77.0" +"@sentry/replay@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.88.0.tgz#a9158af527db0cce91659f9a87b938040c21fdaa" + integrity sha512-em5dPKLPG7c/HGDbpIj3aHrWbA4iMwqjevqTzn+++KNO1YslkOosCaGsb1whU3AL1T9c3aIFIhZ4u3rNo+DxcA== + dependencies: + "@sentry-internal/tracing" "7.88.0" + "@sentry/core" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" + +"@sentry/types@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.88.0.tgz#b3a09733a7bfad3634687b77764c5767d646d6e7" + integrity sha512-FvwvmX1pWAZKicPj4EpKyho8Wm+C4+r5LiepbbBF8oKwSPJdD2QV1fo/LWxsrzNxWOllFIVIXF5Ed3nPYQWpTw== + +"@sentry/utils@7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.88.0.tgz#704e79f14047080564c3e5231028f1cef8824e9f" + integrity sha512-ukminfRmdBXTzk49orwJf3Lu3hR60ZRHjE2a4IXwYhyDT6JJgJqgsq1hzGXx0AyFfyS4WhfZ6QUBy7fu3BScZQ== + dependencies: + "@sentry/types" "7.88.0" + +"@sentry/vue@^7.88.0": + version "7.88.0" + resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-7.88.0.tgz#9d3ecce154923e737df3208dc12c402320d3c191" + integrity sha512-mXCz+c0SVqtGLTt5IBK4MXlLCsEWZONQsiWY+cbIcyl1PseI4aDRTPYFQJa4ezKWR2ochxv3VwUQUj6AzJSm/g== + dependencies: + "@sentry/browser" "7.88.0" + "@sentry/core" "7.88.0" + "@sentry/types" "7.88.0" + "@sentry/utils" "7.88.0" "@tsconfig/node10@^1.0.7": version "1.0.9" From 41d5540f48fbfa78ddd46ca4c7d82a0e1eba73bf Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Tue, 19 Dec 2023 10:01:00 -0500 Subject: [PATCH 2/5] Enable `attachProps` This will include a component's props in sentry error traces. --- web/src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/main.ts b/web/src/main.ts index 242501cd3..8d9c58932 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -32,6 +32,7 @@ Sentry.init({ tracePropagationTargets: [import.meta.env.VITE_APP_DANDI_API_ROOT || ''], tracesSampleRate: 0.01, trackComponents: true, + attachProps: true, }); Vue.use(VueGtag, { From 4f59c09c8e68878fb081a9e0b63902e389726dce Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Tue, 19 Dec 2023 14:23:39 -0500 Subject: [PATCH 3/5] Add comments for each sentry option --- web/src/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/main.ts b/web/src/main.ts index 8d9c58932..508d640ee 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -30,8 +30,12 @@ Sentry.init({ }), ], tracePropagationTargets: [import.meta.env.VITE_APP_DANDI_API_ROOT || ''], + + // Capture 1% of traces for Sentry performance tracesSampleRate: 0.01, + // Capture extra data about Vue components trackComponents: true, + // Capture info about Vue component props attachProps: true, }); From d46a4daf5bc55d949d900425dfebc4e27a95bcc2 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Tue, 19 Dec 2023 10:00:29 -0500 Subject: [PATCH 4/5] Enable sentry replay --- web/src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/main.ts b/web/src/main.ts index 508d640ee..1fb5e453f 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -28,6 +28,7 @@ Sentry.init({ new CaptureConsole({ levels: ['error'], }), + new Sentry.Replay(), ], tracePropagationTargets: [import.meta.env.VITE_APP_DANDI_API_ROOT || ''], @@ -37,6 +38,11 @@ Sentry.init({ trackComponents: true, // Capture info about Vue component props attachProps: true, + + // Capture Replay for 10% of all sessions, + // plus for 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, }); Vue.use(VueGtag, { From 2dbb39e12fdcc59f4916bb41c6f4f91f71481a19 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Tue, 19 Dec 2023 15:17:43 -0500 Subject: [PATCH 5/5] Add missing `Vue` instance to sentry init --- web/src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/main.ts b/web/src/main.ts index 1fb5e453f..d19cb2e1a 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -19,6 +19,7 @@ import App from '@/App.vue'; import router from '@/router'; Sentry.init({ + Vue, dsn: import.meta.env.VITE_APP_SENTRY_DSN, environment: import.meta.env.VITE_APP_SENTRY_ENVIRONMENT, integrations: [