Skip to content

feat(profiling): Add measurements to Android profiling#6250

Merged
antonis merged 3 commits into
mainfrom
feat/android-profiling-measurements
Jun 3, 2026
Merged

feat(profiling): Add measurements to Android profiling#6250
antonis merged 3 commits into
mainfrom
feat/android-profiling-measurements

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Jun 3, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Passes memory, CPU, and frame measurements from the Android SDK's ProfileEndData.measurementsMap through the React Native bridge into profile events. The data was already collected by the native Android profiler but never forwarded to JS.

💡 Motivation and Context

Closes #3641

💚 How did you test it?

Manual, Unit tests

📝 Checklist

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

🔮 Next steps

antonis and others added 2 commits June 3, 2026 10:34
Pass memory, CPU, and frame measurements from the Android SDK's
ProfileEndData through the React Native bridge into profile events.
The data was already collected by the native profiler but never
forwarded to JS.

Closes #3641

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(profiling): Add measurements to Android profiling by antonis in #6250
  • chore(deps): update CLI to v3.5.0 by github-actions in #6248
  • chore(deps): bump jwt from 2.9.3 to 2.10.3 in /samples/react-native-macos by dependabot in #6247
  • chore(deps): bump jwt from 2.10.2 to 2.10.3 in /performance-tests by dependabot in #6246
  • feat(android): Warn when Gradle resolves unsupported sentry-android version by antonis in #6238
  • chore(deps): update JavaScript SDK to v10.56.0 by github-actions in #6249
  • chore(ci): Pin all GitHub Actions to full commit SHAs by antonis in #6243
  • fix(tracing): Enable fetch instrumentation when expo/fetch is active by antonis in #6226
  • fix: Bump tmp to 0.2.7 to resolve path traversal vulnerability by antonis in #6233
  • feat(logs): Add enableAutoConsoleLogs option to opt out of console capture by alwx in #6235
  • chore(deps): update JavaScript SDK to v10.55.0 by github-actions in #6222
  • chore(deps): update Sentry Android Gradle Plugin to v6.9.0 by github-actions in #6230
  • refactor(android): Convert sentry.gradle to Kotlin DSL (sentry.gradle.kts) by antonis in #6119

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

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

Generated by 🚫 dangerJS against 2b5745b

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jun 3, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 817959e. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 414.45 ms 449.23 ms 34.78 ms
Size 48.30 MiB 53.60 MiB 5.30 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
44c8b3f+dirty 414.20 ms 457.28 ms 43.08 ms
853723c+dirty 405.54 ms 440.08 ms 34.54 ms
890d145+dirty 504.54 ms 491.55 ms -12.99 ms
a50b33d+dirty 500.81 ms 532.11 ms 31.30 ms
d038a14+dirty 415.60 ms 461.04 ms 45.45 ms
b9bebee+dirty 438.86 ms 452.21 ms 13.35 ms
5748023+dirty 446.69 ms 505.63 ms 58.94 ms
6177334+dirty 408.16 ms 441.14 ms 32.98 ms
c004dae+dirty 412.86 ms 481.50 ms 68.64 ms
3b6e9f9+dirty 442.70 ms 486.44 ms 43.74 ms

App size

Revision Plain With Sentry Diff
44c8b3f+dirty 48.30 MiB 53.46 MiB 5.15 MiB
853723c+dirty 48.30 MiB 53.58 MiB 5.28 MiB
890d145+dirty 43.75 MiB 48.14 MiB 4.39 MiB
a50b33d+dirty 43.75 MiB 48.08 MiB 4.33 MiB
d038a14+dirty 48.30 MiB 53.49 MiB 5.19 MiB
b9bebee+dirty 48.30 MiB 53.58 MiB 5.28 MiB
5748023+dirty 48.30 MiB 53.54 MiB 5.23 MiB
6177334+dirty 48.30 MiB 53.54 MiB 5.23 MiB
c004dae+dirty 48.30 MiB 53.49 MiB 5.19 MiB
3b6e9f9+dirty 48.30 MiB 53.54 MiB 5.23 MiB

Previous results on branch: feat/android-profiling-measurements

Startup times

Revision Plain With Sentry Diff
54b88d2+dirty 448.04 ms 460.76 ms 12.72 ms

App size

Revision Plain With Sentry Diff
54b88d2+dirty 48.30 MiB 53.60 MiB 5.30 MiB

@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 3, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.13.0 (90) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3847.98 ms 1221.69 ms -2626.29 ms
Size 5.15 MiB 6.70 MiB 1.55 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
853723c+dirty 3852.60 ms 1234.64 ms -2617.96 ms
a50b33d+dirty 1197.74 ms 1197.17 ms -0.57 ms
3d377b5+dirty 1218.48 ms 1219.51 ms 1.03 ms
c151573+dirty 3841.06 ms 1232.13 ms -2608.93 ms
4b87b12+dirty 1212.90 ms 1222.09 ms 9.19 ms
7436d0f+dirty 3851.58 ms 1232.21 ms -2619.38 ms
267d3ed+dirty 3853.65 ms 1224.70 ms -2628.94 ms
c004dae+dirty 3850.32 ms 1227.79 ms -2622.53 ms
5125c43+dirty 3846.45 ms 1221.12 ms -2625.32 ms
ad66da3+dirty 3820.96 ms 1214.43 ms -2606.52 ms

App size

