getsentry / getsentry/sentry-java

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

Aperta
#6,040 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Android Feature Platform: Java Replays
Lingua principale
Kotlin
Stelle
1.4k
Fork
478
Merge medio
2g 23h
PR unite (30g)
67

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, kotlin
Ambito
mobile, observability
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.