From f463c04f0355d58c22c9c34083afbcdcefe9cc6b Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Wed, 3 Mar 2021 15:04:23 -0800 Subject: [PATCH 1/9] refactor GS to common --- .../getting-started-install/flutter.mdx | 2 ++ .../getting-started-primer/flutter.mdx | 14 ++++++++--- src/platforms/flutter/index.mdx | 23 ------------------- 3 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 src/platforms/flutter/index.mdx diff --git a/src/includes/getting-started-install/flutter.mdx b/src/includes/getting-started-install/flutter.mdx index d8632253c5ee6..98da6b18121b6 100644 --- a/src/includes/getting-started-install/flutter.mdx +++ b/src/includes/getting-started-install/flutter.mdx @@ -1,3 +1,5 @@ +Get the SDK from [pub.dev](https://pub.dev/packages/sentry_flutter) by adding the following to your `pubspec.yaml`: + ```yml {filename:pubspec.yaml} dependencies: sentry_flutter: ^4.0.4 diff --git a/src/includes/getting-started-primer/flutter.mdx b/src/includes/getting-started-primer/flutter.mdx index 6f8bae740e9ea..cb04cb6868098 100644 --- a/src/includes/getting-started-primer/flutter.mdx +++ b/src/includes/getting-started-primer/flutter.mdx @@ -1,7 +1,15 @@ -_Sentry's Flutter SDK enables capturing sessions for Release Health, offline caching as well as reporting messages and errors._ - -_Sentry's Flutter SDK depends on the [Dart SDK](/platforms/dart/) and includes support to native crashes through Sentry's native SDKs (Android and iOS), It'll capture errors in the native layer, including Java, Kotlin, C and C++ code for `Android` and ObjC, Swift and C for `iOS`._ +_Sentry's Flutter SDK enables automatic reporting of errors, messages, and exceptions. The Sentry Dart/Flutter SDK is available on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/)._ + +Features: + +- Automatic native crash error tracking (using both [Android](/platforms/android/) and [iOS](/platforms/apple/)), including + - Java, Kotlin, C, and C++ code for Android + - ObjC, Swift, and C for iOS +- Offline storage of events +- Events [enriched](/platforms/flutter/enriching-events/context/) with device data +- [Release Health](/product/releases/health/) tracks crash free users and sessions +- Under the hood the SDK relies on the [Dart SDK](/platforms/dart/) diff --git a/src/platforms/flutter/index.mdx b/src/platforms/flutter/index.mdx deleted file mode 100644 index 2ff6baac038a4..0000000000000 --- a/src/platforms/flutter/index.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Flutter ---- - - - -Get the SDK from [pub.dev](https://pub.dev/packages/sentry_flutter) by adding the following to your `pubspec.yaml`: - - - -Import `Sentry` and initialize it: - - - -Capture a test exception: - - - -### Source code - -The Sentry Dart/Flutter SDK can be found on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/). - - From 823a79142427ead85d9411b7f6a5913c8642e840 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Wed, 3 Mar 2021 15:22:27 -0800 Subject: [PATCH 2/9] update common to correct display of tracing options --- src/platforms/common/configuration/options.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platforms/common/configuration/options.mdx b/src/platforms/common/configuration/options.mdx index 5e23352e8309f..3f0f853120358 100644 --- a/src/platforms/common/configuration/options.mdx +++ b/src/platforms/common/configuration/options.mdx @@ -284,16 +284,20 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events + + ## Tracing Options - + A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or must be defined to enable tracing. - + A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or must be defined to enable tracing. + + From 14b38728144925ebdee471683da099bb61de3479 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Wed, 3 Mar 2021 15:38:34 -0800 Subject: [PATCH 3/9] fix filtering display --- src/platforms/common/configuration/filtering.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/common/configuration/filtering.mdx b/src/platforms/common/configuration/filtering.mdx index 897c712fb51a9..83b2ed9f9797c 100644 --- a/src/platforms/common/configuration/filtering.mdx +++ b/src/platforms/common/configuration/filtering.mdx @@ -90,7 +90,7 @@ In this example, the fingerprint is forced to a common value if an exception of - + ## Using Sampling to Filter Transaction Events From e36a3cd70782f52aa148780c99182a9c13c085a7 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Wed, 3 Mar 2021 16:03:54 -0800 Subject: [PATCH 4/9] fix automatic breadcrumbs and associated includes --- .../automatic-breadcrumbs/_default.mdx | 1 + .../automatic-breadcrumbs/flutter.mdx | 20 +++++++++++++++ .../before-breadcrumb/android.mdx | 0 .../before-breadcrumb/apple.mdx | 0 .../before-breadcrumb/dart.mdx | 0 .../before-breadcrumb/dotnet.mdx | 0 .../before-breadcrumb/dotnet.xamarin.mdx | 2 +- .../before-breadcrumb/go.mdx | 0 .../before-breadcrumb/java.mdx | 0 .../before-breadcrumb/javascript.mdx | 0 .../before-breadcrumb/native.mdx | 0 .../before-breadcrumb/php.laravel.mdx | 0 .../before-breadcrumb/php.mdx | 0 .../before-breadcrumb/python.mdx | 0 .../before-breadcrumb/ruby.mdx | 0 .../breadcrumbs-example/apple.mdx | 0 .../breadcrumbs-example/dart.mdx | 0 .../breadcrumbs-example/dotnet.mdx | 0 .../breadcrumbs-example/go.mdx | 0 .../breadcrumbs-example/java.mdx | 0 .../breadcrumbs-example/javascript.mdx | 0 .../breadcrumbs-example/native.mdx | 0 .../breadcrumbs-example/php.mdx | 0 .../breadcrumbs-example/python.mdx | 0 .../breadcrumbs-example/ruby.mdx | 0 .../breadcrumbs-example/rust.mdx | 0 .../getting-started-primer/flutter.mdx | 7 ++++-- .../common/enriching-events/breadcrumbs.mdx | 6 ++--- .../flutter/usage/advanced-usage.mdx | 25 ++----------------- 29 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 src/includes/breadcrumbs/automatic-breadcrumbs/_default.mdx create mode 100644 src/includes/breadcrumbs/automatic-breadcrumbs/flutter.mdx rename src/includes/{ => breadcrumbs}/before-breadcrumb/android.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/apple.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/dart.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/dotnet.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/dotnet.xamarin.mdx (98%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/go.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/java.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/javascript.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/native.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/php.laravel.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/php.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/python.mdx (100%) rename src/includes/{ => breadcrumbs}/before-breadcrumb/ruby.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/apple.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/dart.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/dotnet.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/go.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/java.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/javascript.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/native.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/php.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/python.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/ruby.mdx (100%) rename src/includes/{ => breadcrumbs}/breadcrumbs-example/rust.mdx (100%) diff --git a/src/includes/breadcrumbs/automatic-breadcrumbs/_default.mdx b/src/includes/breadcrumbs/automatic-breadcrumbs/_default.mdx new file mode 100644 index 0000000000000..38e71cc6745a8 --- /dev/null +++ b/src/includes/breadcrumbs/automatic-breadcrumbs/_default.mdx @@ -0,0 +1 @@ +SDKs and their associated integrations will automatically record many types of breadcrumbs. For instance, the browser JavaScript SDK will automatically record all location changes. diff --git a/src/includes/breadcrumbs/automatic-breadcrumbs/flutter.mdx b/src/includes/breadcrumbs/automatic-breadcrumbs/flutter.mdx new file mode 100644 index 0000000000000..2aa7833b942cc --- /dev/null +++ b/src/includes/breadcrumbs/automatic-breadcrumbs/flutter.mdx @@ -0,0 +1,20 @@ +The Flutter SDK already captures breadcrumbs automatically via the Native SDKs. + +- [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) +- [Automatic Breadcrumbs for iOS](/platforms/apple/usage/#sentryautobreadcrumbtrackingintegration) + +If you wish to add additional Navigation breadcrumbs for Flutter Apps, Add the `SentryNavigatorObserver` to your `MaterialApp`, `WidgetsApp` or `CupertinoApp` + +```dart +import 'package:flutter/material.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; + +MaterialApp( + navigatorObservers: [ + SentryNavigatorObserver(), + ], + // other parameters +) +``` + +To track automatic Breadcrumbs for `HTTP` requests, Check out the [SentryHttpClient](/platforms/dart/usage/advanced-usage/#automatic-breadcrumbs) Wrapper for the [http](https://pub.dev/packages/http) library. diff --git a/src/includes/before-breadcrumb/android.mdx b/src/includes/breadcrumbs/before-breadcrumb/android.mdx similarity index 100% rename from src/includes/before-breadcrumb/android.mdx rename to src/includes/breadcrumbs/before-breadcrumb/android.mdx diff --git a/src/includes/before-breadcrumb/apple.mdx b/src/includes/breadcrumbs/before-breadcrumb/apple.mdx similarity index 100% rename from src/includes/before-breadcrumb/apple.mdx rename to src/includes/breadcrumbs/before-breadcrumb/apple.mdx diff --git a/src/includes/before-breadcrumb/dart.mdx b/src/includes/breadcrumbs/before-breadcrumb/dart.mdx similarity index 100% rename from src/includes/before-breadcrumb/dart.mdx rename to src/includes/breadcrumbs/before-breadcrumb/dart.mdx diff --git a/src/includes/before-breadcrumb/dotnet.mdx b/src/includes/breadcrumbs/before-breadcrumb/dotnet.mdx similarity index 100% rename from src/includes/before-breadcrumb/dotnet.mdx rename to src/includes/breadcrumbs/before-breadcrumb/dotnet.mdx diff --git a/src/includes/before-breadcrumb/dotnet.xamarin.mdx b/src/includes/breadcrumbs/before-breadcrumb/dotnet.xamarin.mdx similarity index 98% rename from src/includes/before-breadcrumb/dotnet.xamarin.mdx rename to src/includes/breadcrumbs/before-breadcrumb/dotnet.xamarin.mdx index 8092fd53b96e2..5c8d57c299c18 100644 --- a/src/includes/before-breadcrumb/dotnet.xamarin.mdx +++ b/src/includes/breadcrumbs/before-breadcrumb/dotnet.xamarin.mdx @@ -9,4 +9,4 @@ SentryXamarin.Init(options => ? null : breadcrumb; }); -``` \ No newline at end of file +``` diff --git a/src/includes/before-breadcrumb/go.mdx b/src/includes/breadcrumbs/before-breadcrumb/go.mdx similarity index 100% rename from src/includes/before-breadcrumb/go.mdx rename to src/includes/breadcrumbs/before-breadcrumb/go.mdx diff --git a/src/includes/before-breadcrumb/java.mdx b/src/includes/breadcrumbs/before-breadcrumb/java.mdx similarity index 100% rename from src/includes/before-breadcrumb/java.mdx rename to src/includes/breadcrumbs/before-breadcrumb/java.mdx diff --git a/src/includes/before-breadcrumb/javascript.mdx b/src/includes/breadcrumbs/before-breadcrumb/javascript.mdx similarity index 100% rename from src/includes/before-breadcrumb/javascript.mdx rename to src/includes/breadcrumbs/before-breadcrumb/javascript.mdx diff --git a/src/includes/before-breadcrumb/native.mdx b/src/includes/breadcrumbs/before-breadcrumb/native.mdx similarity index 100% rename from src/includes/before-breadcrumb/native.mdx rename to src/includes/breadcrumbs/before-breadcrumb/native.mdx diff --git a/src/includes/before-breadcrumb/php.laravel.mdx b/src/includes/breadcrumbs/before-breadcrumb/php.laravel.mdx similarity index 100% rename from src/includes/before-breadcrumb/php.laravel.mdx rename to src/includes/breadcrumbs/before-breadcrumb/php.laravel.mdx diff --git a/src/includes/before-breadcrumb/php.mdx b/src/includes/breadcrumbs/before-breadcrumb/php.mdx similarity index 100% rename from src/includes/before-breadcrumb/php.mdx rename to src/includes/breadcrumbs/before-breadcrumb/php.mdx diff --git a/src/includes/before-breadcrumb/python.mdx b/src/includes/breadcrumbs/before-breadcrumb/python.mdx similarity index 100% rename from src/includes/before-breadcrumb/python.mdx rename to src/includes/breadcrumbs/before-breadcrumb/python.mdx diff --git a/src/includes/before-breadcrumb/ruby.mdx b/src/includes/breadcrumbs/before-breadcrumb/ruby.mdx similarity index 100% rename from src/includes/before-breadcrumb/ruby.mdx rename to src/includes/breadcrumbs/before-breadcrumb/ruby.mdx diff --git a/src/includes/breadcrumbs-example/apple.mdx b/src/includes/breadcrumbs/breadcrumbs-example/apple.mdx similarity index 100% rename from src/includes/breadcrumbs-example/apple.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/apple.mdx diff --git a/src/includes/breadcrumbs-example/dart.mdx b/src/includes/breadcrumbs/breadcrumbs-example/dart.mdx similarity index 100% rename from src/includes/breadcrumbs-example/dart.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/dart.mdx diff --git a/src/includes/breadcrumbs-example/dotnet.mdx b/src/includes/breadcrumbs/breadcrumbs-example/dotnet.mdx similarity index 100% rename from src/includes/breadcrumbs-example/dotnet.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/dotnet.mdx diff --git a/src/includes/breadcrumbs-example/go.mdx b/src/includes/breadcrumbs/breadcrumbs-example/go.mdx similarity index 100% rename from src/includes/breadcrumbs-example/go.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/go.mdx diff --git a/src/includes/breadcrumbs-example/java.mdx b/src/includes/breadcrumbs/breadcrumbs-example/java.mdx similarity index 100% rename from src/includes/breadcrumbs-example/java.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/java.mdx diff --git a/src/includes/breadcrumbs-example/javascript.mdx b/src/includes/breadcrumbs/breadcrumbs-example/javascript.mdx similarity index 100% rename from src/includes/breadcrumbs-example/javascript.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/javascript.mdx diff --git a/src/includes/breadcrumbs-example/native.mdx b/src/includes/breadcrumbs/breadcrumbs-example/native.mdx similarity index 100% rename from src/includes/breadcrumbs-example/native.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/native.mdx diff --git a/src/includes/breadcrumbs-example/php.mdx b/src/includes/breadcrumbs/breadcrumbs-example/php.mdx similarity index 100% rename from src/includes/breadcrumbs-example/php.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/php.mdx diff --git a/src/includes/breadcrumbs-example/python.mdx b/src/includes/breadcrumbs/breadcrumbs-example/python.mdx similarity index 100% rename from src/includes/breadcrumbs-example/python.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/python.mdx diff --git a/src/includes/breadcrumbs-example/ruby.mdx b/src/includes/breadcrumbs/breadcrumbs-example/ruby.mdx similarity index 100% rename from src/includes/breadcrumbs-example/ruby.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/ruby.mdx diff --git a/src/includes/breadcrumbs-example/rust.mdx b/src/includes/breadcrumbs/breadcrumbs-example/rust.mdx similarity index 100% rename from src/includes/breadcrumbs-example/rust.mdx rename to src/includes/breadcrumbs/breadcrumbs-example/rust.mdx diff --git a/src/includes/getting-started-primer/flutter.mdx b/src/includes/getting-started-primer/flutter.mdx index cb04cb6868098..c1ba1f8693e63 100644 --- a/src/includes/getting-started-primer/flutter.mdx +++ b/src/includes/getting-started-primer/flutter.mdx @@ -1,6 +1,6 @@ -_Sentry's Flutter SDK enables automatic reporting of errors, messages, and exceptions. The Sentry Dart/Flutter SDK is available on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/)._ +_Sentry's Flutter SDK enables automatic reporting of errors, messages, and exceptions. The SDK is available on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/)._ @@ -11,5 +11,8 @@ Features: - ObjC, Swift, and C for iOS - Offline storage of events - Events [enriched](/platforms/flutter/enriching-events/context/) with device data +- Breadcrumbs automatically captured via the Native SDKs. + - [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) + - [Automatic Breadcrumbs for iOS](/platforms/apple/usage/#sentryautobreadcrumbtrackingintegration) - [Release Health](/product/releases/health/) tracks crash free users and sessions -- Under the hood the SDK relies on the [Dart SDK](/platforms/dart/) +- Under the hood the SDK relies on the [Dart SDK](/platforms/dart/); the minimum required version is `2.8.0` and Flutter SDK version is `1.17.0`. diff --git a/src/platforms/common/enriching-events/breadcrumbs.mdx b/src/platforms/common/enriching-events/breadcrumbs.mdx index 78449efe61db2..7caba33ea716c 100644 --- a/src/platforms/common/enriching-events/breadcrumbs.mdx +++ b/src/platforms/common/enriching-events/breadcrumbs.mdx @@ -24,7 +24,7 @@ Developers who want to modify the breadcrumbs interface can read about this in d You can manually add breadcrumbs whenever something interesting happens. For example, you might manually record a breadcrumb if the user authenticates or another state change happens. - + @@ -36,13 +36,13 @@ The available breadcrumb keys are `type`, `category`, `message`, `level`, `times ## Automatic Breadcrumbs -SDKs and their associated integrations will automatically record many types of breadcrumbs. For instance, the browser JavaScript SDK will automatically record all location changes. + ## Customize Breadcrumbs SDKs allow you to customize breadcrumbs through the `before_breadcrumb` hook. This hook is passed an already assembled breadcrumb and, in some SDKs, an optional hint. The function can modify the breadcrumb or decide to discard it entirely by returning `null`: - + For information about what can be done with the hint, see Filtering Events. diff --git a/src/platforms/flutter/usage/advanced-usage.mdx b/src/platforms/flutter/usage/advanced-usage.mdx index 15b55463ccb1f..cb46164af4f91 100644 --- a/src/platforms/flutter/usage/advanced-usage.mdx +++ b/src/platforms/flutter/usage/advanced-usage.mdx @@ -3,32 +3,11 @@ title: Advanced Usage sidebar_order: 2 --- -## Requirements - -For the usage of the Flutter SDK, the minimal required Dart SDK version is `2.8.0` and Flutter SDK version is `1.17.0` +# ## Automatic Breadcrumbs -The Flutter SDK already captures breadcrumbs automatically via the Native SDKs. - -- [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) -- [Automatic Breadcrumbs for iOS](/platforms/apple/usage/#sentryautobreadcrumbtrackingintegration) - -If you wish to add additional Navigation breadcrumbs for Flutter Apps, Add the `SentryNavigatorObserver` to your `MaterialApp`, `WidgetsApp` or `CupertinoApp` - -```dart -import 'package:flutter/material.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; - -MaterialApp( - navigatorObservers: [ - SentryNavigatorObserver(), - ], - // other parameters -) -``` -To track automatic Breadcrumbs for `HTTP` requests, Check out the [SentryHttpClient](/platforms/dart/usage/advanced-usage/#automatic-breadcrumbs) Wrapper for the [http](https://pub.dev/packages/http) library. ## Uploading Debug Symbols (Android and iOS) @@ -42,7 +21,7 @@ To track automatic Breadcrumbs for `HTTP` requests, Check out the [SentryHttpCli - Flutter `split-debug-info` and `obfuscate` flags aren't yet supported on iOS; they are supported only on Android. If this feature is enabled, Dart stack traces are not human readable, this is a tooling limitation, See: [43612](https://github.com/dart-lang/sdk/issues/43612) and [43274](https://github.com/dart-lang/sdk/issues/43274). - If you enable the `split-debug-info` feature, you must upload the Debug Symbols manually. - Also, Issue's titles might be obfuscated as we rely on the `runtimeType`, but they may not be human-readable, See: [Obfuscate Caveat](https://flutter.dev/docs/deployment/obfuscate#caveat) -- Layout related errors are only caught by [FlutterError.onError](https://api.flutter.dev/flutter/foundation/FlutterError/onError.html) in debug mode. In release mode, they are removed by the Flutter framework. See [Flutter build modes](https://flutter.dev/docs/testing/build-modes). +- Layout related errors are only caught by [FlutterError.onError](https://api.flutter.dev/flutter/foundation/FlutterError/onError.html) in debug mode. In release mode, they are removed by the Flutter framework. See [Flutter build modes](https://flutter.dev/docs/testing/build-modes). ## Tips for Catching Errors From 315548f25336052c36019c2fbbc5582ff6dfd8c3 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Wed, 3 Mar 2021 16:21:01 -0800 Subject: [PATCH 5/9] move content out of advanced usage to correct pages --- src/includes/capture-error/flutter.mdx | 23 ++++++++++++ .../getting-started-config/flutter.mdx | 8 +++++ .../flutter/usage/advanced-usage.mdx | 36 ++++--------------- 3 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 src/includes/capture-error/flutter.mdx diff --git a/src/includes/capture-error/flutter.mdx b/src/includes/capture-error/flutter.mdx new file mode 100644 index 0000000000000..4659640c61655 --- /dev/null +++ b/src/includes/capture-error/flutter.mdx @@ -0,0 +1,23 @@ +You can capture any exception object that you caught: + +```dart +import 'package:sentry/sentry.dart'; + +try { + aMethodThatMightFail(); +} catch (exception, stackTrace) { + await Sentry.captureException( + exception, + stackTrace: stackTrace, + ); +} +``` + +## Tips for Catching Errors + +- Use a `try/catch` block +- Use a `catchError` block for `Futures` +- The SDK already runs your init `callback` on an error handler, such as using `runZonedGuarded`, are captured automatically +- Flutter-specific errors, such as using `FlutterError.onError`, are captured automatically +- `Isolate` errors on the `current` Isolate which is the equivalent of a main/UI thread, such as using `Isolate.current.addErrorListener`, are captured automatically (only for non-Web Apps). +- For your own `Isolates`, add an `ErrorListener` and call `Sentry.captureException` diff --git a/src/includes/getting-started-config/flutter.mdx b/src/includes/getting-started-config/flutter.mdx index eb0bea3fa4511..e2cb7b18a9a2c 100644 --- a/src/includes/getting-started-config/flutter.mdx +++ b/src/includes/getting-started-config/flutter.mdx @@ -11,3 +11,11 @@ Future main() async { // or define SENTRY_DSN via Dart environment variable (--dart-define) } ``` + + + +Use the `SentryFlutter.init(...)` instead of `Sentry.init(...)` as it adds the Flutter integrations on top of the Dart SDK. + + + +You can configure the `SENTRY_DSN`, `SENTRY_RELEASE`, `SENTRY_DIST` and `SENTRY_ENVIRONMENT` via the Dart environment variables passing the `--dart-define` flag to the compiler as noted in the code sample. diff --git a/src/platforms/flutter/usage/advanced-usage.mdx b/src/platforms/flutter/usage/advanced-usage.mdx index cb46164af4f91..372854d45cf21 100644 --- a/src/platforms/flutter/usage/advanced-usage.mdx +++ b/src/platforms/flutter/usage/advanced-usage.mdx @@ -1,18 +1,16 @@ --- title: Advanced Usage sidebar_order: 2 +description: "Learn about advanced uses of the Flutter SDK, including uploading debug symbols, known limitations, and bundling." --- -# - -## Automatic Breadcrumbs - - ## Uploading Debug Symbols (Android and iOS) +Debug symbols provide information that Sentry displays on the Issue Details page to help you triage an issue. + - [iOS dSYM files](/platforms/apple/dsym/) -- [Android NDK](/product/cli/dif/#uploading-files), You've to do it manually, Do not use the `uploadNativeSymbols` flag from the [Sentry Gradle Plugin](/platforms/android/proguard/), it's not supported yet. +- [Android NDK](/product/cli/dif/#uploading-files) need to be done manually. Do not use the `uploadNativeSymbols` flag from the [Sentry Gradle Plugin](/platforms/android/proguard/) as it is not yet supported. - [Android Proguard/R8 mapping file](/platforms/android/proguard/) - [Source maps for Flutter Web](/product/cli/releases/#managing-release-artifacts) @@ -23,33 +21,11 @@ sidebar_order: 2 - Also, Issue's titles might be obfuscated as we rely on the `runtimeType`, but they may not be human-readable, See: [Obfuscate Caveat](https://flutter.dev/docs/deployment/obfuscate#caveat) - Layout related errors are only caught by [FlutterError.onError](https://api.flutter.dev/flutter/foundation/FlutterError/onError.html) in debug mode. In release mode, they are removed by the Flutter framework. See [Flutter build modes](https://flutter.dev/docs/testing/build-modes). -## Tips for Catching Errors - -- Use a `try/catch` block -- Use a `catchError` block for `Futures` -- The SDK already runs your init `callback` on an error handler, e.g. using `runZonedGuarded`, are captured automatically -- Flutter-specific errors, e.g. using `FlutterError.onError`, are captured automatically -- `Isolate` errors on the `current` Isolate which is the equivalent of a main/UI thread, e.g. using `Isolate.current.addErrorListener`, are captured automatically (Only for non-Web Apps). -- For your own `Isolates`, add an `ErrorListener` and call `Sentry.captureException` - -## Caveat - -Always prefer the `SentryFlutter.init(...)` instead of `Sentry.init(...)` as it adds the Flutter integrations on top of the Dart SDK. - -## Advanced Usage (Android and iOS) - -- [iOS Advanced Usage](/platforms/apple/usage/) -- [Android Advanced Usage](/platforms/android/usage/advanced-usage/) - -## Dart environment variables - -- You can configure the `SENTRY_DSN`, `SENTRY_RELEASE`, `SENTRY_DIST` and `SENTRY_ENVIRONMENT` via the Dart environment variables passing the `--dart-define` flag to the compiler. - -## Building specific ABI on Android +## Building Specific ABI on Android The Sentry Flutter SDK includes the Sentry Android SDK, which bundles multiple native libraries for multiple ABIs. Building a Flutter app for a specific ABI using the `--target-platform` argument, for example an ARM 32bit apk, looks like this, which should also include the `--split-per-abi` flag: -```sh +```bash flutter build apk --target-platform=android-arm --split-per-abi ``` From 7577c939491db4a43304c163dbfd0a3b34a87ed0 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Thu, 4 Mar 2021 14:48:53 -0800 Subject: [PATCH 6/9] respond to feedback --- src/includes/capture-error/flutter.mdx | 15 +-------------- .../configuration/decluttering/android.mdx | 2 -- src/includes/configuration/decluttering/java.mdx | 2 -- .../configuration/decluttering/javascript.mdx | 2 -- .../configuration/decluttering/python.mdx | 2 -- src/includes/getting-started-config/flutter.mdx | 6 ------ src/includes/getting-started-install/flutter.mdx | 2 -- src/includes/getting-started-primer/flutter.mdx | 8 +++++--- src/platforms/common/configuration/filtering.mdx | 7 +++++++ src/platforms/common/configuration/options.mdx | 8 ++++---- src/platforms/common/enriching-events/scopes.mdx | 1 + 11 files changed, 18 insertions(+), 37 deletions(-) diff --git a/src/includes/capture-error/flutter.mdx b/src/includes/capture-error/flutter.mdx index 4659640c61655..6c26a9b2ce927 100644 --- a/src/includes/capture-error/flutter.mdx +++ b/src/includes/capture-error/flutter.mdx @@ -1,17 +1,4 @@ -You can capture any exception object that you caught: - -```dart -import 'package:sentry/sentry.dart'; - -try { - aMethodThatMightFail(); -} catch (exception, stackTrace) { - await Sentry.captureException( - exception, - stackTrace: stackTrace, - ); -} -``` + ## Tips for Catching Errors diff --git a/src/includes/configuration/decluttering/android.mdx b/src/includes/configuration/decluttering/android.mdx index 2e118541f5266..80be08dbb0c9f 100644 --- a/src/includes/configuration/decluttering/android.mdx +++ b/src/includes/configuration/decluttering/android.mdx @@ -1,3 +1 @@ -### Decluttering Sentry - When used together with one of the logging framework integrations, the Android SDK captures all error logs as events. If you see a particular kind of error very often that has a `logger` tag, you can ignore that particular logger entirely. For more information see our Timber integration. diff --git a/src/includes/configuration/decluttering/java.mdx b/src/includes/configuration/decluttering/java.mdx index 2ddd4be51949e..c0a5c2859af15 100644 --- a/src/includes/configuration/decluttering/java.mdx +++ b/src/includes/configuration/decluttering/java.mdx @@ -1,3 +1 @@ -### Decluttering Sentry - When used together with one of the logging framework integrations, the Java SDK captures all error logs as events. If you see a particular kind of error very often that has a `logger` tag, you can ignore that particular logger entirely. For more information see our Logback or Log4j 2.x integration. diff --git a/src/includes/configuration/decluttering/javascript.mdx b/src/includes/configuration/decluttering/javascript.mdx index 2f33cfe58df67..b03ff1755e0f4 100644 --- a/src/includes/configuration/decluttering/javascript.mdx +++ b/src/includes/configuration/decluttering/javascript.mdx @@ -1,5 +1,3 @@ -### Decluttering Sentry - You can construct an allowed list of domains which might raise acceptable exceptions. For example, if your scripts are loaded from `cdn.example.com` and your site is `example.com`, you can set `allowUrls` to: ```javascript diff --git a/src/includes/configuration/decluttering/python.mdx b/src/includes/configuration/decluttering/python.mdx index fd7c8e1b2f633..f00718c4d65d4 100644 --- a/src/includes/configuration/decluttering/python.mdx +++ b/src/includes/configuration/decluttering/python.mdx @@ -1,3 +1 @@ -### Decluttering Sentry - By default the Python SDK captures all error logs as events. If you see a particular kind of error very often that has a `logger` tag, you can ignore that particular logger entirely. For more information see our logging integration. diff --git a/src/includes/getting-started-config/flutter.mdx b/src/includes/getting-started-config/flutter.mdx index e2cb7b18a9a2c..d7f4c450ff6f7 100644 --- a/src/includes/getting-started-config/flutter.mdx +++ b/src/includes/getting-started-config/flutter.mdx @@ -12,10 +12,4 @@ Future main() async { } ``` - - -Use the `SentryFlutter.init(...)` instead of `Sentry.init(...)` as it adds the Flutter integrations on top of the Dart SDK. - - - You can configure the `SENTRY_DSN`, `SENTRY_RELEASE`, `SENTRY_DIST` and `SENTRY_ENVIRONMENT` via the Dart environment variables passing the `--dart-define` flag to the compiler as noted in the code sample. diff --git a/src/includes/getting-started-install/flutter.mdx b/src/includes/getting-started-install/flutter.mdx index 98da6b18121b6..d8632253c5ee6 100644 --- a/src/includes/getting-started-install/flutter.mdx +++ b/src/includes/getting-started-install/flutter.mdx @@ -1,5 +1,3 @@ -Get the SDK from [pub.dev](https://pub.dev/packages/sentry_flutter) by adding the following to your `pubspec.yaml`: - ```yml {filename:pubspec.yaml} dependencies: sentry_flutter: ^4.0.4 diff --git a/src/includes/getting-started-primer/flutter.mdx b/src/includes/getting-started-primer/flutter.mdx index c1ba1f8693e63..798012d7ad377 100644 --- a/src/includes/getting-started-primer/flutter.mdx +++ b/src/includes/getting-started-primer/flutter.mdx @@ -11,8 +11,10 @@ Features: - ObjC, Swift, and C for iOS - Offline storage of events - Events [enriched](/platforms/flutter/enriching-events/context/) with device data -- Breadcrumbs automatically captured via the Native SDKs. - - [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) - - [Automatic Breadcrumbs for iOS](/platforms/apple/usage/#sentryautobreadcrumbtrackingintegration) +- Breadcrumbs automatically captured: + - by the [Flutter SDK](/platforms/flutter/enriching-events/breadcrumbs/#automatic-breadcrumbs) + - via the Native SDKs [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) and [Automatic Breadcrumbs for iOS](/platforms/apple/usage/#sentryautobreadcrumbtrackingintegration) + - as well as `http` with the [Dart SDK](/platforms/dart/) - [Release Health](/product/releases/health/) tracks crash free users and sessions +- Limited support for Flutter Web - Under the hood the SDK relies on the [Dart SDK](/platforms/dart/); the minimum required version is `2.8.0` and Flutter SDK version is `1.17.0`. diff --git a/src/platforms/common/configuration/filtering.mdx b/src/platforms/common/configuration/filtering.mdx index 83b2ed9f9797c..9d9121cc11bcc 100644 --- a/src/platforms/common/configuration/filtering.mdx +++ b/src/platforms/common/configuration/filtering.mdx @@ -86,10 +86,17 @@ In this example, the fingerprint is forced to a common value if an exception of : For breadcrumbs created from HTTP requests done via the legacy `XMLHttpRequest` API. This holds the original xhr object. + + + + +### Decluttering Sentry + + ## Using Sampling to Filter Transaction Events diff --git a/src/platforms/common/configuration/options.mdx b/src/platforms/common/configuration/options.mdx index 3f0f853120358..f03832569e153 100644 --- a/src/platforms/common/configuration/options.mdx +++ b/src/platforms/common/configuration/options.mdx @@ -143,7 +143,7 @@ will be sent. This is a "contains" match to the entire file URL. As a result, if - + When set to `true`, the SDK will send session events to Sentry. This is supported in all browser SDKs, emitting one session per pageload and page navigation to Sentry. @@ -203,7 +203,7 @@ Sentry SDKs normalize any contextual data to a given depth. Any keys containing - + ## Integration Configuration @@ -236,13 +236,13 @@ The callback typically gets a second argument (called a "hint") which contains t - + ## Transport Options Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments. - + Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. diff --git a/src/platforms/common/enriching-events/scopes.mdx b/src/platforms/common/enriching-events/scopes.mdx index 723213ba62406..ca9d8f1cb8275 100644 --- a/src/platforms/common/enriching-events/scopes.mdx +++ b/src/platforms/common/enriching-events/scopes.mdx @@ -13,6 +13,7 @@ notSupported: - php - php.laravel - php.symfony + - flutter --- When an event is captured and sent to Sentry, SDKs will merge that event data with extra From fbf1e0e65162d183c80abef14332fa0d3f267374 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Thu, 4 Mar 2021 15:22:48 -0800 Subject: [PATCH 7/9] update wizard --- src/wizard/flutter/index.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wizard/flutter/index.md b/src/wizard/flutter/index.md index bf5ce46402d04..87ebefe7e6678 100644 --- a/src/wizard/flutter/index.md +++ b/src/wizard/flutter/index.md @@ -5,7 +5,7 @@ support_level: production type: framework --- -Get the SDK from [pub.dev](https://pub.dev/packages/sentry_flutter) by adding the following to your `pubspec.yaml`: +Sentry captures data by using an SDK within your application’s runtime. Add the following to your `pubspec.yaml`: ```yml {filename:pubspec.yaml} dependencies: @@ -25,10 +25,12 @@ Future main() async { }, appRunner: () => runApp(MyApp()), ); -} + + // or define SENTRY_DSN via Dart environment variable (--dart-define) +} ``` -Capture a test exception: +Then create an intentional error, so you can test that everything is working: ```dart import 'package:sentry/sentry.dart'; @@ -42,3 +44,7 @@ try { ); } ``` + +If you're new to Sentry, use the email alert to access your account and complete a product tour. + +If you're an existing user and have disabled alerts, you won't receive this email. From 88291b9fa169674f6f3bde35e400318c92ea745f Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Thu, 4 Mar 2021 15:32:09 -0800 Subject: [PATCH 8/9] fix broken link --- src/platforms/common/enriching-events/tags.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/common/enriching-events/tags.mdx b/src/platforms/common/enriching-events/tags.mdx index 6bb8dcd870c33..2ca720d10c7b8 100644 --- a/src/platforms/common/enriching-events/tags.mdx +++ b/src/platforms/common/enriching-events/tags.mdx @@ -12,7 +12,7 @@ description: "Tags power UI features such as filters and tag-distribution maps. We’ll automatically index all tags for an event, as well as the frequency and the last time that Sentry has seen a tag. We also keep track of the number of distinct tags and can assist you in determining hotspots for various issues. - + Defining tags is easy, and will bind them to the [current scope](../scopes/) ensuring all future events within scope contain the same tags: From 590856f4a2b36b1d39473f6f5120663be03b3374 Mon Sep 17 00:00:00 2001 From: Fiona Artiaga Date: Thu, 4 Mar 2021 16:57:04 -0800 Subject: [PATCH 9/9] add Flutter to homepage --- src/pages/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index bb70ba9bf2930..72493a7934403 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -32,6 +32,7 @@ const HIGHLIGHTED_PLATFORMS = [ "apple", "java.spring-boot", "ruby.rails", + "flutter", ]; const IndexPage = () => {