-
-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR] Capture Replays for ANRs and crashes #3565
Conversation
…replay-map-object-reader
…replay-map-object-reader
…replay-map-object-reader
…ject-reader [SR] Introduce MapObjectReader
} | ||
|
||
// we need to round to the nearest frame to include breadcrumbs/events happened after the frame was captured | ||
val duration = roundToNearestFrame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val duration = roundToNearestFrame( | |
val durationMillis = roundToNearestFrame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will address in the other PR since this line has changed there
sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, left a few comments 🚀
sentry-android-core/src/main/java/io/sentry/android/core/AnrV2EventProcessor.java
Outdated
Show resolved
Hide resolved
isClosed.set(true) | ||
} | ||
|
||
// TODO: it's awful, choose a better serialization format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would appending only the new items to the file work better?
📜 Description
The main changes are:
ANRs part
replay_id
from scope to diskpropagationContext
in case there's no active transaction on scope, to always have a trace to link toReplay part
BaseCaptureStrategy.createSegment
method fully parameterized, to supply things like breadcrumbs/rrweb events/segment values not only from the current app run, but also from the previously serialized values when neededTODO leftovers
There are some leftovers which (imo) is fine to address later, namely:
traceContext
for replay events from the event values, when the event is Backfillable (=sent on next app launch).options_cache
for that), when the event is Backfillable (=sent on next app launch)💡 Motivation and Context
Part of getsentry/sentry#70065
💚 How did you test it?
Manually + automated
Next up
Do the same for crashes and JS crashes, and after that get to the buffer mode as it's a bit more work there
Example ANR with a linked replay
https://sentry-sdks.sentry.io/issues/5587028220/events/635b45b8a6254aa29f8d4f1734480613