Skip to content

Commit

Permalink
Add React Native Hermes Profiling Alpha (#7228)
Browse files Browse the repository at this point in the history
Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 27, 2023
1 parent 5cd88e6 commit 247bb7b
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/docs/product/profiling/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
- Mobile
- [Android](/platforms/android/profiling/)
- [iOS](/platforms/apple/guides/ios/profiling/)
- [React Native](/platforms/react-native/profiling/) [experimental]
- Standalone and server apps
- [Node.js](/platforms/node/profiling/)
- [Python](/platforms/python/profiling/)
Expand Down
1 change: 1 addition & 0 deletions src/docs/product/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ description: "Profiling offers a deeper level of visibility on top of traditiona
- [PHP (including Laravel and Symfony)](/platforms/php/profiling/)
- [Go [experimental]](/platforms/go/profiling/)
- [Ruby [experimental]](/platforms/ruby/profiling/)
- [React Native [experimental]](/platforms/react-native/profiling/)

</Note>

Expand Down
47 changes: 46 additions & 1 deletion src/platforms/common/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ supported:
- go
- python
- ruby
- react-native
notSupported:
- unity
- dart
- flutter
- native
- javascript
- javascript.vue
- react-native
- dotnet
- java
- java.spring-boot
Expand All @@ -29,6 +29,16 @@ notSupported:
description: "Learn how to enable profiling in your app if it is not already set up."
---

<PlatformSection supported={["react-native"]}>

<Note>

React Native Profiling is currently in alpha. Alpha features are still in progress and may have bugs. We recognize the irony.

</Note>

</PlatformSection>

<PlatformSection supported={["go"]}>

<Note>
Expand Down Expand Up @@ -92,6 +102,17 @@ In `AndroidManifest.xml`:

</PlatformSection>

<PlatformSection supported={["react-native"]}>

```javascript
Sentry.init({
dsn: "___DSN___",
tracesSampleRate: 1.0,
});
```

</PlatformSection>

<PlatformSection supported={["go"]}>

<SignInNote />
Expand Down Expand Up @@ -265,6 +286,30 @@ sentry_sdk.init(

</PlatformSection>

<PlatformSection supported={["react-native"]}>

<Note>

Profiling for React Native is available in alpha in SDK versions `5.7.0` and above.

</Note>

To enable profiling, set the `profilesSampleRate`:

```javascript
Sentry.init({
dsn: "___DSN___",
tracesSampleRate: 1.0,
_experiments: {
// profilesSampleRate is relative to tracesSampleRate.
// Here, we'll capture profiles for 100% of transactions.
profilesSampleRate: 1.0,
},
});
```

</PlatformSection>

<PlatformSection supported={["go"]}>

<Note>
Expand Down
13 changes: 12 additions & 1 deletion src/platforms/common/profiling/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ supported:
- python
- rust
- ruby
- react-native
notSupported:
- unity
- dart
- flutter
- native
- javascript
- javascript.vue
- react-native
- dotnet
- java
- java.spring-boot
Expand Down Expand Up @@ -54,3 +54,14 @@ As always, and especially with Profiling in Go being an alpha feature, feedback
Profiles for multi-threaded servers like `puma` might not capture frames correctly when async I/O is happening. This is a limitation of `stackprof`.

</PlatformSection>

<PlatformSection supported={["react-native"]}>

### Limitations

Because profile samples are collected at a fixed sampling frequency, we recommend checking if profiling's [Performance Overhead](/product/profiling/performance-overhead) is acceptable for your use case. Note that
we're working on symbolication of the collected profiles which means that at the moment you'll see only function names but not resolved source file paths.

As always, and especially since Profiling in React Native is an alpha feature, feedback is welcome on [Discord](https://discord.com/channels/621778831602221064/750735628932612096) or [GitHub](https://github.com/getsentry/sentry-react-native/issues/2668).

</PlatformSection>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: React Native
doc_link: https://docs.sentry.io/platforms/react-native/profiling/
support_level: alpha
type: language
---

<div class='alert warning'>
React Native Profiling is currently in alpha, and there may be some bugs. We recognize the irony.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: React Native
doc_link: https://docs.sentry.io/platforms/react-native/profiling/
support_level: alpha
type: language
---

#### Install

For the Profiling integration to work, you must have the Sentry React Native SDK (minimum version v5.7.0). Learn more about installation methods in our [full documentation](https://docs.sentry.io/platforms/react-native/#install).
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: React Native
doc_link: https://docs.sentry.io/platforms/react-native/profiling/
support_level: alpha
type: language
---

#### Configure Performance

Sentry’s performance monitoring product has to be enabled in order for Profiling to work. To enable performance monitoring in the SDK:

```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: React Native
doc_link: https://docs.sentry.io/platforms/react-native/profiling/
support_level: alpha
type: language
---

#### Configure Profiling

Add the `profilesSampleRate` option to your SDK config.

```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
_experiments: {
// The sampling rate for profiling is relative to TracesSampleRate.
// In this case, we'll capture profiles for 100% of transactions.
profilesSampleRate: 1.0,
},
});
```

1 comment on commit 247bb7b

@vercel
Copy link

@vercel vercel bot commented on 247bb7b Jul 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sentry-docs – ./

docs.sentry.io
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev

Please sign in to comment.