1.8.3 • Published 1 year ago

@shencom/plugins v1.8.3

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
1 year ago

@shencom/plugins

这是一个插件的集合,目前已经包含以下插件

  • sentry-vue

Install

pnpm add @shencom/plugins
# or
yarn add @shencom/plugins

Sentry

Sentry 是一个流行的错误监控平台,帮助开发者分析,修复问题,优化代码的性能。可以进行错误捕获,问题追踪,并提供问题详情,适用于多个平台,多种语言。

API

::: tip

提示:
目前只有 Vue 技术接入;

:::

Options

新增 Sentry 配置说明

参数说明类型可选值默认值
scid租户 IDString必填-
isDev是否在开发环境boolean必填-
isPro是否在正式环境boolean必填-

改写默认 Sentry 配置说明

参数说明类型可选值默认值
dsn项目唯一标识符String必填-
debug打开或关闭调试模式Boolean-false
release版本号String-
environment应用程序的当前环境String-isPro?production:test
tracesSampleRate上报比例Number-isPro?1.0:0.5
maxBreadcrumbs溯源步数Number-30
attachProps是否上传 Vue 组件的 Prop 数据。Boolean-true
logErrors是否使用原始 Vue 的 logErrorBoolean-true
attachStacktrace将堆栈跟踪附加到纯捕获消息/日志集成Boolean-true
ignoreErrors上报过滤Array<String \| RegExp>--
BrowserTracingOption浏览器跟踪选项BrowserTracingOptions--

Methods

方法名说明参数
install初始化ISentryOption
setScid设置 ScidString
setUserInfo设置用户信息Dictionary
setRequest设置请求信息ISentryRequestOption
clearUserInfo清除用户信息-
captureEvent手动上报事件参考官方文档说明
captureException手动上报错误事件参考官方文档说明
captureMessage手动上报消息事件参考官方文档说明
withScope临时上报数据,上报完成自动删除参考官方文档说明
context继承 Sentry 方法实例-