Merge branch 'main' of https://github.com/gitroomhq/postiz-app
This commit is contained in:
commit
f3c2a1f2f4
|
|
@ -35,7 +35,7 @@ export const initializeSentry = (appName: string, allowLogs = false) => {
|
|||
enableLogs: true,
|
||||
|
||||
// Profiling
|
||||
profileSessionSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.35,
|
||||
profileSessionSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.45,
|
||||
profileLifecycle: 'trace',
|
||||
});
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -19,5 +19,5 @@ export const initializeSentryClient = (environment: string, dsn: string) =>
|
|||
replaysSessionSampleRate: environment === 'development' ? 1.0 : 0.5,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
|
||||
profilesSampleRate: environment === 'development' ? 1.0 : 0.2,
|
||||
profilesSampleRate: environment === 'development' ? 1.0 : 0.45,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,6 +26,26 @@ export const initializeSentryBasic = (environment: string, dsn: string, extensio
|
|||
...extension,
|
||||
debug: environment === 'development',
|
||||
tracesSampleRate: environment === 'development' ? 1.0 : 0.3,
|
||||
|
||||
// Filtert Events und zeigt das User-Feedback-Modal an
|
||||
beforeSend(event, hint) {
|
||||
if (event.exception && event.exception.values) {
|
||||
for (const exception of event.exception.values) {
|
||||
// Filtert "Failed to fetch" Fehler heraus
|
||||
if (exception.value && /Failed to fetch/.test(exception.value)) {
|
||||
return null; // Verwirft den Event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn der Event eine Ausnahme ist und nicht gefiltert wurde,
|
||||
// wird das User-Feedback-Modal angezeigt
|
||||
if (event.exception && event.event_id) {
|
||||
Sentry.showReportDialog({ eventId: event.event_id });
|
||||
}
|
||||
|
||||
return event; // Sendet den Event an Sentry
|
||||
},
|
||||
});
|
||||
} catch (err) {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue