From cb571bacdc6525d25a048c0889d8590cec5af409 Mon Sep 17 00:00:00 2001 From: Abdellah Hariti Date: Mon, 14 Apr 2025 17:24:41 +0100 Subject: [PATCH] migrate dart and flutter sdks to new syntax --- docs/platforms/dart/common/index.mdx | 4 +++- docs/platforms/dart/guides/flutter/index.mdx | 12 ++++++++++-- docs/platforms/dart/guides/flutter/manual-setup.mdx | 12 ++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/platforms/dart/common/index.mdx b/docs/platforms/dart/common/index.mdx index dba54a9ab4cf4..2186b8bd9e769 100644 --- a/docs/platforms/dart/common/index.mdx +++ b/docs/platforms/dart/common/index.mdx @@ -51,7 +51,7 @@ dependencies: To capture all errors, initialize the Sentry Dart SDK as soon as possible. -```dart {"onboardingOptions": {"performance": "9-11"}} +```dart import 'package:sentry/sentry.dart'; Future main() async { @@ -60,9 +60,11 @@ Future main() async { // Adds request headers and IP for users, // visit: https://docs.sentry.io/platforms/dart/data-management/data-collected/ for more info options.sendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance }); // you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and diff --git a/docs/platforms/dart/guides/flutter/index.mdx b/docs/platforms/dart/guides/flutter/index.mdx index 0a5a97b22c5fc..89912a562c96c 100644 --- a/docs/platforms/dart/guides/flutter/index.mdx +++ b/docs/platforms/dart/guides/flutter/index.mdx @@ -61,7 +61,7 @@ npx @sentry/wizard@latest -i flutter Configuration should happen as early as possible in your application's lifecycle. -```dart {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```dart import 'package:flutter/widgets.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -72,13 +72,17 @@ Future main() async { // Adds request headers and IP for users, // visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info options.sendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling // The sampling rate for profiling is relative to tracesSampleRate // Setting to 1.0 will profile 100% of sampled transactions: // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ profiling }, appRunner: () => runApp( SentryWidget( @@ -92,7 +96,7 @@ Future main() async { } ``` -```dart {tabTitle:With custom zone} {"onboardingOptions": {"performance": "19-21", "profiling": "22-25"}} +```dart {tabTitle:With custom zone} import 'package:flutter/widgets.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -111,13 +115,17 @@ Future main() async { // Adds request headers and IP for users, // visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info options.sendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling // The sampling rate for profiling is relative to tracesSampleRate // Setting to 1.0 will profile 100% of sampled transactions: // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ profiling }, appRunner: () => runApp( SentryWidget( diff --git a/docs/platforms/dart/guides/flutter/manual-setup.mdx b/docs/platforms/dart/guides/flutter/manual-setup.mdx index d8e7241aa88dd..f8ce369e4b763 100644 --- a/docs/platforms/dart/guides/flutter/manual-setup.mdx +++ b/docs/platforms/dart/guides/flutter/manual-setup.mdx @@ -27,7 +27,7 @@ dependencies: Configuration should happen as early as possible in your application's lifecycle. -```dart {"onboardingOptions": {"performance": "11-13", "profiling": "14-17"}} +```dart import 'package:flutter/widgets.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -38,13 +38,17 @@ Future main() async { // Adds request headers and IP for users, // visit: https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info options.sendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling // The sampling rate for profiling is relative to tracesSampleRate // Setting to 1.0 will profile 100% of sampled transactions: // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ profiling }, appRunner: () => runApp( SentryWidget( @@ -58,7 +62,7 @@ Future main() async { } ``` -```dart {tabTitle:With custom zone} {"onboardingOptions": {"performance": "19-21", "profiling": "22-25"}} +```dart {tabTitle:With custom zone} import 'package:flutter/widgets.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -77,13 +81,17 @@ Future main() async { // Adds request headers and IP for users, // visit: https://docs.sentry.io/platforms/dart/guides//data-management/data-collected/ for more info options.sendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling // The sampling rate for profiling is relative to tracesSampleRate // Setting to 1.0 will profile 100% of sampled transactions: // Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0 options.profilesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ profiling }, appRunner: () => runApp( SentryWidget(