创建项目
1. 选择平台
这里根据不同的项目选择不同的平台

2. 制定报警规则
选择一个合适的规则

- 第一个 -
自定义规则 - 第二个 -
提醒每一个新问题 - 第三个 -
配置发生次数、影响范围和时间
3. 配置项目名称

输入项目名称,选择项目团队, 默认可以选择 #shencom 团队,点击创建项目,如果放到新团队里面,点击 + 创建新团队
接入项目中
::: tip
根据不同的项目选择不同的接入方式
:::
Vue
根据不同的项目选择不同的接入方式
- 默认接入配置
yarn add @sentry/vue @sentry/tracing
import Vue from 'vue';import Router from 'vue-router';import * as Sentry from '@sentry/vue';import { Integrations } from '@sentry/tracing';Vue.use(Router);const router = new Router({// ...});Sentry.init({Vue,dsn: 'https://xxxxxx.xxx.xx/0',integrations: [new Integrations.BrowserTracing({routingInstrumentation: Sentry.vueRouterInstrumentation(router),tracingOrigins: ['localhost', 'my-site-url.com', /^\//],}),],// Set tracesSampleRate to 1.0 to capture 100%// of transactions for performance monitoring.// We recommend adjusting this value in productiontracesSampleRate: 1.0,});// ...new Vue({router,render: (h) => h(App),}).$mount('#app');
- 详细
Sentry API配置文档链接: https://docs.sentry.io/platforms/javascript/guides/vue/ - 项目中配置可参考 @shencom/plugins 二次封装说明文档
