diff --git a/content/en/logs/log_collection/unity.md b/content/en/logs/log_collection/unity.md index 7a229a4d38c..290352613ef 100644 --- a/content/en/logs/log_collection/unity.md +++ b/content/en/logs/log_collection/unity.md @@ -114,5 +114,4 @@ logger.RemoveAttribute("user-status") [2]: /real_user_monitoring/application_monitoring/unity/setup [3]: /getting_started/tagging/ [4]: https://www.newtonsoft.com/json/help/html/m_newtonsoft_json_jsonconvert_serializeobject.htm -[5]: https://api.flutter.dev/flutter/services/StandardMessageCodec-class.html [6]: https://pub.dev/packages/logger diff --git a/content/en/real_user_monitoring/application_monitoring/flutter/advanced_configuration.md b/content/en/real_user_monitoring/application_monitoring/flutter/advanced_configuration.md index 5199bc579f1..6d8f65ae849 100644 --- a/content/en/real_user_monitoring/application_monitoring/flutter/advanced_configuration.md +++ b/content/en/real_user_monitoring/application_monitoring/flutter/advanced_configuration.md @@ -180,6 +180,32 @@ A custom endpoint for sending RUM data. **Default**: `20.0` The sampling rate for telemetry data, such as errors and debug logs. +## Tracking from background isolates + +Starting with v3, Datadog Flutter SDK is capable of monitoring from multiple isolates, but monitoring must be initialized from the background isolate: + +When initializing your background isolate, call `DatadogSdk.instance.attachToBackgroundIsolate`. For example: + +```dart +Future _spawnIsolate() async { + final receivePort = ReceivePort(); + receivePort.listen((message) { + // + }); + await Isolate.spawn(_backgroundWork, receivePort.sendPort); + } + +void _backgroundWork(SendPort port) async { + await DatadogSdk.instance.attachToBackgroundIsolate(); + + // Your background work +} +``` + +`attachToBackgroundIsolate` must be called **after** Datadog is initialized in your main isolate, otherwise the call will silently fail and tracking will not be available. + +If you are using [Datadog Tracking HTTP Client][10] to automatically track resources, `attachToBackgroundIsolate` will automatically start tracking resources from the calling isolate. However, using `Client` from the `http` package or `Dio` will require you re-initialize HTTP tracking for those packages from the background isolate. + ## Automatically track resources Use the [Datadog Tracking HTTP Client][10] package to enable automatic tracking of resources and HTTP calls from your views. diff --git a/content/en/real_user_monitoring/application_monitoring/flutter/setup.md b/content/en/real_user_monitoring/application_monitoring/flutter/setup.md index 336b97bb5b9..70c9c3e4b91 100644 --- a/content/en/real_user_monitoring/application_monitoring/flutter/setup.md +++ b/content/en/real_user_monitoring/application_monitoring/flutter/setup.md @@ -67,36 +67,36 @@ To ensure the safety of your data, you must use a client token. For more informa First, ensure that you have your environment set up properly for each platform.
-Datadog supports Flutter Monitoring for iOS and Android for Flutter 3.0+. +Datadog supports Flutter Monitoring for iOS, Android and Web for Flutter 3.27+.
-Datadog does not officially support Flutter Web, but the current Flutter SDK for mobile apps allows you to achieve some out-of-the-box monitoring. Here are known limitations: +Datadog supports Flutter Web starting with v3 of the SDK, with a few known limitations. -* All Actions reported from Flutter are labeled with type `custom`. -* Long running actions (`startAction` and `stopAction`) are not supported. -* Manually reporting RUM resources (`startResource` and `stopResource`) is not supported. +* Long running actions (`startAction` and `stopAction`) are not supported +* Actions (`addAction`) and manually reported Resources (`startResource` and `stopResource`) do not properly associate with Errors or Actions. * Event mappers are not supported. -* Tags on loggers are not supported. -* `addUserExtraInfo` is not supported. -* `stopSession` is not supported. - -No Flutter Web support is planned, but Datadog's priorities are often re-evaluated based on your feedback. If you have a Flutter Web app and would want to use the Datadog SDK to monitor its performance, reach out to your customer support team and escalate this feature request. #### iOS -Your iOS Podfile, located in `ios/Podfile`, must have `use_frameworks!` set to true (which is the default in Flutter) and must set its target iOS version >= 11.0. +The Datadog SDK for Flutter supports integration with both Cocoapods and Swift Package Manager (SPM). + +If you are using Cocoapods, your iOS Podfile, located in `ios/Podfile`, must have `use_frameworks!` set to true (which is the default in Flutter) and must set its target iOS version >= 12.0. This constraint is usually commented out on the top line of the Podfile, and should read: ```ruby -platform :ios, '11.0' +platform :ios, '12.0' ``` -You can replace `11.0` with any minimum version of iOS you want to support that is 11.0 or higher. +You can replace `12.0` with any minimum version of iOS you want to support that is 12.0 or higher. #### Android -For Android, your `minSdkVersion` version must be >= 21, and if you are using Kotlin, it should be a version >= 1.8.0. These constraints are usually held in your `android/app/build.gradle` file. +For Android, your `minSdkVersion` version must be >= 23, and your `compileSdkVersion` must be >= 35. Clients using Flutter after 3.27 will usually have these variables set to Flutter constants (`flutter.minSdkVersion` and `flutter.compileSdkVersion`), and they do not have to be manually changed. + +If you are using Kotlin, it should be a version >= 2.1.0. Flutter versions above 3.27 will emit a waring stating that older versions of Kotlin will not be supported, and will provide instructions for updating. + +These constraints are usually held in your `android/app/build.gradle` file, or in your `android/grade.properties` file. #### Web @@ -104,56 +104,56 @@ For Web, add the following to your `index.html` under the `head` tag, for **{{}} ```html - - + + ``` {{}} {{< site-region region="ap1" >}} ```html - - + + ``` {{}} {{< site-region region="ap2" >}} ```html - - + + ``` {{}} {{< site-region region="eu" >}} ```html - - + + ``` {{}} {{< site-region region="us3" >}} ```html - - + + ``` {{}} {{< site-region region="us5" >}} ```html - - + + ``` {{}} {{< site-region region="gov" >}} ```html - - + + ``` {{}} @@ -166,7 +166,7 @@ This loads the CDN-delivered Datadog Browser SDKs for Logs and RUM. The synchron ```yaml dependencies: - datadog_flutter_plugin: ^2.0.0 + datadog_flutter_plugin: ^3.0.0 ``` 2. Create a configuration object for each Datadog feature (such as Logs or RUM) with the following snippet. If you do not pass a configuration for a given feature, that feature is disabled. @@ -205,7 +205,7 @@ You can initialize the library using one of two methods in your `main.dart` file }) ``` -* You can also manually set up [Error Tracking][6] and resource tracking. `DatadogSdk.runApp` calls `WidgetsFlutterBinding.ensureInitialized`, so if you are not using `DatadogSdk.runApp`, you need to call this method prior to calling `DatadogSdk.instance.initialize`. +* You can also manually set up [Error Tracking][6]. `DatadogSdk.runApp` calls `WidgetsFlutterBinding.ensureInitialized`, so if you are not using `DatadogSdk.runApp`, you need to call this method prior to calling `DatadogSdk.instance.initialize`. ```dart WidgetsFlutterBinding.ensureInitialized();