Revision Plain With Sentry Diff
853723c+dirty 5.15 MiB 6.69 MiB 1.53 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
3d377b5+dirty 3.38 MiB 4.76 MiB 1.38 MiB
c151573+dirty 5.15 MiB 6.68 MiB 1.53 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
7436d0f+dirty 5.15 MiB 6.70 MiB 1.54 MiB
267d3ed+dirty 5.15 MiB 6.69 MiB 1.54 MiB
c004dae+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5125c43+dirty 5.15 MiB 6.68 MiB 1.53 MiB
ad66da3+dirty 5.15 MiB 6.67 MiB 1.51 MiB

Previous results on branch: feat/android-profiling-measurements

Startup times

Revision Plain With Sentry Diff
54b88d2+dirty 3835.83 ms 1210.13 ms -2625.70 ms

App size

Revision Plain With Sentry Diff
54b88d2+dirty 5.15 MiB 6.70 MiB 1.55 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3827.98 ms 1215.00 ms -2612.98 ms
Size 5.15 MiB 6.70 MiB 1.55 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
853723c+dirty 3849.33 ms 1221.07 ms -2628.26 ms
a50b33d+dirty 1207.11 ms 1212.10 ms 5.00 ms
3d377b5+dirty 1201.55 ms 1201.80 ms 0.25 ms
c151573+dirty 3835.64 ms 1216.10 ms -2619.53 ms
4b87b12+dirty 1199.49 ms 1199.78 ms 0.29 ms
7436d0f+dirty 3861.51 ms 1231.07 ms -2630.44 ms
267d3ed+dirty 3860.14 ms 1223.39 ms -2636.76 ms
c004dae+dirty 3857.82 ms 1224.87 ms -2632.95 ms
5125c43+dirty 3827.94 ms 1208.79 ms -2619.15 ms
ad66da3+dirty 3855.02 ms 1213.43 ms -2641.59 ms

App size

Revision Plain With Sentry Diff
853723c+dirty 5.15 MiB 6.69 MiB 1.53 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
3d377b5+dirty 3.38 MiB 4.76 MiB 1.38 MiB
c151573+dirty 5.15 MiB 6.68 MiB 1.53 MiB
4b87b12+dirty 3.38 MiB 4.77 MiB 1.39 MiB
7436d0f+dirty 5.15 MiB 6.70 MiB 1.54 MiB
267d3ed+dirty 5.15 MiB 6.69 MiB 1.54 MiB
c004dae+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5125c43+dirty 5.15 MiB 6.68 MiB 1.53 MiB
ad66da3+dirty 5.15 MiB 6.67 MiB 1.51 MiB

Previous results on branch: feat/android-profiling-measurements

Startup times

Revision Plain With Sentry Diff
54b88d2+dirty 3836.52 ms 1224.31 ms -2612.22 ms

App size

Revision Plain With Sentry Diff
54b88d2+dirty 5.15 MiB 6.70 MiB 1.55 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 441.50 ms 474.20 ms 32.70 ms
Size 48.30 MiB 53.60 MiB 5.30 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a736b76+dirty 405.78 ms 458.74 ms 52.96 ms
853723c+dirty 415.82 ms 460.94 ms 45.12 ms
4953e94+dirty 398.80 ms 431.81 ms 33.01 ms
44c8b3f+dirty 492.13 ms 563.47 ms 71.34 ms
d038a14+dirty 405.08 ms 444.36 ms 39.28 ms
0d9949d+dirty 414.88 ms 428.68 ms 13.81 ms
b9bebee+dirty 500.50 ms 536.42 ms 35.92 ms
5748023+dirty 413.71 ms 468.71 ms 54.99 ms
7d6fd3a+dirty 435.06 ms 458.78 ms 23.72 ms
6177334+dirty 404.80 ms 456.74 ms 51.94 ms

App size

Revision Plain With Sentry Diff
a736b76+dirty 48.30 MiB 53.48 MiB 5.18 MiB
853723c+dirty 48.30 MiB 53.58 MiB 5.28 MiB
4953e94+dirty 43.94 MiB 48.94 MiB 5.00 MiB
44c8b3f+dirty 48.30 MiB 53.46 MiB 5.15 MiB
d038a14+dirty 48.30 MiB 53.49 MiB 5.19 MiB
0d9949d+dirty 43.94 MiB 48.99 MiB 5.05 MiB
b9bebee+dirty 48.30 MiB 53.58 MiB 5.28 MiB
5748023+dirty 48.30 MiB 53.54 MiB 5.23 MiB
7d6fd3a+dirty 43.94 MiB 49.00 MiB 5.06 MiB
6177334+dirty 48.30 MiB 53.54 MiB 5.23 MiB

Previous results on branch: feat/android-profiling-measurements

Startup times

Revision Plain With Sentry Diff
54b88d2+dirty 470.51 ms 483.38 ms 12.87 ms

App size

Revision Plain With Sentry Diff
54b88d2+dirty 48.30 MiB 53.60 MiB 5.30 MiB

The standalone SentryFrameMetricsCollector created in
initializeAndroidProfiler() missed the onActivityStarted callback
because the activity was already started, so currentWindow was
never set and no frame metrics were collected.

Reuse the collector from SentryAndroidOptions instead, which is
already tracking the active window from Sentry.init().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2b5745b. Configure here.

@antonis antonis marked this pull request as ready for review June 3, 2026 10:25
@antonis antonis merged commit cdb2ab0 into main Jun 3, 2026
108 of 111 checks passed
@antonis antonis deleted the feat/android-profiling-measurements branch June 3, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add memory, CPU and slow frames to Android Profiling

2 participants