Skip to content
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

feat: flutter profiling docs #7880

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -21,6 +21,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
- Mobile
- [Android](/platforms/android/profiling/)
- [iOS](/platforms/apple/guides/ios/profiling/)
- [Flutter](/platforms/flutter/profiling/) [experimental, iOS and macOS only]
- [React Native](/platforms/react-native/profiling/) [experimental]
- Standalone and server apps
- [Node.js](/platforms/node/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 @@ -12,6 +12,7 @@ description: "Profiling offers a deeper level of visibility on top of traditiona

- [Android (Java and Kotlin only)](/platforms/android/profiling/)
- [iOS (Swift and Objective-C only)](/platforms/apple/profiling/)
- [Flutter [experimental, iOS and macOS only]](/platforms/flutter/profiling/)
- [Python](/platforms/python/profiling/)
- [Node.js](/platforms/node/profiling/)
- [PHP (including Laravel and Symfony)](/platforms/php/profiling/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import 'package:sentry_flutter/sentry_flutter.dart';
SentryFlutter.init(
(options) => {
options.dsn = '___PUBLIC_DSN___',
options.dsn = '___PUBLIC_DSN___';
// To set a uniform sample rate
options.tracesSampleRate = 1.0,
options.tracesSampleRate = 1.0;
// OR if you prefer, determine traces sample rate based on the sampling context
options.tracesSampler = (samplingContext) {
// return a number between 0 and 1 or null (to fallback to configured value)
},
};
},
appRunner: () => runApp(MyApp()),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:sentry_flutter/sentry_flutter.dart';
SentryFlutter.init(
(options) => {
options.tracesSampleRate = 0.2,
options.tracesSampleRate = 0.2;
},
appRunner: () => runApp(MyApp()),
);
Expand Down
56 changes: 55 additions & 1 deletion src/platforms/common/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ sidebar_order: 5000
supported:
- android
- apple
- flutter
- go
- python
- ruby
- react-native
notSupported:
- unity
- dart
- flutter
- native
- javascript
- javascript.vue
Expand Down Expand Up @@ -39,6 +39,16 @@ React Native Profiling is currently in beta. Beta features are still in progress

</PlatformSection>

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

<Note>

Flutter Profiling is currently in alpha and only available for iOS and macOS apps. Alpha features are still in progress and may have bugs. We recognize the irony.

</Note>

</PlatformSection>

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

<Note>
Expand Down Expand Up @@ -113,6 +123,23 @@ Sentry.init({

</PlatformSection>

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

<SignInNote />

```dart
SentryFlutter.init(
(options) => {
options.dsn = '___PUBLIC_DSN___';
// We recommend adjusting this value in production:
options.tracesSampleRate = 1.0;
},
appRunner: () => runApp(MyApp()),
);
```

</PlatformSection>

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

<SignInNote />
Expand Down Expand Up @@ -310,6 +337,33 @@ Sentry.init({

</PlatformSection>

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

<Note>

Flutter Profiling alpha is available for iOS and macOS since SDK version `7.11.0`.

</Note>

To enable profiling, set the `profilesSampleRate`:

<SignInNote />

```dart
SentryFlutter.init(
(options) => {
options.dsn = '___PUBLIC_DSN___';
// We recommend adjusting this value in production:
options.tracesSampleRate = 1.0;
// The sampling rate for profiling is relative to tracesSampleRate:
options.profilesSampleRate = 1.0;
},
appRunner: () => runApp(MyApp()),
);
```

</PlatformSection>

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

<Note>
Expand Down
8 changes: 8 additions & 0 deletions src/platforms/common/profiling/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ If you don't see any profiling data in [sentry.io](https://sentry.io), you can t
- If the automatic instrumentation is not sending performance data, try using <PlatformLink to="/performance/instrumentation/custom-instrumentation">custom instrumentation</PlatformLink>.
- Enable <PlatformLink to="/configuration/options/#debug">debug mode</PlatformLink> in the SDK and check the logs.

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

### Limitations

Profiling is currently available only for iOS and macOS.

</PlatformSection>

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

### Limitations
Expand Down
Loading