Skip to content

Commit

Permalink
feat: flutter profiling docs (#8363)
Browse files Browse the repository at this point in the history
* feat: flutter profiling docs

* Update src/platforms/common/profiling/index.mdx

Co-authored-by: Shana Matthews <[email protected]>

---------

Co-authored-by: Shana Matthews <[email protected]>
  • Loading branch information
vaind and shanamatthews authored Nov 1, 2023
1 parent c11feb5 commit 177e850
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 5 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 @@ -22,6 +22,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
- [Android](/platforms/android/profiling/)
- [iOS](/platforms/apple/guides/ios/profiling/)
- [React Native](/platforms/react-native/profiling/) [beta]
- [Flutter](/platforms/flutter/profiling/) [experimental, iOS and macOS only]
- 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 @@ -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
47 changes: 46 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 @@ -85,6 +85,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 @@ -282,6 +299,34 @@ Sentry.init({

</PlatformSection>

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

<Note>

Flutter Profiling alpha is available for iOS and macOS since SDK version `7.12.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
// Setting to 1.0 will profile 100% of sampled transactions:
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

1 comment on commit 177e850

@vercel
Copy link

@vercel vercel bot commented on 177e850 Nov 1, 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.