Sentry 是一个用于 Dart 的崩溃报告库,可捕获并发送运行时错误和异常到 Sentry.io,使开发人员能够实时监控和调试问题。它支持 Dart VM 和 Web 平台,提供详细的堆栈跟踪、上下文数据和性能洞察。该库可无缝集成到 Dart 应用程序中,帮助团队快速识别和解决错误。对于 Flutter 应用,建议使用专用的 sentry_flutter 包。
适合场景
实时崩溃监控
Web 和服务器端 Dart 中的错误跟踪
性能问题检测
调试生产问题
与 Sentry.io 仪表板集成
主要特点
跨平台支持(Web、VM)
自动错误捕获
上下文和面包屑日志
与 Sentry.io 后端集成
自定义事件标记和过滤
适合对象
Dart 应用程序在 Web 和服务器上
使用 Sentry.io 进行监控的团队
需要崩溃分析的开发者
需要详细错误上下文的项目
面向多平台的应用程序
使用建议
不适用于 Flutter 应用程序(请改用 sentry_flutter)
需要 Sentry.io 账户和项目设置
可能会略微增加应用包大小
需要正确配置才能实现最佳性能
与 sentry_flutter 相比,原生移动功能有限
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions
Sentry SDK for Dart and Flutter
Package
CI status
Likes
Downloads
Analysis
Releases
This repo uses the following ways to release SDK updates:
Pre-release: We create pre-releases (alpha, beta, RC,…) for larger and potentially more impactful changes, such as new features or major versions.
Latest: We continuously release major/minor/hotfix versions from the main branch. These releases go through all our internal quality gates and are very safe to use and intended to be the default for most teams.
Stable: We promote releases from Latest when they have been used in the field for some time and in scale, considering time since release, adoption, and other quality and stability metrics. These releases will be indicated on the releases page (https://github.com/getsentry/sentry-dart/releases/) with the Stable suffix.
Starting with May 1st 2024, iOS apps are required to declare approved reasons to access certain APIs. This also includes third-party SDKs.
If you are using sentry-flutter, update to at least version 7.17.0 to get the updated sentry-cocoa native iOS/macOS SDK, supporting the privacy manifest.
All other used dependencies with file declarations are supported by Sentry packages.
Run flutter pub upgrade to the latest compatible versions of all the dependencies.
SDK Size Overhead
The Sentry SDKs for Dart and Flutter typically add approximately 1-1.5 MB to an app’s binary size. The exact impact may vary depending on the device architecture.