-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
React Native UI profiling docs: now with information about iOS profiling #16260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alwx
wants to merge
2
commits into
master
Choose a base branch
from
alwx/docs/ui-profiling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16
−7
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,29 +67,38 @@ Sentry.init({ | |||||
|
|
||||||
| Default value `true`, platform profilers are enabled. By default both React Native JS code executed in Hermes engine and platform specific code (Swift, Objective-C, Kotlin, Java) are profiled by their respective profilers. Setting `platformProfilers` to `false` will disable profiling of the platform specific code and only the JS code executed in Hermes will be profiled. This option is available since the SDK version [5.33.0](https://github.com/getsentry/sentry-react-native/releases/tag/5.33.0). | ||||||
|
|
||||||
| ## Android UI Profiling (experimental) | ||||||
| ## UI Profiling (experimental) | ||||||
|
|
||||||
| <Alert> | ||||||
|
|
||||||
| Profiling for React Native is available in SDK versions `7.9.0` and above. Android is currently the only supported platform, and support is still experimental. | ||||||
| UI Profiling for React Native is available in SDK versions `7.9.0` and above on Android. iOS support was added in `7.12.0`. This feature is still experimental. | ||||||
|
|
||||||
| </Alert> | ||||||
|
|
||||||
| ```javascript | ||||||
| import * as Sentry from '@sentry/react-native'; | ||||||
| import * as Sentry from "@sentry/react-native"; | ||||||
|
|
||||||
| Sentry.init({ | ||||||
| dsn: 'YOUR_DSN', | ||||||
| dsn: "YOUR_DSN", | ||||||
| tracesSampleRate: 1.0, // Required for trace mode | ||||||
|
|
||||||
| _experiments: { | ||||||
| androidProfilingOptions: { | ||||||
| profilingOptions: { | ||||||
| profileSessionSampleRate: 1.0, | ||||||
| lifecycle: 'trace', | ||||||
| lifecycle: "trace", | ||||||
| startOnAppStart: true, | ||||||
| }, | ||||||
| }, | ||||||
| }); | ||||||
| ``` | ||||||
|
|
||||||
| For more information, see [the Android SDK documentation](https://docs.sentry.io/platforms/android/profiling/#enabling-ui-profiling) | ||||||
| <Note> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Hey @alwx, I think this is why your builds are failing, we deprecated |
||||||
|
|
||||||
| The `androidProfilingOptions` key is now deprecated. Use `profilingOptions` instead. | ||||||
|
|
||||||
| </Note> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For more information, see the platform-specific documentation: | ||||||
|
|
||||||
| - [Android SDK documentation](https://docs.sentry.io/platforms/android/profiling/#enabling-ui-profiling) | ||||||
| - [iOS SDK documentation](https://docs.sentry.io/platforms/apple/guides/ios/profiling/#enable-ui-profiling) | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The documentation suggests
startOnAppStart: trueworks for iOS, but this option is not supported by the native iOS SDK and will be silently ignored.Severity: MEDIUM
Suggested Fix
Update the documentation to clarify that
startOnAppStartis an Android-only option. Provide separate configuration examples or add a note explaining the platform-specific behavior within the unified example.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.