refactor: move umami and sentry to server side
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
|
||||
const dsn = process.env.SENTRY_DSN;
|
||||
// We use a placeholder DSN on the client because the real DSN is injected
|
||||
// by our server-side relay at /errors/api/relay.
|
||||
// This keeps our environment clean of NEXT_PUBLIC_ variables.
|
||||
const CLIENT_DSN = 'https://public@errors.infra.mintel.me/1';
|
||||
|
||||
Sentry.init({
|
||||
dsn,
|
||||
enabled: Boolean(dsn),
|
||||
dsn: CLIENT_DSN,
|
||||
// Relay events through our own server to hide the real DSN and bypass ad-blockers
|
||||
tunnel: '/errors/api/relay',
|
||||
|
||||
// Enable even if no DSN is provided, because we have the tunnel
|
||||
enabled: true,
|
||||
|
||||
tracesSampleRate: 0,
|
||||
// AdjustingreplaysOnErrorSampleRate to 1.0 to capture 100% of errors with replays if enabled
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
replaysSessionSampleRate: 0.1,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user