fix: add Sentry RewriteFrames integration (#4210)

This commit is contained in:
Nico Domino 2024-07-01 13:38:15 +02:00 committed by GitHub
parent d4c0b97f7d
commit 9aac60b1e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,19 @@
import { startSpan, setUser, type Span, init } from '@sentry/sveltekit';
import * as Sentry from '@sentry/sveltekit';
import { type Span } from '@sentry/sveltekit';
import type { User } from '$lib/stores/user';
import { dev } from '$app/environment';
import { PUBLIC_SENTRY_ENVIRONMENT } from '$env/static/public';
const { startSpan, setUser, init, rewriteFramesIntegration } = Sentry;
export function initSentry() {
init({
enabled: !dev,
dsn: 'https://a35bbd6688a3a8f76e4956c6871f414a@o4504644069687296.ingest.sentry.io/4505976067129344',
environment: PUBLIC_SENTRY_ENVIRONMENT,
tracesSampleRate: 0.1,
tracePropagationTargets: ['localhost', /gitbutler\.com/i]
tracePropagationTargets: ['localhost', /gitbutler\.com/i],
integrations: [rewriteFramesIntegration()]
});
}