mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: lazyload sentry
This commit is contained in:
4 files changed
+43
-31
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
browserApiErrorsIntegration, browserTracingIntegration, captureException, init, replayIntegration, setTag,
|
||||
} from '@sentry/browser';
|
||||
|
||||
init({
|
||||
dsn: UiContext.sentry_dsn,
|
||||
release: `hydro-web@${process.env.VERSION}`,
|
||||
integrations: [
|
||||
browserTracingIntegration(),
|
||||
browserApiErrorsIntegration(),
|
||||
replayIntegration({
|
||||
networkRequestHeaders: ['Content-Type'],
|
||||
networkResponseHeaders: ['Content-Type', 'Location'],
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: 0.1,
|
||||
tracePropagationTargets: ['localhost', /^\//, window.location.host],
|
||||
replaysSessionSampleRate: 0.01,
|
||||
replaysOnErrorSampleRate: 0.1,
|
||||
});
|
||||
setTag('host', window.location.host);
|
||||
setTag('page_name', document.documentElement.getAttribute('data-page'));
|
||||
window.captureException = (e: any) => {
|
||||
if (!e.isUserFacingError) captureException(e);
|
||||
};
|
||||
(window as any)._sentryEvents.forEach(captureException);
|
||||
Reference in new issue
Block a user