sentry-java
sentry-java copied to clipboard
[SR] Capture screen names as urls
#skip-changelog
:scroll: Description
- Adds an option to disable screen tracking - this is necessary for RN/Flutter, so they can set their own screens to the native scope and we won't override them
- Adds screen tracking to the missing places (fragment and navigation integrations) to match what we capture as navigation breadcrumbs for replay
- Fills in
replay.urlsarray based on navigation breadcrumbs - For the buffer mode: we have to know what was the last screen before the buffer replay started to display the correct screen name. For that we:
- Install ScopeObserver to observe whenever
scope.screenchanges and persist it with timestamp - When capturing the buffered replay we then search for the last screen before the buffered replay started and add it to the
replay.urlsarray
- Install ScopeObserver to observe whenever
:bulb: Motivation and Context
Part of https://github.com/getsentry/sentry/issues/70065
example buffered replay: https://sentry-sdks.sentry.io/replays/0a7eb9067746443c90cfad13662349d3/?project=5428559&query=&referrer=%2Freplays%2F%3AreplaySlug%2F&statsPeriod=1h&yAxis=count%28%29&t=0
and its json payload: https://us.sentry.io/api/0/projects/sentry-sdks/sentry-android/replays/0a7eb9067746443c90cfad13662349d3/
Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 431.22 ms | 519.35 ms | 88.12 ms |
| Size | 1.70 MiB | 2.33 MiB | 643.22 KiB |
Baseline results on branch: rz/feat/session-replay
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 547b3f86db28d31207a105e84a381fef084db506 | 388.65 ms | 470.27 ms | 81.61 ms |
| 639e47c0e7033b3e59a7b5356ea7bbadf8efac91 | 444.10 ms | 558.02 ms | 113.92 ms |
| b57c02082754f8330feb497a2c056dd03e5ec937 | 502.80 ms | 620.77 ms | 117.97 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 547b3f86db28d31207a105e84a381fef084db506 | 1.70 MiB | 2.33 MiB | 641.35 KiB |
| 639e47c0e7033b3e59a7b5356ea7bbadf8efac91 | 1.70 MiB | 2.33 MiB | 641.89 KiB |
| b57c02082754f8330feb497a2c056dd03e5ec937 | 1.70 MiB | 2.33 MiB | 641.35 KiB |
Previous results on branch: rz/feat/session-replay-urls
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 169b00a63608e6023f57f7943523ff8e7ddfe3b3 | 414.80 ms | 472.69 ms | 57.90 ms |
| 21a6a6e5886c2b720e422dda0c1f246bebd8eafa | 387.94 ms | 455.66 ms | 67.72 ms |
| 7d84a9e9ba566d4a29234a9b07cbe955c4d07f14 | 362.57 ms | 408.65 ms | 46.08 ms |
| b2c07ee22cb7da5edce2f2eb1244522298e8d9bd | 426.06 ms | 503.42 ms | 77.36 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 169b00a63608e6023f57f7943523ff8e7ddfe3b3 | 1.70 MiB | 2.33 MiB | 643.23 KiB |
| 21a6a6e5886c2b720e422dda0c1f246bebd8eafa | 1.70 MiB | 2.33 MiB | 643.15 KiB |
| 7d84a9e9ba566d4a29234a9b07cbe955c4d07f14 | 1.70 MiB | 2.33 MiB | 643.22 KiB |
| b2c07ee22cb7da5edce2f2eb1244522298e8d9bd | 1.70 MiB | 2.33 MiB | 643.15 KiB |