sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Add Mobile Replay

Open krystofwoldrich opened this issue 1 year ago • 4 comments

:loudspeaker: Type of change

  • [x] New feature

:scroll: Description

Todo

  • [x] Android doesn't automatically pick up the Root View fixed by https://github.com/getsentry/sentry-java/pull/3272/commits/bee240b8608a9ee08c6920e4dd38eed79d4294ac
  • [x] Test redacting RN Images on Android -> works
  • [x] iOS Swift implementation doesn't compile with the RN SDK fixed by https://github.com/getsentry/sentry-cocoa/pull/3671/commits/1afd0d9d45a5c6130a34cbd900e80568abfea02a
  • [x] Android uses sample rate options
  • [x] Android add replay start for buffered mode
  • [x] iOS Redact RN text elements and images
  • [x] iOS add replay start for buffered mode
  • [x] iOS expose replayId on the Scope (or anywhere else accessible by the Hybrid SDKs)
  • [x] Add _experimental option
  • [x] Add maskAll bool flag

Later

  • [ ] Add manual API (Android, iOS) -> pause, resume, start, stop
  • [ ] https://github.com/getsentry/sentry-java/pull/3339

Blocking for alpha.0 release

  • [x] https://github.com/getsentry/sentry-java/pull/3272
  • [x] https://github.com/getsentry/sentry-cocoa/pull/3671
  • [x] https://github.com/getsentry/sentry-cocoa/pull/3625
  • [x] https://github.com/getsentry/sentry-cocoa/pull/3878
  • [x] https://github.com/getsentry/sentry-cocoa/pull/3879
  • [x] https://github.com/getsentry/sentry-cocoa/pull/3891
  • [x] https://github.com/getsentry/sentry-java/pull/3383

:green_heart: How did you test it?

:pencil: Checklist

  • [ ] I reviewed submitted code
  • [ ] I added tests to verify changes
  • [ ] No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • [ ] All tests passing
  • [ ] No breaking changes

krystofwoldrich avatar Mar 25 '24 09:03 krystofwoldrich

