mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
* fix: keep the default Sentry filters when the app config extends them The app config replaced ignoreErrors and beforeSend instead of extending them, so deployments that set their own dropped Baserow's silenced error patterns, the handled API error filter and the private link redaction. * fix: preserve Sentry redaction across app hooks
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { useRuntimeConfig, useAppConfig, useRouter } from '#imports'
|
|
import { buildSentryConfig } from './modules/core/utils/sentryConfig'
|
|
import { addReplayOutsidePrivateLinks } from './modules/core/utils/templatePrivateLink'
|
|
import {
|
|
getReplayOptions,
|
|
isPublishedSite,
|
|
} from './modules/core/utils/publishedSite'
|
|
import * as Sentry from '@sentry/nuxt'
|
|
|
|
const config = useRuntimeConfig()
|
|
const appConfig = useAppConfig()
|
|
|
|
if (config.public.sentryDsn) {
|
|
const finalConfig = buildSentryConfig({
|
|
publicConfig: config.public,
|
|
tracingIntegration: Sentry.browserTracingIntegration({
|
|
router: useRouter(),
|
|
}),
|
|
userConfig: appConfig.sentry?.config,
|
|
isDev: import.meta.dev,
|
|
})
|
|
|
|
Sentry.init(finalConfig)
|
|
|
|
// Session replay is large, so it's only downloaded when replays are recorded,
|
|
// and loaded after init so that it doesn't block the page.
|
|
if (finalConfig.replaysOnErrorSampleRate > 0) {
|
|
addReplayOutsidePrivateLinks({
|
|
router: useRouter(),
|
|
loadReplayIntegration: () =>
|
|
import('@sentry/replay').then((module) => module.replayIntegration),
|
|
addIntegration: Sentry.addIntegration,
|
|
replayOptions: getReplayOptions({
|
|
publishedSite: isPublishedSite(window.location.hostname, config.public),
|
|
}),
|
|
})
|
|
}
|
|
}
|