From 6d5e1b3c17ac7e42fa9bb84e6f1e0e29b8734e25 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Thu, 15 Sep 2022 06:54:02 +0000 Subject: [PATCH] Align sentry configuration of front- and backend --- changes/changelog.d/sentry.feature | 2 +- front/src/init/sentry.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/changes/changelog.d/sentry.feature b/changes/changelog.d/sentry.feature index eda8170f5..c559f62bb 100644 --- a/changes/changelog.d/sentry.feature +++ b/changes/changelog.d/sentry.feature @@ -1 +1 @@ -Add Sentry SDK to collect errors at the backend +Add Sentry SDK to collect #1479 diff --git a/front/src/init/sentry.ts b/front/src/init/sentry.ts index 4fc5fb7f3..54b6fd3b3 100644 --- a/front/src/init/sentry.ts +++ b/front/src/init/sentry.ts @@ -28,7 +28,7 @@ const initSentry = async (app: App, router: Router, store: Store) => }) ], debug: import.meta.env.DEV, - environment: import.meta.env.MODE, + environment: 'front', beforeSend: (event, hint) => { if (event.exception?.values?.some(exception => exception.mechanism?.handled === false) && hint.originalException instanceof Error) { useErrorHandler(hint.originalException, hint.event_id) @@ -36,16 +36,15 @@ const initSentry = async (app: App, router: Router, store: Store) => return event }, - // Set tracesSampleRate to 1.0 to capture 100% - // of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 1.0, + tracesSampleRate: import.meta.env.FUNKWHALE_SENTRY_SR, ignoreErrors: [ // vue3-lazyload throws an error whenever there is a 404 'Image failed to load!' ] }) + Sentry.setTag('mode', import.meta.env.MODE) + watchEffect(() => { const url = store.getters['instance/domain'] Sentry.setTag('instance', url)