mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修复 shell 变量初始化检查,更新 sentry 版本
This commit is contained in:
+20
-7
@@ -1,27 +1,40 @@
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { loader } from '@monaco-editor/react';
|
||||
import config from './config';
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
createRoutesFromChildren,
|
||||
matchRoutes,
|
||||
useLocation,
|
||||
useNavigationType,
|
||||
} from 'react-router-dom';
|
||||
|
||||
export function init(version: string) {
|
||||
// sentry监控 init
|
||||
Sentry.init({
|
||||
dsn: 'https://49b9ad1a6201bfe027db296ab7c6d672@o1098464.ingest.sentry.io/6122818',
|
||||
integrations: [
|
||||
new Sentry.BrowserTracing({
|
||||
shouldCreateSpanForRequest(url) {
|
||||
return !url.includes('/api/ws') && !url.includes('/api/static');
|
||||
},
|
||||
Sentry.reactRouterV6BrowserTracingIntegration({
|
||||
useEffect,
|
||||
useLocation,
|
||||
useNavigationType,
|
||||
createRoutesFromChildren,
|
||||
matchRoutes,
|
||||
}),
|
||||
Sentry.replayIntegration(),
|
||||
],
|
||||
release: version,
|
||||
tracesSampleRate: 0.1,
|
||||
beforeBreadcrumb(breadcrumb, hint?) {
|
||||
beforeBreadcrumb(breadcrumb) {
|
||||
if (breadcrumb.data && breadcrumb.data.url) {
|
||||
const url = breadcrumb.data.url.replace(/token=.*/, '');
|
||||
breadcrumb.data.url = url;
|
||||
}
|
||||
return breadcrumb;
|
||||
},
|
||||
tracesSampleRate: 0.1,
|
||||
tracePropagationTargets: [/^(?!\/api\/(ws|static)).*$/],
|
||||
replaysSessionSampleRate: 0.1,
|
||||
replaysOnErrorSampleRate: 0.1,
|
||||
release: version,
|
||||
});
|
||||
|
||||
// monaco 编辑器配置cdn和locale
|
||||
|
||||
Reference in New Issue
Block a user