Skip to content

Commit 61ddbf1

Browse files
committed
feat: flutter profiling docs
1 parent aa2c1d3 commit 61ddbf1

File tree

6 files changed

+69
-5
lines changed

6 files changed

+69
-5
lines changed

src/docs/product/profiling/getting-started.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
2121
- Mobile
2222
- [Android](/platforms/android/profiling/)
2323
- [iOS](/platforms/apple/guides/ios/profiling/)
24+
- [Flutter](/platforms/flutter/profiling/) [experimental, iOS and macOS only]
2425
- [React Native](/platforms/react-native/profiling/) [experimental]
2526
- Standalone and server apps
2627
- [Node.js](/platforms/node/profiling/)

src/docs/product/profiling/index.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ description: "Profiling offers a deeper level of visibility on top of traditiona
1212

1313
- [Android (Java and Kotlin only)](/platforms/android/profiling/)
1414
- [iOS (Swift and Objective-C only)](/platforms/apple/profiling/)
15+
- [Flutter [experimental, iOS and macOS only]](/platforms/flutter/profiling/)
1516
- [Python](/platforms/python/profiling/)
1617
- [Node.js](/platforms/node/profiling/)
1718
- [PHP (including Laravel and Symfony)](/platforms/php/profiling/)

src/platform-includes/performance/configure-sample-rate/flutter.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import 'package:sentry_flutter/sentry_flutter.dart';
66
77
SentryFlutter.init(
88
(options) => {
9-
options.dsn = '___PUBLIC_DSN___',
9+
options.dsn = '___PUBLIC_DSN___';
1010
// To set a uniform sample rate
11-
options.tracesSampleRate = 1.0,
11+
options.tracesSampleRate = 1.0;
1212
// OR if you prefer, determine traces sample rate based on the sampling context
1313
options.tracesSampler = (samplingContext) {
1414
// return a number between 0 and 1 or null (to fallback to configured value)
15-
},
15+
};
1616
},
1717
appRunner: () => runApp(MyApp()),
1818
);

src/platform-includes/performance/traces-sample-rate/flutter.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:sentry_flutter/sentry_flutter.dart';
44
55
SentryFlutter.init(
66
(options) => {
7-
options.tracesSampleRate = 0.2,
7+
options.tracesSampleRate = 0.2;
88
},
99
appRunner: () => runApp(MyApp()),
1010
);

src/platforms/common/profiling/index.mdx

+55-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ sidebar_order: 5000
44
supported:
55
- android
66
- apple
7+
- flutter
78
- go
89
- python
910
- ruby
1011
- react-native
1112
notSupported:
1213
- unity
1314
- dart
14-
- flutter
1515
- native
1616
- javascript
1717
- javascript.vue
@@ -39,6 +39,16 @@ React Native Profiling is currently in beta. Beta features are still in progress
3939

4040
</PlatformSection>
4141

42+
<PlatformSection supported={["flutter"]}>
43+
44+
<Note>
45+
46+
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.
47+
48+
</Note>
49+
50+
</PlatformSection>
51+
4252
<PlatformSection supported={["go"]}>
4353

4454
<Note>
@@ -113,6 +123,23 @@ Sentry.init({
113123

114124
</PlatformSection>
115125

126+
<PlatformSection supported={["flutter"]}>
127+
128+
<SignInNote />
129+
130+
```dart
131+
SentryFlutter.init(
132+
(options) => {
133+
options.dsn = '___PUBLIC_DSN___';
134+
// We recommend adjusting this value in production:
135+
options.tracesSampleRate = 1.0;
136+
},
137+
appRunner: () => runApp(MyApp()),
138+
);
139+
```
140+
141+
</PlatformSection>
142+
116143
<PlatformSection supported={["go"]}>
117144

118145
<SignInNote />
@@ -310,6 +337,33 @@ Sentry.init({
310337

311338
</PlatformSection>
312339

340+
<PlatformSection supported={["flutter"]}>
341+
342+
<Note>
343+
344+
Flutter Profiling alpha is available for iOS and macOS since SDK version `7.11.0`.
345+
346+
</Note>
347+
348+
To enable profiling, set the `profilesSampleRate`:
349+
350+
<SignInNote />
351+
352+
```dart
353+
SentryFlutter.init(
354+
(options) => {
355+
options.dsn = '___PUBLIC_DSN___';
356+
// We recommend adjusting this value in production:
357+
options.tracesSampleRate = 1.0;
358+
// The sampling rate for profiling is relative to TracesSampleRate:
359+
options.profilesSampleRate = 1.0;
360+
},
361+
appRunner: () => runApp(MyApp()),
362+
);
363+
```
364+
365+
</PlatformSection>
366+
313367
<PlatformSection supported={["go"]}>
314368

315369
<Note>

src/platforms/common/profiling/troubleshooting.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ If you don't see any profiling data in [sentry.io](https://sentry.io), you can t
3636
- If the automatic instrumentation is not sending performance data, try using <PlatformLink to="/performance/instrumentation/custom-instrumentation">custom instrumentation</PlatformLink>.
3737
- Enable <PlatformLink to="/configuration/options/#debug">debug mode</PlatformLink> in the SDK and check the logs.
3838

39+
<PlatformSection supported={["flutter"]}>
40+
41+
### Limitations
42+
43+
Profiling is currently available only for iOS and macOS.
44+
45+
</PlatformSection>
46+
3947
<PlatformSection supported={["go"]}>
4048

4149
### Limitations

0 commit comments

Comments
 (0)