getsentry / getsentry/sentry-java
Configuration option to stop/disable post-crash replay recording on Android
- 主要语言
- Kotlin
- 星标
- 1.4k
- 派生
- 478
- 平均合并
- 2 天 23 小时
- 30 天内合并 PR
- 67
描述
### Problem Statement
Currently, when an error/crash occurs, the SDK samples the event and continues recording post-crash replay until the session naturally ends. This replay is absolutely useless for us. I need a purely configuration-based way to completely prevent or instantly cut off replay recording right after a crash event occurs.
### Solution Brainstorm
I would like a new configuration option in SentryReplayOptions (or a built-in behavior within beforeErrorSampling) that automatically stops the replay recorder immediately after a crash event is captured.
For example, a flag like `stopRecordingOnCrash`:
```kotlin
SentryAndroid.init(context) { options ->
options.sessionReplay.onErrorSampleRate = 1.0
// Proposed flag to cut off recording instantly after a crash/unhandled exception
options.sessionReplay.isStopRecordingOnCrash = true
options.sessionReplay.beforeErrorSampling =
SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
event.isCrashed // Only capture replays for crashes
}
}
```
贡献指南
调研方向
Start with SentryReplayOptions and the beforeErrorSampling callback, then trace how Android crash events interact with session replay recording. Define the configuration behavior so replay stops immediately after a captured crash, and verify that normal replay and error sampling remain unaffected.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, kotlin
- 领域
- mobile, observability
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100