Add sentry.replay_id to flutter logs#3257
Conversation
Relates to #3245
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3257 +/- ##
==========================================
+ Coverage 88.22% 89.58% +1.36%
==========================================
Files 294 100 -194
Lines 10209 3553 -6656
==========================================
- Hits 9007 3183 -5824
+ Misses 1202 370 -832 ☔ View full report in Codecov by Sentry. |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3615e19 | 468.38 ms | 504.71 ms | 36.33 ms |
| 8541716 | 437.14 ms | 443.65 ms | 6.51 ms |
| de377fd | 572.35 ms | 589.21 ms | 16.87 ms |
| 6ba4675 | 499.80 ms | 632.43 ms | 132.63 ms |
| 4298701 | 524.40 ms | 633.30 ms | 108.90 ms |
| 8825ed8 | 447.65 ms | 456.90 ms | 9.25 ms |
| c8596a6 | 474.00 ms | 492.96 ms | 18.96 ms |
| eca355d | 485.50 ms | 569.85 ms | 84.35 ms |
| b6c8720 | 457.41 ms | 519.04 ms | 61.63 ms |
| 944b773 | 470.54 ms | 480.18 ms | 9.64 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3615e19 | 6.54 MiB | 7.70 MiB | 1.16 MiB |
| 8541716 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| de377fd | 6.54 MiB | 7.71 MiB | 1.17 MiB |
| 6ba4675 | 6.54 MiB | 7.53 MiB | 1015.26 KiB |
| 4298701 | 6.54 MiB | 7.71 MiB | 1.17 MiB |
| 8825ed8 | 13.93 MiB | 14.93 MiB | 1.00 MiB |
| c8596a6 | 6.54 MiB | 7.53 MiB | 1015.27 KiB |
| eca355d | 6.54 MiB | 7.70 MiB | 1.16 MiB |
| b6c8720 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 944b773 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
Previous results on branch: enha/logs-replay-id
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f98c32f | 479.02 ms | 466.78 ms | -12.25 ms |
| a279e8d | 412.42 ms | 414.10 ms | 1.69 ms |
| 9e888b6 | 460.09 ms | 462.35 ms | 2.26 ms |
| 91562e2 | 464.50 ms | 455.70 ms | -8.80 ms |
| 1e63021 | 430.72 ms | 453.78 ms | 23.06 ms |
| 234bb86 | 453.89 ms | 457.28 ms | 3.39 ms |
| 744d429 | 452.46 ms | 460.69 ms | 8.23 ms |
| 02f86c3 | 453.09 ms | 454.63 ms | 1.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f98c32f | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| a279e8d | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 9e888b6 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 91562e2 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 1e63021 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 234bb86 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 744d429 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
| 02f86c3 | 13.93 MiB | 15.00 MiB | 1.06 MiB |
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 827bf09 | 1261.86 ms | 1276.41 ms | 14.55 ms |
| 6bcdc99 | 1257.16 ms | 1264.96 ms | 7.79 ms |
| 0fb3800 | 1256.60 ms | 1266.28 ms | 9.68 ms |
| cf443d2 | 1255.79 ms | 1248.38 ms | -7.40 ms |
| 81f83eb | 1259.53 ms | 1273.39 ms | 13.86 ms |
| 73a3c38 | 1263.37 ms | 1277.90 ms | 14.53 ms |
| 54acf91 | 1257.65 ms | 1277.96 ms | 20.31 ms |
| a10aff4 | 1241.67 ms | 1255.02 ms | 13.35 ms |
| 32914d8 | 1275.47 ms | 1285.20 ms | 9.73 ms |
| 7b21e8b | 1256.79 ms | 1267.12 ms | 10.33 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 827bf09 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 6bcdc99 | 5.53 MiB | 6.00 MiB | 479.95 KiB |
| 0fb3800 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| cf443d2 | 5.53 MiB | 6.00 MiB | 479.99 KiB |
| 81f83eb | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 73a3c38 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 54acf91 | 20.70 MiB | 22.46 MiB | 1.75 MiB |
| a10aff4 | 5.53 MiB | 6.00 MiB | 486.71 KiB |
| 32914d8 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 7b21e8b | 5.53 MiB | 6.00 MiB | 479.96 KiB |
Previous results on branch: enha/logs-replay-id
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1e63021 | 1244.62 ms | 1246.37 ms | 1.76 ms |
| 744d429 | 1254.51 ms | 1254.19 ms | -0.32 ms |
| f98c32f | 1256.22 ms | 1265.67 ms | 9.44 ms |
| 9e888b6 | 1247.65 ms | 1245.32 ms | -2.33 ms |
| 91562e2 | 1242.54 ms | 1254.08 ms | 11.54 ms |
| 234bb86 | 1241.00 ms | 1250.87 ms | 9.88 ms |
| 02f86c3 | 1262.54 ms | 1263.67 ms | 1.13 ms |
| a279e8d | 1254.24 ms | 1251.52 ms | -2.72 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1e63021 | 5.53 MiB | 6.00 MiB | 483.21 KiB |
| 744d429 | 5.53 MiB | 6.00 MiB | 483.36 KiB |
| f98c32f | 5.53 MiB | 6.00 MiB | 483.36 KiB |
| 9e888b6 | 5.53 MiB | 6.00 MiB | 483.21 KiB |
| 91562e2 | 5.53 MiB | 6.00 MiB | 480.92 KiB |
| 234bb86 | 5.53 MiB | 6.00 MiB | 479.96 KiB |
| 02f86c3 | 5.53 MiB | 6.00 MiB | 480.79 KiB |
| a279e8d | 5.53 MiB | 6.00 MiB | 487.08 KiB |
|
@stefanosiano Same here, review pls :) |
|
looks good, but i'll put it on hold, until the last point has been decided on: https://www.notion.so/sentry/Logs-Replays-Notes-2738b10e4b5d8035b027c6cb0fc57174 |
|
@stefanosiano Pls take a look if i interpreted the flag correctly. |
|
@denrase
In Android we have this distinction because the replay id is set in the scope when the replay is captured (and it's in session mode), and is only available in the replay integration (and not in the scope) when it's running in buffer mode. |
|
@stefanosiano Thank you, didn't have access to |
i guess it's fine if you try to cast the options of the scope to |
|
@stefanosiano AFAIK this only works in the Flutter repo, as the Dart repo does not know about the |
yeah right |
|
@stefanosiano Took me a while to debug this and figure out how everything fits together. We have the following issues:
So the latter is currently incorrect I think. Need to think about how we wan't to tackle this. \cc @buenaflor |
|
@denrase sounds like we need some internal hybrids SDK api from cocoa for this |
|
I think it might be good to align with RN here |
|
@buenaflor Checked RN. Right now they are only setting the |
is |
|
@buenaflor On Android this works as expected AFAIK, on iOS we can only detect full sessions or onError sessions as soon as they are set to the scope. @stefanosiano Do you know if this would be ok as a step between? RN also only sets |
# Conflicts: # packages/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart
|
buenaflor
left a comment
There was a problem hiding this comment.
looks good! only one last comment
📜 Description
sentry.replay_idto structured logssentry._internal.replay_is_bufferingto structured logs💡 Motivation and Context
Closes #3245
💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPiiis enabledNote
Add
ReplayLogIntegrationto enrich Flutter structured logs with replay metadata and include it only on replay-supported platforms, with tests and changelog updates.ReplayLogIntegrationto addsentry.replay_idandsentry._internal.replay_is_bufferingtoSentryLogviaOnBeforeCaptureLog.ReplayLogIntegrationonly whennative.supportsReplayis true.replay_log_integration_test.dartcovering replay id and buffering flag behavior, registration, and cleanup.ReplayLogIntegrationonly on replay-supported platforms.test/sentry_flutter_util.dartassertion to check byruntimeTypefor absent integrations.Written by Cursor Bugbot for commit 02f86c3. This will update automatically on new commits. Configure here.