iOS (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1222.00 ms 1223.49 ms 1.49 ms
Size 2.36 MiB 2.92 MiB 571.08 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0db0c729a4ac7c205a44cb4702fa7ba5b0bc03c0+dirty 1275.02 ms 1285.84 ms 10.82 ms
9433f356583b99b5c970842ca1f926315bf23ba9+dirty 1246.94 ms 1271.45 ms 24.52 ms
76d1bafa51ac0d20b127bc97b0f45201263636c3+dirty 1244.10 ms 1268.52 ms 24.42 ms
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 1232.22 ms 1255.20 ms 22.98 ms
8900e1acdc5e3dcbb40938d4ba5c2abad4cc86a4+dirty 1210.27 ms 1218.66 ms 8.39 ms
e73f4eddcecda26c0380795bce5ba97e1f11b91f+dirty 1243.27 ms 1244.52 ms 1.25 ms
3853f4362ec819042552ffa9ed30e8f6627e60bf+dirty 1221.82 ms 1242.64 ms 20.82 ms
27ef4ee6faa6d5229b16fca7b728ca6b689ab916+dirty 1293.52 ms 1296.08 ms 2.56 ms
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 1252.38 ms 1275.04 ms 22.66 ms
22e31b6ad7bd629bf078367aee82121c08977ded+dirty 1253.62 ms 1265.96 ms 12.34 ms

App size

Revision Plain With Sentry Diff
0db0c729a4ac7c205a44cb4702fa7ba5b0bc03c0+dirty 2.36 MiB 2.84 MiB 487.01 KiB
9433f356583b99b5c970842ca1f926315bf23ba9+dirty 2.36 MiB 2.85 MiB 499.80 KiB
76d1bafa51ac0d20b127bc97b0f45201263636c3+dirty 2.36 MiB 2.82 MiB 469.45 KiB
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 2.36 MiB 2.85 MiB 495.80 KiB
8900e1acdc5e3dcbb40938d4ba5c2abad4cc86a4+dirty 2.36 MiB 2.83 MiB 479.25 KiB
e73f4eddcecda26c0380795bce5ba97e1f11b91f+dirty 2.36 MiB 2.82 MiB 469.44 KiB
3853f4362ec819042552ffa9ed30e8f6627e60bf+dirty 2.36 MiB 2.85 MiB 499.81 KiB
27ef4ee6faa6d5229b16fca7b728ca6b689ab916+dirty 2.36 MiB 2.85 MiB 500.03 KiB
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 2.36 MiB 2.83 MiB 481.14 KiB
22e31b6ad7bd629bf078367aee82121c08977ded+dirty 2.36 MiB 2.87 MiB 520.67 KiB

github-actions[bot] avatar Mar 25 '24 10:03 github-actions[bot]

iOS (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1218.39 ms 1219.85 ms 1.47 ms
Size 2.92 MiB 3.48 MiB 577.47 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0db0c729a4ac7c205a44cb4702fa7ba5b0bc03c0+dirty 1258.88 ms 1262.52 ms 3.64 ms
9433f356583b99b5c970842ca1f926315bf23ba9+dirty 1232.24 ms 1232.74 ms 0.50 ms
76d1bafa51ac0d20b127bc97b0f45201263636c3+dirty 1245.00 ms 1257.76 ms 12.76 ms
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 1285.78 ms 1297.56 ms 11.78 ms
8900e1acdc5e3dcbb40938d4ba5c2abad4cc86a4+dirty 1268.36 ms 1273.04 ms 4.68 ms
e73f4eddcecda26c0380795bce5ba97e1f11b91f+dirty 1282.90 ms 1309.30 ms 26.40 ms
3853f4362ec819042552ffa9ed30e8f6627e60bf+dirty 1271.74 ms 1278.04 ms 6.30 ms
27ef4ee6faa6d5229b16fca7b728ca6b689ab916+dirty 1236.41 ms 1244.90 ms 8.49 ms
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 1288.10 ms 1289.54 ms 1.44 ms
22e31b6ad7bd629bf078367aee82121c08977ded+dirty 1276.55 ms 1278.12 ms 1.57 ms

App size

Revision Plain With Sentry Diff
0db0c729a4ac7c205a44cb4702fa7ba5b0bc03c0+dirty 2.92 MiB 3.40 MiB 492.71 KiB
9433f356583b99b5c970842ca1f926315bf23ba9+dirty 2.92 MiB 3.41 MiB 503.55 KiB
76d1bafa51ac0d20b127bc97b0f45201263636c3+dirty 2.92 MiB 3.38 MiB 475.74 KiB
e2b64fed057d4b01cf7ad79eb19eb3c8b8002a82+dirty 2.92 MiB 3.41 MiB 499.97 KiB
8900e1acdc5e3dcbb40938d4ba5c2abad4cc86a4+dirty 2.92 MiB 3.39 MiB 485.96 KiB
e73f4eddcecda26c0380795bce5ba97e1f11b91f+dirty 2.92 MiB 3.38 MiB 475.71 KiB
3853f4362ec819042552ffa9ed30e8f6627e60bf+dirty 2.92 MiB 3.41 MiB 503.54 KiB
27ef4ee6faa6d5229b16fca7b728ca6b689ab916+dirty 2.92 MiB 3.41 MiB 503.72 KiB
d7401ac44acf524fe4d9a6a525f2cc13c70ce9e5+dirty 2.92 MiB 3.40 MiB 488.06 KiB
22e31b6ad7bd629bf078367aee82121c08977ded+dirty 2.92 MiB 3.43 MiB 524.74 KiB

github-actions[bot] avatar Mar 25 '24 10:03 github-actions[bot]

Android (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 426.92 ms 452.41 ms 25.49 ms
Size 17.73 MiB 20.02 MiB 2.29 MiB

github-actions[bot] avatar Apr 23 '24 09:04 github-actions[bot]

Android (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 312.93 ms 354.21 ms 41.28 ms
Size 7.15 MiB 8.30 MiB 1.15 MiB

github-actions[bot] avatar Apr 23 '24 10:04 github-actions[bot]

Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 50cbcdafd2c2bf579ea16e0c8f8b06442658c2a3

github-actions[bot] avatar Apr 30 '24 09:04 github-actions[bot]

Should we bump feat/replay with main? There seems to have changes on kw-add-replay-v0 that are from the main branch but are missing on feat/replay, that could help cleaning the PR file changes by only pointing to the changes that were actually done on the PR

lucas-zimerman avatar May 15 '24 02:05 lucas-zimerman

Is it possible to review this and get merged to feat/replay soonish? I'd rather not create a third PR in chain to land #3818

TODOs from this PR could move to feat/replay PR (which should only have reviewed code AFAIU) or a tracking issue.

vaind avatar May 15 '24 14:05 vaind

@lucas-zimerman @vaind @romtsn @brustolin Can, you take a look at this alpha PR? I would like to merge it as is to feat/replay where only review commits will go and then that will be eventually be merged without squash to main.

@billyvg @mydea Feel free to comment on the JS part, so RN doesn't unnecessarily deviate from browser replay.

krystofwoldrich avatar May 15 '24 16:05 krystofwoldrich