getsentry / getsentry/sentry-java
Configuration option to stop/disable post-crash replay recording on Android
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 478
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 67
Mô tả
### 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
}
}
```
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, kotlin
- Lĩnh vực
- mobile, observability
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100