Align sentry configuration of front- and backend

This commit is contained in:
Georg Krause 2022-09-15 06:54:02 +00:00
parent b41d77beb5
commit 6d5e1b3c17
2 changed files with 5 additions and 6 deletions

View File

@ -1 +1 @@
Add Sentry SDK to collect errors at the backend Add Sentry SDK to collect #1479

View File

@ -28,7 +28,7 @@ const initSentry = async (app: App, router: Router, store: Store<RootState>) =>
}) })
], ],
debug: import.meta.env.DEV, debug: import.meta.env.DEV,
environment: import.meta.env.MODE, environment: 'front',
beforeSend: (event, hint) => { beforeSend: (event, hint) => {
if (event.exception?.values?.some(exception => exception.mechanism?.handled === false) && hint.originalException instanceof Error) { if (event.exception?.values?.some(exception => exception.mechanism?.handled === false) && hint.originalException instanceof Error) {
useErrorHandler(hint.originalException, hint.event_id) useErrorHandler(hint.originalException, hint.event_id)
@ -36,16 +36,15 @@ const initSentry = async (app: App, router: Router, store: Store<RootState>) =>
return event return event
}, },
// Set tracesSampleRate to 1.0 to capture 100% tracesSampleRate: import.meta.env.FUNKWHALE_SENTRY_SR,
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
ignoreErrors: [ ignoreErrors: [
// vue3-lazyload throws an error whenever there is a 404 // vue3-lazyload throws an error whenever there is a 404
'Image failed to load!' 'Image failed to load!'
] ]
}) })
Sentry.setTag('mode', import.meta.env.MODE)
watchEffect(() => { watchEffect(() => {
const url = store.getters['instance/domain'] const url = store.getters['instance/domain']
Sentry.setTag('instance', url) Sentry.setTag('instance', url)