按照 sentry
文档,将代码集成到前端项目里:
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
Sentry.init({
dsn: 'http://xxxx@xxx:9000/2',
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0
});
但前端项目会报跨域:
既然跨域那么就是允许跨域咯。
'http://xxxx@xxx:9000/2'
这个服务端配置好。'http://xxxx@xxx:9000/2'
改成'/2'
,然后在自己服务端 nginx 配置proxy_pass 咯