Skip to content

Commit 639c15d

Browse files
a-haritibitsandfoxes
authored andcommitted
refactor: migrate Dart and Flutter sdks to inline product options syntax(#13414)
1 parent 587b69b commit 639c15d

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

docs/platforms/dart/common/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dependencies:
5151
To capture all errors, initialize the Sentry Dart SDK as soon as possible.
5252
5353
54-
```dart {"onboardingOptions": {"performance": "9-11"}}
54+
```dart
5555
import 'package:sentry/sentry.dart';
5656

5757
Future<void> main() async {
@@ -60,9 +60,11 @@ Future<void> main() async {
6060
// Adds request headers and IP for users,
6161
// visit: https://docs.sentry.io/platforms/dart/data-management/data-collected/ for more info
6262
options.sendDefaultPii = true;
63+
// ___PRODUCT_OPTION_START___ performance
6364
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
6465
// We recommend adjusting this value in production.
6566
options.tracesSampleRate = 1.0;
67+
// ___PRODUCT_OPTION_END___ performance
6668
});
6769

6870
// you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and

docs/platforms/dart/guides/flutter/index.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ npx @sentry/wizard@latest -i flutter
6161

6262
Configuration should happen as early as possible in your application's lifecycle.
6363

64-
```dart {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}}
64+
```dart
6565
import 'package:flutter/widgets.dart';
6666
import 'package:sentry_flutter/sentry_flutter.dart';
6767
@@ -72,13 +72,17 @@ Future<void> main() async {
7272
// Adds request headers and IP for users,
7373
// visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
7474
options.sendDefaultPii = true;
75+
// ___PRODUCT_OPTION_START___ performance
7576
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
7677
// We recommend adjusting this value in production.
7778
options.tracesSampleRate = 1.0;
79+
// ___PRODUCT_OPTION_END___ performance
80+
// ___PRODUCT_OPTION_START___ profiling
7881
// The sampling rate for profiling is relative to tracesSampleRate
7982
// Setting to 1.0 will profile 100% of sampled transactions:
8083
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
8184
options.profilesSampleRate = 1.0;
85+
// ___PRODUCT_OPTION_END___ profiling
8286
},
8387
appRunner: () => runApp(
8488
SentryWidget(
@@ -92,7 +96,7 @@ Future<void> main() async {
9296
}
9397
```
9498

95-
```dart {tabTitle:With custom zone} {"onboardingOptions": {"performance": "19-21", "profiling": "22-25"}}
99+
```dart {tabTitle:With custom zone}
96100
import 'package:flutter/widgets.dart';
97101
import 'package:sentry_flutter/sentry_flutter.dart';
98102
@@ -111,13 +115,17 @@ Future<void> main() async {
111115
// Adds request headers and IP for users,
112116
// visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
113117
options.sendDefaultPii = true;
118+
// ___PRODUCT_OPTION_START___ performance
114119
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
115120
// We recommend adjusting this value in production.
116121
options.tracesSampleRate = 1.0;
122+
// ___PRODUCT_OPTION_END___ performance
123+
// ___PRODUCT_OPTION_START___ profiling
117124
// The sampling rate for profiling is relative to tracesSampleRate
118125
// Setting to 1.0 will profile 100% of sampled transactions:
119126
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
120127
options.profilesSampleRate = 1.0;
128+
// ___PRODUCT_OPTION_END___ profiling
121129
},
122130
appRunner: () => runApp(
123131
SentryWidget(

docs/platforms/dart/guides/flutter/manual-setup.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
2828
Configuration should happen as early as possible in your application's lifecycle.
2929
30-
```dart {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}}
30+
```dart
3131
import 'package:flutter/widgets.dart';
3232
import 'package:sentry_flutter/sentry_flutter.dart';
3333

@@ -38,13 +38,17 @@ Future<void> main() async {
3838
// Adds request headers and IP for users,
3939
// visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
4040
options.sendDefaultPii = true;
41+
// ___PRODUCT_OPTION_START___ performance
4142
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
4243
// We recommend adjusting this value in production.
4344
options.tracesSampleRate = 1.0;
45+
// ___PRODUCT_OPTION_END___ performance
46+
// ___PRODUCT_OPTION_START___ profiling
4447
// The sampling rate for profiling is relative to tracesSampleRate
4548
// Setting to 1.0 will profile 100% of sampled transactions:
4649
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
4750
options.profilesSampleRate = 1.0;
51+
// ___PRODUCT_OPTION_END___ profiling
4852
},
4953
appRunner: () => runApp(
5054
SentryWidget(
@@ -58,7 +62,7 @@ Future<void> main() async {
5862
}
5963
```
6064

61-
```dart {tabTitle:With custom zone} {"onboardingOptions": {"performance": "19-21", "profiling": "22-25"}}
65+
```dart {tabTitle:With custom zone}
6266
import 'package:flutter/widgets.dart';
6367
import 'package:sentry_flutter/sentry_flutter.dart';
6468
@@ -77,13 +81,17 @@ Future<void> main() async {
7781
// Adds request headers and IP for users,
7882
// visit: https://docs.sentry.io/platforms/dart/guides//data-management/data-collected/ for more info
7983
options.sendDefaultPii = true;
84+
// ___PRODUCT_OPTION_START___ performance
8085
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
8186
// We recommend adjusting this value in production.
8287
options.tracesSampleRate = 1.0;
88+
// ___PRODUCT_OPTION_END___ performance
89+
// ___PRODUCT_OPTION_START___ profiling
8390
// The sampling rate for profiling is relative to tracesSampleRate
8491
// Setting to 1.0 will profile 100% of sampled transactions:
8592
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
8693
options.profilesSampleRate = 1.0;
94+
// ___PRODUCT_OPTION_END___ profiling
8795
},
8896
appRunner: () => runApp(
8997
SentryWidget(

0 commit comments

Comments
 (0)