You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/docs/proposal/23040412-关于使用sentry用于错误追踪与性...

50 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
| 23040412| 北野 | 2023-04-04 | 2023-04-04 | v1.0 | 提议 |
### 概述
[Sentry](https://github.com/getsentry/sentry) Sentry is a developer-first error tracking and performance monitoring platform that helps developers see what actually matters, solve quicker, and learn continuously about their applications.
### 需求
* 通过配置文件开启Sentry功能
### 方案
#### 设计要点
* config.yaml中添加`Sentry` 功能来启用Sentry功能
#### 设计细节
* 参考实现(PR):
[add Sentry feature support #258](https://github.com/rocboss/paopao-ce/pull/258)
### 疑问
1. 为什么要引入Sentry
添加一种对paopao-ce的错误追踪与性能检测机制。
2. 如何开启这个功能?
* 在配置文件config.yaml中的`Features`中添加`Sentry`功能项开启该功能:
```yaml
...
# features中加上 Sentry
Features:
Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Sentry"]
Base: ["Redis", "PhoneBind"]
Sentry:
Sentry: # Sentry配置
Dsn: "http://4ea0af5cd88d4512b7e52070506c80ec@localhost:9000/2"
Debug: True
AttachStacktrace: True
TracesSampleRate: 1.0
AttachLogrus: True # logrus是否附加到Sentry
AttachGin: True # gin是否附加到Sentry
...
```
### 参考文档
* [sentry](https://github.com/getsentry/sentry)
* [self-hosted](https://develop.sentry.dev/self-hosted/)
### 更新记录
#### v1.0(2023-04-04) - 北野
* 初始文档