From f1bad628be57acdea2d102168dd6379c5df109e9 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Mon, 7 Feb 2022 11:28:42 -0500 Subject: [PATCH 1/8] updated dart getting started primer --- src/includes/getting-started-primer/dart.mdx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/includes/getting-started-primer/dart.mdx b/src/includes/getting-started-primer/dart.mdx index 51812d3884b5e7..6577acdb7076a3 100644 --- a/src/includes/getting-started-primer/dart.mdx +++ b/src/includes/getting-started-primer/dart.mdx @@ -1,5 +1,18 @@ -Pure Dart SDK used by any Dart application like AngularDart, CLI and Server, it enables reporting messages and errors. +Sentry's Dart SDK enables automatic reporting of errors, messages, and exceptions. The SDK is available on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/). For Flutter apps, refer to [our Flutter documentation](/platforms/flutter) instead. + +Features: + +- Automatic native crash error tracking (using both [Android](/platforms/android/) and [iOS/macOS](/platforms/apple/)), including + - Java, Kotlin, C, and C++ code for Android + - ObjC, Swift, and C for iOS and macOS +- Offline storage of events +- Events [enriched](/platforms/dart/enriching-events/context/) with device data +- Breadcrumbs automatically captured: + - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) + - with the Native SDKs [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) and [Automatic Breadcrumbs for iOS](/platforms/apple/configuration/integrations/default/#sentryautobreadcrumbtrackingintegration) + - as well as `http` with the [Dart SDK](/platforms/dart/) +- [Release Health](/product/releases/health/) tracks crash free users and sessions From a5d43d0db5a7bdeef02885e11ff24c2bc095f571 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Mon, 7 Feb 2022 12:33:58 -0500 Subject: [PATCH 2/8] moved content from advanced usage, deleted dart index page, updated wizard --- src/includes/capture-error/dart.mdx | 7 +++ src/includes/capture-error/flutter.mdx | 8 +-- .../automatic-breadcrumbs/dart.mdx | 42 +++++++++++++++ src/platforms/dart/index.mdx | 29 ----------- src/platforms/dart/usage/advanced-usage.mdx | 52 ------------------- src/wizard/dart/index.md | 4 +- 6 files changed, 52 insertions(+), 90 deletions(-) create mode 100644 src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/dart.mdx delete mode 100644 src/platforms/dart/index.mdx diff --git a/src/includes/capture-error/dart.mdx b/src/includes/capture-error/dart.mdx index 5c6c58f4c48278..150d5519b4908a 100644 --- a/src/includes/capture-error/dart.mdx +++ b/src/includes/capture-error/dart.mdx @@ -12,3 +12,10 @@ try { ); } ``` + +## Tips for Catching Errors + +- Use a `try/catch` block +- Use a `catchError` block for `Futures` +- `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` diff --git a/src/includes/capture-error/flutter.mdx b/src/includes/capture-error/flutter.mdx index 6c26a9b2ce9273..6013128669beff 100644 --- a/src/includes/capture-error/flutter.mdx +++ b/src/includes/capture-error/flutter.mdx @@ -1,10 +1,4 @@ -## 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` +- The SDK already runs your init `callback` on an error handler, such as using `runZonedGuarded`, are captured automatically diff --git a/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/dart.mdx b/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/dart.mdx new file mode 100644 index 00000000000000..ac3b4dd39cf50c --- /dev/null +++ b/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/dart.mdx @@ -0,0 +1,42 @@ +To track automatic [Breadcrumbs for HTTP requests](https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types), you can add a Sentry wrapper that does it automatically for you. + +This is only possible if you are using the [http.Client](https://pub.dev/documentation/http/latest/http/Client-class.html) class from the [http](https://pub.dev/packages/http) library. + +The `SentryHttpClient` can be used as a standalone client like this: + +```dart +import 'package:http/http.dart' as http; +import 'package:sentry/sentry.dart'; + +final client = SentryHttpClient(); +try { + final url = 'https://example.com/whatsit/create'; + final response = await client.post(url, body: { + 'name': 'doodle', + 'color': 'blue', + }); + print('Response body: ${response.body}'); +} finally { + client.close(); +} +``` + +The `SentryHttpClient` can also be used as a wrapper for your own `HTTP Client`: + +```dart +import 'package:http/http.dart' as http; +import 'package:sentry/sentry.dart'; + +final myClient = http.Client(); +final client = SentryHttpClient(client: myClient); +try { + final url = 'https://example.com/whatsit/create'; + final response = await client.post(url, body: { + 'name': 'doodle', + 'color': 'blue', + }); + print('Response body: ${response.body}'); +} finally { + client.close(); +} +``` diff --git a/src/platforms/dart/index.mdx b/src/platforms/dart/index.mdx deleted file mode 100644 index 227a2873b42b98..00000000000000 --- a/src/platforms/dart/index.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Dart ---- - - - - - -For Flutter apps, please refer to the [Flutter integration](/platforms/flutter) instead. - - - -Get the SDK from [pub.dev](https://pub.dev/packages/sentry) 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/). - - diff --git a/src/platforms/dart/usage/advanced-usage.mdx b/src/platforms/dart/usage/advanced-usage.mdx index 7785457647cd07..e9491fda6d5f4c 100644 --- a/src/platforms/dart/usage/advanced-usage.mdx +++ b/src/platforms/dart/usage/advanced-usage.mdx @@ -7,51 +7,6 @@ sidebar_order: 2 - For the usage of the Dart SDK, the minimal required Dart SDK version is `2.12.0`. -## Automatic Breadcrumbs - -To track automatic [Breadcrumbs for HTTP requests](https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types), you can add a Sentry wrapper that does it automatically for you. - -This is only possible if you are using the [http.Client](https://pub.dev/documentation/http/latest/http/Client-class.html) class from the [http](https://pub.dev/packages/http) library. - -The `SentryHttpClient` can be used as a standalone client like this: - -```dart -import 'package:http/http.dart' as http; -import 'package:sentry/sentry.dart'; - -final client = SentryHttpClient(); -try { - final url = 'https://example.com/whatsit/create'; - final response = await client.post(url, body: { - 'name': 'doodle', - 'color': 'blue', - }); - print('Response body: ${response.body}'); -} finally { - client.close(); -} -``` - -The `SentryHttpClient` can also be used as a wrapper for your own `HTTP Client`: - -```dart -import 'package:http/http.dart' as http; -import 'package:sentry/sentry.dart'; - -final myClient = http.Client(); -final client = SentryHttpClient(client: myClient); -try { - final url = 'https://example.com/whatsit/create'; - final response = await client.post(url, body: { - 'name': 'doodle', - 'color': 'blue', - }); - print('Response body: ${response.body}'); -} finally { - client.close(); -} -``` - ## Reporting Bad HTTP Requests as Errors The `SentryHttpClient` can also catch exceptions that may occur during requests — for example [`SocketException`](https://api.dart.dev/stable/2.13.4/dart-io/SocketException-class.html). @@ -118,10 +73,3 @@ var uriResponse = await client.post('https://example.com/whatsit/create', await transaction.finish(status: SpanStatus.ok()); ``` - -## Tips for Catching Errors - -- Use a `try/catch` block -- Use a `catchError` block for `Futures` -- `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` diff --git a/src/wizard/dart/index.md b/src/wizard/dart/index.md index 938b8b16e6fbde..6fc81a593c097b 100644 --- a/src/wizard/dart/index.md +++ b/src/wizard/dart/index.md @@ -5,7 +5,7 @@ support_level: production type: framework --- -Get the SDK from [pub.dev](https://pub.dev/packages/sentry) 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: @@ -27,7 +27,7 @@ Future main() async { } ``` -Capture a test exception: +Then create an intentional error, so you can test that everything is working: ```dart import 'package:sentry/sentry.dart'; From 85bb9fe17ad11fd231c3787ba269be6e852aec5e Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Mon, 7 Feb 2022 12:45:46 -0500 Subject: [PATCH 3/8] fixed broken link --- .../breadcrumbs/automatic-breadcrumbs/flutter.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/flutter.mdx b/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/flutter.mdx index 9a391228f2306b..7dea4edab934b2 100644 --- a/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/flutter.mdx +++ b/src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/flutter.mdx @@ -19,4 +19,4 @@ MaterialApp( ) ``` -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. +To track automatic Breadcrumbs for `HTTP` requests, check out the [SentryHttpClient](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) Wrapper for the [http](https://pub.dev/packages/http) library. From b42373084602ac7afda9e7782874d89fc90742f7 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Wed, 23 Feb 2022 10:17:20 -0500 Subject: [PATCH 4/8] added integrations page, updated getting started primer and basic options --- src/includes/getting-started-primer/dart.mdx | 11 ++--------- src/platforms/common/enriching-events/tags.mdx | 2 +- .../instrumentation/automatic-instrumentation.mdx | 2 +- .../integrations/http.mdx} | 10 +++++++--- .../instrumentation/automatic-instrumentation.mdx | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) rename src/platforms/dart/{usage/advanced-usage.mdx => configuration/integrations/http.mdx} (93%) diff --git a/src/includes/getting-started-primer/dart.mdx b/src/includes/getting-started-primer/dart.mdx index 6577acdb7076a3..5aedeaad2c93bb 100644 --- a/src/includes/getting-started-primer/dart.mdx +++ b/src/includes/getting-started-primer/dart.mdx @@ -6,13 +6,6 @@ Sentry's Dart SDK enables automatic reporting of errors, messages, and exception Features: -- Automatic native crash error tracking (using both [Android](/platforms/android/) and [iOS/macOS](/platforms/apple/)), including - - Java, Kotlin, C, and C++ code for Android - - ObjC, Swift, and C for iOS and macOS -- Offline storage of events -- Events [enriched](/platforms/dart/enriching-events/context/) with device data - Breadcrumbs automatically captured: - - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) - - with the Native SDKs [Automatic Breadcrumbs for Android](/platforms/android/enriching-events/breadcrumbs/#automatic-breadcrumbs) and [Automatic Breadcrumbs for iOS](/platforms/apple/configuration/integrations/default/#sentryautobreadcrumbtrackingintegration) - - as well as `http` with the [Dart SDK](/platforms/dart/) -- [Release Health](/product/releases/health/) tracks crash free users and sessions + - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) + - as well as `http` with the [Dart SDK](/platforms/dart/) diff --git a/src/platforms/common/enriching-events/tags.mdx b/src/platforms/common/enriching-events/tags.mdx index 715497af20392d..fc281542de426a 100644 --- a/src/platforms/common/enriching-events/tags.mdx +++ b/src/platforms/common/enriching-events/tags.mdx @@ -13,7 +13,7 @@ We’ll automatically index all tags for an event, as well as the frequency and _Tag keys_ have a maximum length of 32 characters, while _tag values_ have a maximum length of 200 characters. - + Defining tags is easy, and will bind them to the [current scope](../scopes/) ensuring all future events within scope contain the same tags. diff --git a/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx b/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx index fb2bfe7f15ccf2..04cacbfa6b818e 100644 --- a/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx +++ b/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx @@ -22,4 +22,4 @@ The span finishes once the request has been executed. The span `status` depends When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and SentryEvent will be linked when viewing it on the **Issue Details** page in sentry.io. -For more information see our [SentryHttpClient integration](/platforms/dart/usage/advanced-usage/#performance-monitoring-for-http-requests). +For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http/#performance-monitoring-for-http-requests). diff --git a/src/platforms/dart/usage/advanced-usage.mdx b/src/platforms/dart/configuration/integrations/http.mdx similarity index 93% rename from src/platforms/dart/usage/advanced-usage.mdx rename to src/platforms/dart/configuration/integrations/http.mdx index e9491fda6d5f4c..5406a4758e511f 100644 --- a/src/platforms/dart/usage/advanced-usage.mdx +++ b/src/platforms/dart/configuration/integrations/http.mdx @@ -1,11 +1,15 @@ --- -title: Advanced Usage +title: HTTP Integration sidebar_order: 2 +redirect_from: + - /platforms/dart/usage/advanced-usage/ --- -## Requirements + -- For the usage of the Dart SDK, the minimal required Dart SDK version is `2.12.0`. +The minimum required Dart SDK version is `2.12.0`. + + ## Reporting Bad HTTP Requests as Errors diff --git a/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx b/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx index 8a4d4102d9cfdb..f8f8a53a99c2ce 100644 --- a/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx +++ b/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx @@ -22,7 +22,7 @@ The span finishes once the request has been executed. The span `status` depends When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and SentryEvent will be linked when viewing it on the **Issue Details** page in sentry.io. -For more information see our [SentryHttpClient integration](/platforms/dart/usage/advanced-usage/#performance-monitoring-for-http-requests). +For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http/#performance-monitoring-for-http-requests). ### Routing Instumentation From b9467c421a887b28e0c9717c68122daef65ff5e0 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Wed, 23 Feb 2022 11:02:57 -0500 Subject: [PATCH 5/8] changed file name to try to fix broken structure --- .../performance/instrumentation/automatic-instrumentation.mdx | 2 +- .../integrations/{http.mdx => http-integration.mdx} | 0 .../performance/instrumentation/automatic-instrumentation.mdx | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/platforms/dart/configuration/integrations/{http.mdx => http-integration.mdx} (100%) diff --git a/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx b/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx index 04cacbfa6b818e..b74ec66c08943e 100644 --- a/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx +++ b/src/platforms/dart/common/performance/instrumentation/automatic-instrumentation.mdx @@ -22,4 +22,4 @@ The span finishes once the request has been executed. The span `status` depends When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and SentryEvent will be linked when viewing it on the **Issue Details** page in sentry.io. -For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http/#performance-monitoring-for-http-requests). +For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests). diff --git a/src/platforms/dart/configuration/integrations/http.mdx b/src/platforms/dart/configuration/integrations/http-integration.mdx similarity index 100% rename from src/platforms/dart/configuration/integrations/http.mdx rename to src/platforms/dart/configuration/integrations/http-integration.mdx diff --git a/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx b/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx index f8f8a53a99c2ce..6cbdb720493587 100644 --- a/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx +++ b/src/platforms/flutter/common/performance/instrumentation/automatic-instrumentation.mdx @@ -22,7 +22,7 @@ The span finishes once the request has been executed. The span `status` depends When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and SentryEvent will be linked when viewing it on the **Issue Details** page in sentry.io. -For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http/#performance-monitoring-for-http-requests). +For more information see our [SentryHttpClient integration](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests). ### Routing Instumentation From 6cbb6ef544ab8265f1bee53a315e15563d14925a Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Thu, 24 Feb 2022 18:20:36 -0500 Subject: [PATCH 6/8] fixed folder structure and added page description for http integration page --- .../dart/configuration/integrations/http-integration.mdx | 1 + src/platforms/dart/configuration/integrations/index.mdx | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/platforms/dart/configuration/integrations/index.mdx diff --git a/src/platforms/dart/configuration/integrations/http-integration.mdx b/src/platforms/dart/configuration/integrations/http-integration.mdx index 5406a4758e511f..d0493817746ef5 100644 --- a/src/platforms/dart/configuration/integrations/http-integration.mdx +++ b/src/platforms/dart/configuration/integrations/http-integration.mdx @@ -3,6 +3,7 @@ title: HTTP Integration sidebar_order: 2 redirect_from: - /platforms/dart/usage/advanced-usage/ +description: "Learn more about the Sentry HTTP integration for the Dart SDK." --- diff --git a/src/platforms/dart/configuration/integrations/index.mdx b/src/platforms/dart/configuration/integrations/index.mdx new file mode 100644 index 00000000000000..327fd7a285fc67 --- /dev/null +++ b/src/platforms/dart/configuration/integrations/index.mdx @@ -0,0 +1,9 @@ +--- +title: Integrations +sidebar_order: 30 +description: "Learn more about how integrations extend the functionality of our SDK to cover common libraries and environments automatically." +--- + +[HTTP Integration]() + + Learn more about the Sentry HTTP integration for the Dart SDK. From af93f546d235f69ddaa657ca0368fc5c7e8482b4 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana Date: Fri, 25 Feb 2022 11:02:00 -0500 Subject: [PATCH 7/8] updated features list, fixed integration index page, added missing description for migration guide --- src/includes/getting-started-primer/dart.mdx | 7 ++- .../dart/configuration/integrations/index.mdx | 6 +-- src/platforms/dart/migration.mdx | 47 ++++++++++--------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/includes/getting-started-primer/dart.mdx b/src/includes/getting-started-primer/dart.mdx index 5aedeaad2c93bb..fe59d171b2e246 100644 --- a/src/includes/getting-started-primer/dart.mdx +++ b/src/includes/getting-started-primer/dart.mdx @@ -4,8 +4,13 @@ Sentry's Dart SDK enables automatic reporting of errors, messages, and exception -Features: +**Features:** +- Events [enriched](/platforms/dart/enriching-events/context/) with device data - Breadcrumbs automatically captured: - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) - as well as `http` with the [Dart SDK](/platforms/dart/) +- [Release Health](/product/releases/health/) tracks crash free users and sessions +- [Attachments](/platforms/dart/enriching-events/attachments/) enrich your event by storing additional files, such as config or log files. +- [User Feedback](/platforms/dart/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs. +- [Performance Monitoring](/product/performance/) for [HTTP requests](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests) diff --git a/src/platforms/dart/configuration/integrations/index.mdx b/src/platforms/dart/configuration/integrations/index.mdx index 327fd7a285fc67..6519f440ad6aaf 100644 --- a/src/platforms/dart/configuration/integrations/index.mdx +++ b/src/platforms/dart/configuration/integrations/index.mdx @@ -1,9 +1,7 @@ --- title: Integrations -sidebar_order: 30 +sidebar_order: 10 description: "Learn more about how integrations extend the functionality of our SDK to cover common libraries and environments automatically." --- -[HTTP Integration]() - - Learn more about the Sentry HTTP integration for the Dart SDK. + diff --git a/src/platforms/dart/migration.mdx b/src/platforms/dart/migration.mdx index a4e35b949aed7c..c28cb446d0bb20 100644 --- a/src/platforms/dart/migration.mdx +++ b/src/platforms/dart/migration.mdx @@ -1,37 +1,38 @@ --- title: Migration Guide sidebar_order: 1000 +description: "Migrate between versions of Sentry's SDK for Dart." --- ## Migrating From `sentry` `5.1.x` to `sentry` `6.0.0` -* `Sentry.currentHub` was removed. Please use the static methods on `Sentry` -* `SentryOptions.cacheDirSize` was renamed to `SentryOptions.maxCacheItems` -* `EventProcessor` was changed from a callback to an interface -* The data type from the following options was changed from `int` to `Duration`. The old options are still present but deprecated and will be removed in a future version. - * `SentryOptions.autoSessionTrackingIntervalMillis` to `SentryOptions.autoSessionTrackingInterval` - * `SentryOptions.anrTimeoutIntervalMillis` to `SentryOptions.anrTimeoutInterval` -* The `beforeSend` callback now accepts async code. The method signature changed from `SentryEvent? Function(SentryEvent event, {dynamic hint});` to `FutureOr Function(SentryEvent event, {dynamic hint});`. While this is technically a breaking change, your code probably is still valid. -* Sentry accepts multiple exceptions and multiple threads. If you haven't set exceptions, there's no need to do anything. +- `Sentry.currentHub` was removed. Please use the static methods on `Sentry` +- `SentryOptions.cacheDirSize` was renamed to `SentryOptions.maxCacheItems` +- `EventProcessor` was changed from a callback to an interface +- The data type from the following options was changed from `int` to `Duration`. The old options are still present but deprecated and will be removed in a future version. + - `SentryOptions.autoSessionTrackingIntervalMillis` to `SentryOptions.autoSessionTrackingInterval` + - `SentryOptions.anrTimeoutIntervalMillis` to `SentryOptions.anrTimeoutInterval` +- The `beforeSend` callback now accepts async code. The method signature changed from `SentryEvent? Function(SentryEvent event, {dynamic hint});` to `FutureOr Function(SentryEvent event, {dynamic hint});`. While this is technically a breaking change, your code probably is still valid. +- Sentry accepts multiple exceptions and multiple threads. If you haven't set exceptions, there's no need to do anything. ### Sentry Self-hosted Compatibility -* Starting with version `6.0.0` of the `sentry`, [Sentry's version >= v20.6.0](https://github.com/getsentry/self-hosted/releases) is required. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed. +- Starting with version `6.0.0` of the `sentry`, [Sentry's version >= v20.6.0](https://github.com/getsentry/self-hosted/releases) is required. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed. ## Migrating From `sentry` `4.0.x` to `sentry` `5.0.0` -* Sentry's Dart SDK version 5.0.0 and above requires Dart 1.12.0 -* Fix: Prefix classes with Sentry - * A couple of classes were often conflicting with user's code. +- Sentry's Dart SDK version 5.0.0 and above requires Dart 1.12.0 +- Fix: Prefix classes with Sentry + - A couple of classes were often conflicting with user's code. As a result, this change renames the following classes: - * `App` -> `SentryApp` - * `Browser` -> `SentryBrowser` - * `Device` -> `SentryDevice` - * `Gpu` -> `SentryGpu` - * `Integration` -> `SentryIntegration` - * `Message` -> `SentryMessage` - * `OperatingSystem` -> `SentryOperatingSystem` - * `Orientation` -> `SentryOrientation` - * `Request` -> `SentryRequest` - * `User` -> `SentryUser` -* Return type of `Sentry.close()` changed from `void` to `Future` and `Integration.close()` changed from `void` to `FutureOr` + - `App` -> `SentryApp` + - `Browser` -> `SentryBrowser` + - `Device` -> `SentryDevice` + - `Gpu` -> `SentryGpu` + - `Integration` -> `SentryIntegration` + - `Message` -> `SentryMessage` + - `OperatingSystem` -> `SentryOperatingSystem` + - `Orientation` -> `SentryOrientation` + - `Request` -> `SentryRequest` + - `User` -> `SentryUser` +- Return type of `Sentry.close()` changed from `void` to `Future` and `Integration.close()` changed from `void` to `FutureOr` From aceafe77ea2b6202bb1a8a579a239a0fff82be27 Mon Sep 17 00:00:00 2001 From: Isabel <76437239+imatwawana@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:07:45 -0500 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- src/includes/getting-started-primer/dart.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/includes/getting-started-primer/dart.mdx b/src/includes/getting-started-primer/dart.mdx index fe59d171b2e246..504fc59d895995 100644 --- a/src/includes/getting-started-primer/dart.mdx +++ b/src/includes/getting-started-primer/dart.mdx @@ -6,11 +6,10 @@ Sentry's Dart SDK enables automatic reporting of errors, messages, and exception **Features:** -- Events [enriched](/platforms/dart/enriching-events/context/) with device data - Breadcrumbs automatically captured: - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) - as well as `http` with the [Dart SDK](/platforms/dart/) -- [Release Health](/product/releases/health/) tracks crash free users and sessions - [Attachments](/platforms/dart/enriching-events/attachments/) enrich your event by storing additional files, such as config or log files. - [User Feedback](/platforms/dart/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs. -- [Performance Monitoring](/product/performance/) for [HTTP requests](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests) +- [Performance Monitoring](/product/performance/) creates transactions for: + - [HTTP requests](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests)