getsentry / getsentry/sentry-java

Configuration option to stop/disable post-crash replay recording on Android

Offen
#6,040 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Android Feature Platform: Java Replays
Vorherrschende Sprache
Kotlin
Sterne
1.4k
Forks
478
Ø Merge
2 T. 23 Std.
Gemergte PRs (30 T.)
67

Beschreibung

### 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
}
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, kotlin
Bereich
mobile, observability
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.