Files
asd-backend/Cargo.toml
moira f8a95c7417 feat: 集成 Sentry 错误监控 + 前端错误上报中继
后端:
  - Cargo.toml 添加 sentry/sentry-actix/sentry-tracing (v0.48)
  - main.rs 条件初始化 Sentry(SENTRY_DSN 环境变量控制)
  - 新增 handlers/sentry.rs — POST /api/sentry/events 前端中继端点
  - sentry-actix 全局中间件 + sentry-tracing 自动捕获 tracing::error!
  - .env.example 添加 SENTRY_DSN / SENTRY_TRACES_SAMPLE_RATE 配置

前端:
  - 新增 utils/sentryReporter.ts (批量上报/防抖/开发环境跳过)
  - app.ts 全局错误处理接入 Sentry (wx.onError/onUnhandledRejection/onPageNotFound)

Sentry 未配置 DSN 时完全无操作,无性能开销
2026-05-14 10:12:09 +08:00

34 lines
960 B
TOML

[package]
name = "rust-backend"
version = "0.3.0"
edition = "2024"
[dependencies]
actix-web = {version = "4.11.0", features=["openssl"]}
chrono = {version = "0.4.41", features=["serde"]}
dotenvy = "0.15.7"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
tracing-appender = "0.2"
sentry = "0.48"
sentry-actix = "0.48"
sentry-tracing = "0.48"
include_dir = "0.7.4"
jsonwebtoken = "9.3.1"
openssl = "0.10.73"
rand = "0.8"
reqwest = { version = "0.12.23", features=["json"]}
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.143"
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"] }
uuid = { version = "1", features = ["v4"] }
tokio = { version = "1", features = ["full"] }
toml = "0.8"
base64 = "0.22"
rsa = { version = "0.9", features = ["pem", "sha2"] }
pkcs8 = "0.10"
sha2 = "0.10"
[dev-dependencies]
tokio = { version = "1", features = ["full"] }