mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat: sentry
This commit is contained in:
1 parent
d5261290f3
commit
83b7ebcb44
5 files changed
+240
-8
No files matched your search
Vendored
+1
@@ -3,4 +3,5 @@
|
||||
interface Window {
|
||||
GOOGLE_ANALYTICS: string | false;
|
||||
VERCEL_ANALYTICS_ID: string | false;
|
||||
SENTRY_DSN: string | false;
|
||||
}
|
||||
@@ -11,10 +11,13 @@
|
||||
import { Progress, Notifications } from '$lib/layout';
|
||||
import { loading } from './store';
|
||||
import Loading from './loading.svelte';
|
||||
import * as Sentry from '@sentry/svelte';
|
||||
import { BrowserTracing } from '@sentry/tracing';
|
||||
|
||||
if (browser) {
|
||||
window.VERCEL_ANALYTICS_ID = import.meta.env.VERCEL_ANALYTICS_ID?.toString() ?? false;
|
||||
window.GOOGLE_ANALYTICS = import.meta.env.VITE_GOOGLE_ANALYTICS?.toString() ?? false;
|
||||
window.SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN?.toString() ?? false;
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
@@ -30,6 +33,17 @@
|
||||
onTTFB(reportWebVitals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sentry Error Logging
|
||||
*/
|
||||
if (!dev && window.SENTRY_DSN) {
|
||||
Sentry.init({
|
||||
dsn: window.SENTRY_DSN,
|
||||
integrations: [new BrowserTracing()],
|
||||
tracesSampleRate: 1.0
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle initial load.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user