Skip to content

Conversation

@denrase
Copy link
Collaborator

@denrase denrase commented Nov 11, 2025

📜 Description

  • Flush in-memory logs when SDK is closed.

Other mentions from the docs (app goes to background or is closed) are already handled by the widget observer.

💡 Motivation and Context

Closes #3306

💚 How did you test it?

Unit tests

📝 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
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.47%. Comparing base (d0aa4b6) to head (a602f10).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/dart/lib/src/sentry_log_batcher.dart 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3335      +/-   ##
==========================================
+ Coverage   88.33%   88.47%   +0.13%     
==========================================
  Files         291      291              
  Lines        9914     9917       +3     
==========================================
+ Hits         8758     8774      +16     
+ Misses       1156     1143      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@denrase denrase changed the title Logs: Batch Processor Minimize Data Loss Flush logs if client/hub/sdk is closed Nov 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 392.13 ms 423.28 ms 31.15 ms
Size 13.93 MiB 15.18 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
426fbfd 368.10 ms 353.23 ms -14.87 ms
6ad8fc4 489.92 ms 484.96 ms -4.96 ms
3615e19 468.38 ms 504.71 ms 36.33 ms
6e7d494 397.35 ms 378.91 ms -18.43 ms
c26ed0a 465.52 ms 476.38 ms 10.86 ms
0fb45d0 482.79 ms 554.02 ms 71.23 ms
944b773 470.54 ms 480.18 ms 9.64 ms
2cb90b9 479.38 ms 552.69 ms 73.31 ms
75284dc 512.39 ms 530.87 ms 18.48 ms
5a95d04 378.92 ms 364.33 ms -14.59 ms

App size

Revision Plain With Sentry Diff
426fbfd 13.93 MiB 15.06 MiB 1.13 MiB
6ad8fc4 13.93 MiB 15.06 MiB 1.13 MiB
3615e19 6.54 MiB 7.70 MiB 1.16 MiB
6e7d494 13.93 MiB 15.06 MiB 1.13 MiB
c26ed0a 13.93 MiB 14.93 MiB 1.00 MiB
0fb45d0 6.54 MiB 7.70 MiB 1.17 MiB
944b773 13.93 MiB 15.00 MiB 1.06 MiB
2cb90b9 6.54 MiB 7.70 MiB 1.17 MiB
75284dc 13.93 MiB 14.93 MiB 1.00 MiB
5a95d04 13.93 MiB 15.06 MiB 1.13 MiB

Previous results on branch: enha/enhance-logs-batch-processor

Startup times

Revision Plain With Sentry Diff
fad6346 427.73 ms 441.52 ms 13.79 ms
fb081d3 408.82 ms 396.57 ms -12.25 ms
41ef6c5 392.28 ms 385.16 ms -7.12 ms
ad80bba 435.69 ms 439.18 ms 3.49 ms

App size

Revision Plain With Sentry Diff
fad6346 13.93 MiB 15.06 MiB 1.13 MiB
fb081d3 13.93 MiB 15.06 MiB 1.13 MiB
41ef6c5 13.93 MiB 15.18 MiB 1.25 MiB
ad80bba 13.93 MiB 15.06 MiB 1.13 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1249.48 ms 1249.31 ms -0.17 ms
Size 5.53 MiB 6.02 MiB 502.05 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e1ab497 1260.92 ms 1260.22 ms -0.69 ms
f761369 1261.69 ms 1277.82 ms 16.12 ms
819c1e7 1250.59 ms 1249.08 ms -1.51 ms
393f8ec 1256.45 ms 1259.60 ms 3.16 ms
e04b24b 1230.22 ms 1233.90 ms 3.67 ms
de377fd 1252.28 ms 1254.76 ms 2.48 ms
ad121c0 1275.04 ms 1280.59 ms 5.55 ms
2b5e090 1257.04 ms 1258.07 ms 1.02 ms
0fb3800 1256.60 ms 1266.28 ms 9.68 ms
aeb02f2 1244.29 ms 1256.55 ms 12.26 ms

App size

Revision Plain With Sentry Diff
e1ab497 5.53 MiB 6.01 MiB 487.96 KiB
f761369 7.86 MiB 9.44 MiB 1.58 MiB
819c1e7 5.53 MiB 6.00 MiB 479.96 KiB
393f8ec 5.53 MiB 6.01 MiB 488.10 KiB
e04b24b 5.53 MiB 6.00 MiB 480.00 KiB
de377fd 20.71 MiB 22.43 MiB 1.73 MiB
ad121c0 5.53 MiB 6.01 MiB 488.11 KiB
2b5e090 5.53 MiB 6.00 MiB 485.10 KiB
0fb3800 7.86 MiB 9.44 MiB 1.58 MiB
aeb02f2 7.86 MiB 9.44 MiB 1.58 MiB

Previous results on branch: enha/enhance-logs-batch-processor

Startup times

Revision Plain With Sentry Diff
ad80bba 1252.87 ms 1249.65 ms -3.21 ms
fad6346 1249.65 ms 1246.67 ms -2.98 ms
fb081d3 1267.15 ms 1261.11 ms -6.04 ms
41ef6c5 1239.24 ms 1250.86 ms 11.61 ms

App size

Revision Plain With Sentry Diff
ad80bba 5.53 MiB 6.01 MiB 488.24 KiB
fad6346 5.53 MiB 6.01 MiB 488.25 KiB
fb081d3 5.53 MiB 6.01 MiB 488.25 KiB
41ef6c5 5.53 MiB 6.02 MiB 502.19 KiB

@denrase denrase enabled auto-merge (squash) November 17, 2025 10:39
@denrase denrase requested a review from buenaflor November 17, 2025 10:40
Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, lgtm 👍


- Refactor `captureReplay` and `setReplayConfig` to use FFI/JNI ([#3318](https://github.com/getsentry/sentry-dart/pull/3318))
- Refactor `init` to use FFI/JNI ([#3324](https://github.com/getsentry/sentry-dart/pull/3324))
- Flush logs if client/hub/sdk is closed ([#3335](https://github.com/getsentry/sentry-dart/pull/3335))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a new release, pls update the changelog

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops didn't see it's automatic merged

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, enabled auto-merge when all criteria is met.

@denrase denrase merged commit 8775665 into main Nov 17, 2025
134 checks passed
@denrase denrase deleted the enha/enhance-logs-batch-processor branch November 17, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs: Batch Processor Minimize Data Loss

3 participants