You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a237c84
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: en/rum/quickstart/app-management.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,7 +297,7 @@ After disabling geo-location or IP address collection, the related filter and an
297
297
The **Remote Configuration** tab lets you adjust collection and privacy parameters online, without code changes or a new release. When enabled, the configuration on this page overrides SDK initialization settings. When disabled, clients fall back to their SDK initialization settings and data collection continues uninterrupted.
298
298
299
299
<Note>
300
-
- Remote Configuration is currently available for **Browser**, **iOS**, **Android** and **WeChat Mini Program** applications. Other platform types will be enabled as their SDKs ship support.
300
+
- Remote Configuration is currently available for **Browser**, **iOS**, **Android**, **Flutter** and **WeChat Mini Program** applications. Other platform types will be enabled as their SDKs ship support.
301
301
- On SaaS the feature is rolled out account by account. If the **Remote Configuration** tab is not visible on the application detail page, contact support to enable it. On private deployments it is available by default.
302
302
</Note>
303
303
@@ -315,7 +315,7 @@ The **Remote Configuration** tab lets you adjust collection and privacy paramete
315
315
316
316
The two on-error options are independent: **On** delivers `true`, **Off** delivers `false`, and **Use SDK setting** omits the field so the corresponding `init()` option applies (off if unset). Browser applications require Web SDK 0.3.0 or later with `remoteConfigurationEnabled: true` at initialization. Turning off on-error capture does not affect sessions selected by ordinary sampling. See [Web SDK on-error session capture](/en/rum/sdk/web/advanced-config#on-error-session-capture) for scope, billing, and limitations.
317
317
318
-
iOS, Android, and WeChat Mini Program applications also show the **Remote Configuration** tab, but their SDKs read only the **session sample rate** and **custom configuration keys** (none of the three has Session Replay; the other values are neither delivered nor effective). Every SDK has to opt in with `remoteConfigurationEnabled: true` at initialization (off by default; an application that has not opted in never requests the configuration). On iOS this requires SDK 0.6.0 or later, see [iOS SDK Advanced Configuration](/en/rum/sdk/ios/advanced-config#remote-configuration); on Android it requires SDK 0.7.0 or later, see [Android SDK Advanced Configuration](/en/rum/sdk/android/advanced-config#remote-configuration-adjust-the-sample-rate-from-the-console).
318
+
iOS, Android, Flutter, and WeChat Mini Program applications also show the **Remote Configuration** tab, but their SDKs read only the **session sample rate** and **custom configuration keys** (none of them has Session Replay; the other values are neither delivered nor effective). Every SDK has to opt in with `remoteConfigurationEnabled: true` at initialization (off by default; an application that has not opted in never requests the configuration). On iOS this requires SDK 0.6.0 or later, see [iOS SDK Advanced Configuration](/en/rum/sdk/ios/advanced-config#remote-configuration); on Android it requires SDK 0.7.0 or later, see [Android SDK Advanced Configuration](/en/rum/sdk/android/advanced-config#remote-configuration-adjust-the-sample-rate-from-the-console); on Flutter it requires `flashcat_flutter_plugin` 0.2.0 or later, see [Flutter SDK Advanced Configuration](/en/rum/sdk/flutter/advanced-config#remote-configuration).
319
319
320
320
<Warning>
321
321
Custom entries are delivered to clients and may be readable by end users. Never put secrets, access tokens, or personally sensitive information in them.
description: "Configure sampling, remote configuration, tracking consent, event filtering, distributed tracing, and symbol file upload for the Flutter RUM SDK"
This page describes the advanced configuration options of the Flutter SDK. All configuration is passed through `DatadogConfiguration` and `DatadogRumConfiguration`.
@@ -16,6 +16,61 @@ DatadogRumConfiguration(
16
16
);
17
17
```
18
18
19
+
## Remote configuration
20
+
21
+
Starting with `flashcat_flutter_plugin` 0.2.0, the session sample rate can be adjusted online from the console under **Application Management > Remote Configuration**, with no code change or new release. The feature is off by default and has to be enabled at initialization:
22
+
23
+
```dart
24
+
DatadogRumConfiguration(
25
+
applicationId: '<APPLICATION_ID>',
26
+
sessionSamplingRate: 100.0, // Used when the console delivers no rate
27
+
remoteConfigurationEnabled: true,
28
+
);
29
+
```
30
+
31
+
Once enabled, the configuration is fetched by the native Android / iOS SDK underneath the plugin, and behaves exactly as it does there:
32
+
33
+
- A rate published in the console applies to the **next new session**; a session already under way is not affected.
34
+
- The delivered values are persisted locally, so the first session after a cold start is already drawn under the last delivered rate.
35
+
- A failed, timed-out or unreadable response leaves the values in force untouched; they are never cleared. When remote configuration is disabled in the console, the SDK falls back to the `sessionSamplingRate` passed at initialization.
36
+
- The Flutter SDK reads only the **session sample rate** and **custom configuration keys**; the other settings have no effect. Read the custom keys with `getRemoteConfig()`, which returns `null` when remote configuration is off or no configuration has arrived yet:
37
+
38
+
```dart
39
+
final custom = await DatadogSdk.instance.rum?.getRemoteConfig();
40
+
// Numbers can arrive as int or double depending on the platform, so read them as num
41
+
final threshold = (custom?['threshold'] as num?)?.toDouble();
42
+
```
43
+
44
+
To decide sampling by your own business rules, use the `beforeSampling` callback. Each time a new session is about to be drawn it receives the rate that would apply (`sessionSampleRate`) and the console's custom keys (`custom`); return a rate to override it, or `null` to leave it alone. It runs synchronously, so keep it fast; returning a value outside 0–100, throwing, or timing out all keep the native SDK's decision. The callback also runs when remote configuration is off — `sessionSampleRate` is then the local value and `custom` is `null`.
45
+
46
+
```dart
47
+
DatadogRumConfiguration(
48
+
applicationId: '<APPLICATION_ID>',
49
+
remoteConfigurationEnabled: true,
50
+
beforeSampling: (context) {
51
+
// For example: collect every session of users listed in the custom key debugUsers,
52
+
// and keep the delivered rate for everyone else
53
+
final debugUsers = context.custom?['debugUsers'];
54
+
if (debugUsers is List && debugUsers.contains(currentUserId)) {
55
+
return 100;
56
+
}
57
+
return null;
58
+
},
59
+
);
60
+
```
61
+
62
+
To collect the current user regardless of the sample rate (for example while investigating one user's issue), call `DatadogSdk.instance.rum?.setForcedSession()`. If the current session was sampled out it ends immediately and a collected one starts; every session afterwards is collected for the lifetime of the process. The setting cannot be reverted until the app restarts.
63
+
64
+
<Note>
65
+
When Flutter attaches to a native SDK that is already initialized (add-to-app), `remoteConfigurationEnabled` and `beforeSampling` must be set by the native side when it initializes RUM — see [iOS SDK Advanced Configuration](/en/rum/sdk/ios/advanced-config#remote-configuration) and [Android SDK Advanced Configuration](/en/rum/sdk/android/advanced-config#remote-configuration-adjust-the-sample-rate-from-the-console). `getRemoteConfig()` and `setForcedSession()` still work from Dart.
66
+
</Note>
67
+
68
+
<Warning>
69
+
Custom configuration keys are delivered to clients and readable by anyone who holds the Client Token. Never put secrets, access tokens, or personally sensitive information in them.
70
+
</Warning>
71
+
72
+
For the console side (settings, publishing and when a version takes effect), see [Application Management · Remote Configuration](/en/rum/quickstart/app-management#remote-configuration).
73
+
19
74
## Tracking consent
20
75
21
76
`TrackingConsent` controls whether data is collected and reported, to meet compliance requirements such as GDPR:
0 commit comments