Skip to content

Custom Environment Variables


Key Fields

Web

Set remoteConfiguration: true in the Web SDK initialization parameters to enable remote configuration. Browser SDK 3.3.25 and later can distinguish in application code between a processed remote response, fallback to local configuration, and SDK initialization failure. See Web App Access for details.

Parameter Name
Data Type Description
sessionSampleRate number Data reporting sampling rate. 100 means collect all; 0 means collect none.
service string Service name of the Web app.
env string Current environment of the Web app, such as
prod: production environment;
gray: canary environment;
pre: pre-release environment;
common: daily environment;
local: local environment.
version string Version number of the Web app.
tracingSampleRate number Distributed tracing data sampling percentage: 100 means collect all; 0 means collect none.
usePartitionedCrossSiteSessionCookie boolean Whether to use cross-site cookies and enable the partitioned third-party cookie implementation. Cross-site is not allowed by default.
storeContextsToLocal boolean Whether to store common data in localstorage. Not stored by default.
storeContextsKey string Defines the key for storing data in localstorage. Empty by default and generated automatically.
sendContentTypeByJson boolean Sends data as application/json. Default is text.
allowFallbackToLocalStorage boolean When cookies are unavailable, enable this option to store data in localstorage.
sessionOnErrorSampleRate number Error session compensation sampling rate: when a session is not sampled, if an error occurs during the session, collect at this rate. 100 means collect all error sessions; 0 means ignore error sessions.
sessionReplaySampleRate number Session Replay full collection sampling rate: controls the proportion of full data collection for all session replays. 100 means collect all; 0 means collect none.
sessionReplayOnErrorSampleRate number Error session replay compensation sampling rate: when a session is not sampled, if an error occurs during the session, collect at this rate. 100 means collect all; 0 means collect none.
trackUserInteractions boolean Whether to enable user interaction collection.
compressIntakeRequests boolean Compresses the content of RUM data requests to reduce bandwidth usage when sending large volumes of data. Compression is performed in a Worker thread.
traceType TraceType Configures the distributed tracing tool type. Default is ddtrace. Currently supports 6 data types: ddtrace, zipkin, skywalking_v3, jaeger, zipkin_single_header, and w3c_traceparent.

Android

Parameter Name
Data Type Takes Effect Immediately Description
env string ❌ Environment configuration. Default prod. Any characters are allowed; a single word is recommended, for example test.
serviceName string ❌ Sets the name of the business or service it belongs to. Affects the service field data in Log and RUM. Default df_rum_android.
autoSync bool ✅ Whether to automatically sync data to the server after collection. Default true.
compressIntakeRequests bool ✅ Applies deflate compression to uploaded sync data. Disabled by default.
syncPageSize int ✅ Sets the number of entries per sync request. Range [5,∞). Note: the larger the number of request entries, the more computing resources data sync consumes.
syncSleepTime int ✅ Sets the interval between syncs in milliseconds. Range [0,5000]. Not set by default.
sessionSamplingRate float ✅ Sets the RUM sampling percentage. Range [0,100], default 100. Decimals are supported; for example, 0.1 means 0.1%. 0 means collect none and 100 means collect all. Supported in ft-sdk >= 1.7.6.
rumSampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the RUM sampling rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Applies to all View, Action, LongTask, and Error data under the same session_id. Android: ft-sdk > 1.6.16
sessionOnErrorSamplingRate float ✅ Error session compensation sampling percentage. Range [0,100], default 0. Decimals are supported; an explicit new field takes precedence. Supported in ft-sdk >= 1.7.6.
rumSessionOnErrorSampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0. Scope is the same as rumSampleRate. Android: ft-sdk > 1.6.16
rumEnableTraceUserAction bool ❌ Whether to automatically track user actions. Currently only app launches and taps are supported. Default false.
rumEnableTraceUserView bool ❌ Whether to automatically track user page views. Default false.
rumEnableTraceUserResource bool ❌ Whether to automatically track user network requests. Only OkHttp is supported. Default false.
rumEnableResourceHostIP bool ❌ Whether to collect the IP address of the requested target domain. Scope: only affects the default collection when EnableTraceUserResource is true. Android: a single Okhttp caches IPs for the same domain, so the same OkhttpClient generates it only once as long as the server IP being connected to does not change.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection. Default false.
rumBlockDurationMs int ❌ Sets the UI freeze detection threshold. Range [100,∞), in milliseconds. Default 1 second.
rumEnableTrackAppCrash bool ❌ Whether to report app crash logs. Default false.
rumEnableTrackAppANR bool ❌ Whether to enable ANR detection. Default false.
rumEnableTraceWebView bool ❌ Whether to enable webview data monitoring. Default true.
rumAllowWebViewHost string json array ❌ Configures the webview host addresses allowed for data tracking. No filtering by default. Example: ["10.0.0.1"].
logSamplingRate float ✅ Sets the Log sampling percentage. Range [0,100], default 100. Decimals are supported; for example, 0.1 means 0.1%. 0 means collect none and 100 means collect all. Supported in ft-sdk >= 1.7.6.
logSampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the Log collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Android: ft-sdk > 1.6.16
logLevelFilters string json array ✅ Sets level-based log filtering. Not set by default. Example: ["info","warn"].
logEnableConsoleLog bool ✅ Whether to report console logs. Only supported on Android.
logEnableCustomLog bool ✅ Whether to upload custom logs. Default false.
traceSamplingRate float ✅ Sets the Trace sampling percentage. Range [0,100], default 100. Decimals are supported; for example, 0.1 means 0.1%. 0 means collect none and 100 means collect all. Supported in ft-sdk >= 1.7.6.
traceSampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the trace collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Android: ft-sdk > 1.6.16
traceEnableAutoTrace bool ❌ Sets whether to enable automatic http trace. Currently only OKhttp automatic tracing is supported. Default false.
traceType string ❌ Sets the distributed tracing type. Default DDTrace.
sessionReplaySamplingRate float ✅ Session Replay regular sampling percentage. Range [0,100], default 100. Decimals are supported; an explicit new field takes precedence. Supported in ft-sdk >= 1.7.6. When using the new Replay local configuration, ft-session-replay >= 0.1.9 is required.
sessionReplaySampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the session replay collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1.
sessionReplayOnErrorSamplingRate float ✅ Session Replay error compensation sampling percentage. Range [0,100], default 0. Decimals are supported; an explicit new field takes precedence. Supported in ft-sdk >= 1.7.6. When using the new Replay local configuration, ft-session-replay >= 0.1.9 is required.
sessionReplayOnErrorSampleRate float ✅ Deprecated since ft-sdk 1.7.6; retained for compatibility with the 0–1 unit. Sets the error collection rate. When a session is not sampled by sessionReplaySampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0.

iOS/tvOS

For how to enable and fetch it, see iOS Dynamic Configuration. WebView and Session Replay related fields apply only to iOS.

Parameter Name
Data Type Takes Effect Immediately Description
env string ❌ Environment configuration. Default prod. Any characters are allowed; a single word is recommended, for example test.
serviceName string ❌ Sets the name of the business or service it belongs to. Affects the service field data in Log and RUM. Default df_rum_ios.
autoSync bool ✅ Whether to automatically sync data to the server after collection. Default true.
compressIntakeRequests bool ✅ Applies deflate compression to uploaded sync data. Disabled by default.
syncPageSize int ✅ Sets the number of entries per sync request. Range [5,∞). Note: the larger the number of request entries, the more computing resources data sync consumes.
syncSleepTime int ✅ Sets the interval between syncs in milliseconds. Range [0,5000]. Not set by default.
sessionSamplingRate float ✅ RUM session sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 100. When both this field and the old remote field rumSampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
rumSampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the RUM sampling rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Applies to all View, Action, LongTask, and Error data under the same session_id. iOS SDK > 1.5.19
sessionOnErrorSamplingRate float ✅ RUM error session sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 0. When both this field and the old remote field rumSessionOnErrorSampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
rumSessionOnErrorSampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0. Scope is the same as rumSampleRate. iOS SDK > 1.5.19
rumEnableTraceUserAction bool ❌ Whether to track user Action operations. Default false.
rumEnableTraceUserView bool ❌ Whether to track user View operations. Default false.
rumEnableTraceUserResource bool ❌ Whether to track user network requests. Default false.
rumEnableTraceURLConnectionResource bool ✅ SDK 1.6.8+: controls automatic collection of NSURLConnection Resources. Default false. Independent of rumEnableTraceUserResource, which controls URLSession. Updates affect subsequent requests.
rumEnableResourceHostIP bool ❌ Whether to collect the IP address of the requested target domain. Supported on >= iOS 13.0 and >= tvOS 13.0.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection. Default false.
rumBlockDurationMs int ❌ Sets the UI freeze detection threshold. Range [100,∞), in milliseconds. Default 250ms.
rumEnableTrackAppCrash bool ❌ Whether to collect crash logs. Default false.
rumEnableTrackAppANR bool ❌ Whether to enable ANR detection. Default false.
rumEnableTraceWebView bool ❌ Whether to enable webview data monitoring. Default true.
rumAllowWebViewHost string json array ❌ Configures the WebView host allowlist. No filtering by default. The raw configuration is a JSON array string, such as ["example.com"]; the callback model property is an array (NSArray / [String]) and does not need to be encoded again. SDK 1.6.8+ applies it to the shared RUM, Log, and Native Visitor ID Bridge; [] disallows all; remote configuration takes precedence over local configuration. See Allowlist Description.
logSamplingRate float ✅ Log sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 100. When both this field and the old remote field logSampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
logSampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the Log collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. iOS SDK > 1.5.19
logLevelFilters string json array ✅ Sets level-based log filtering. Not set by default. Example: ["info","warn"].
logEnableCustomLog bool ✅ Whether to upload custom logs. Default false.
logEnableWebViewLog bool ✅ SDK 1.6.8+: controls whether Native receives logs from the WebView Browser Logs SDK. Default false. Independent of the Native custom log switch; the page still needs to integrate the Web log SDK.
traceSamplingRate float ✅ Trace sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 100. When both this field and the old remote field traceSampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
traceSampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the trace collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. iOS SDK > 1.5.19
traceEnableAutoTrace bool ❌ Sets whether to enable automatic http trace. Currently only NSURLSession is supported. Default false.
traceEnableAutoTraceURLConnection bool ✅ SDK 1.6.8+: controls automatic injection of NSURLConnection Trace. Default false. Independent of traceEnableAutoTrace, which controls URLSession. Updates affect subsequent requests.
traceType string ❌ Sets the distributed tracing type. Default DDTrace.
sessionReplaySamplingRate float ✅ Session Replay sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 100. When both this field and the old remote field sessionReplaySampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
sessionReplaySampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the session replay collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. sessionReplaySamplingRate is recommended.
sessionReplayOnErrorSamplingRate float ✅ Session Replay error session sampling rate (percentage). Range [0,100]. Decimals are supported: 0.1 means 0.1% and 1 means 1%. 0 means collect none and 100 means collect all. Default 0. When both this field and the old remote field sessionReplayOnErrorSampleRate are valid, this field takes precedence, including 0. Invalid values do not overwrite the original configuration. Supported since SDK 1.6.8.
sessionReplayOnErrorSampleRate float ✅ Deprecated since SDK 1.6.8; retained for compatibility with the [0,1] unit. Sets the error collection rate. When a session is not sampled by sessionReplaySampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0. sessionReplayOnErrorSamplingRate is recommended.

HarmonyOS

Parameter Name
Data Type Takes Effect Immediately Description
env string ❌ Environment configuration. Default prod. New values are merged from the cache on the next SDK initialization.
serviceName string ❌ Sets the service field for Log, RUM, and Trace. Default df_rum_harmonyos; new values take effect on the next SDK initialization.
autoSync bool ✅ Whether to automatically sync data to the server after collection. Default true. When disabled, you can call FTSDK.flushSyncData() to upload data proactively.
compressIntakeRequests bool ✅ Whether to use zlib-wrapped deflate compression for subsequent upload requests. Default true; falls back to plaintext upload when compression is unavailable.
syncPageSize int ✅ Sets the number of entries per subsequent sync. Decimal values are rounded down; on dynamic updates the value is limited to [1,500].
syncSleepTime int ✅ Sets the interval between consecutive sync requests in milliseconds. Range [0,5000], default 0.
rumSampleRate float ✅ Sets the RUM sampling rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Applies to the View, Action, LongTask, and Error data of the same session_id.
rumSessionOnErrorSampleRate float ✅ Sets the error session compensation sampling rate. Range [0,1], default 0. When a session is not collected by rumSampleRate and an error occurs, data from the 1 minute before the error is collected at this rate.
rumEnableTraceUserAction bool ❌ Whether to enable automatic Action collection. Default false; new values take effect on the next SDK initialization.
rumEnableTraceUserView bool ❌ Whether to enable automatic View collection. Default false; new values take effect on the next SDK initialization.
rumEnableTraceUserResource bool ❌ Whether to enable automatic Resource collection. Default false; new values take effect on the next SDK initialization.
rumEnableResourceHostIP bool ❌ Whether to collect the IP address of the requested target domain. Default false; new values take effect on the next SDK initialization.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection. Default false; new values take effect on the next SDK initialization.
rumBlockDurationMs int ❌ UI freeze threshold in milliseconds. Minimum 100, default 1000. It must be configured together with rumEnableTrackAppUIBlock to be applied on the next initialization.
rumEnableTrackAppCrash bool ❌ Whether to enable app crash monitoring. Default false; new values take effect on the next SDK initialization.
rumEnableTrackAppANR bool ❌ Whether to enable ANR monitoring. Default false; new values take effect on the next SDK initialization.
rumEnableTraceWebView bool ❌ Whether to enable WebView data monitoring. Default false; new values take effect on the next SDK initialization.
rumAllowWebViewHost string json array ❌ Configures the WebView Hosts allowed for collection. No filtering by default. Example: ["10.0.0.1"]; new values take effect on the next SDK initialization.
logSampleRate float ✅ Sets the Log sampling rate. Range [0,1], default 1.
logLevelFilters string json array ✅ Sets log level filtering. Not set by default. Example: ["info","warn"].
logEnableCustomLog bool ✅ Whether to upload custom logs. Default false.
logEnableConsoleLog bool ✅ Whether to enable automatic log collection for console.* and hilog.*; the corresponding HarmonyOS compilation plugin must also be integrated and enabled. Supported in ft_sdk 0.1.17 and later.
traceSampleRate float ✅ Sets the Trace sampling rate. Range [0,1], default 1.
traceEnableAutoTrace bool ❌ Whether to enable automatic HTTP Trace. Default false; new values take effect on the next SDK initialization.
traceType string ❌ Sets the Trace type. Default ddtrace. Supports ddtrace, zipkin_multi_header, zipkin_single_header, traceparent, skywalking, and jaeger; new values take effect on the next SDK initialization.
sessionReplaySampleRate float ❌ Sets the session replay collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1.
sessionReplayOnErrorSampleRate float ❌ Sets the error collection rate. When a session is not sampled by sessionReplaySampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0.

React Native

SDK 0.4.3 and later support decimal percentage sampling fields. The old probability sampling fields are deprecated but retained for compatibility.

For how to enable and fetch it, see React Native Dynamic Configuration.

Parameter Name
Data Type Takes Effect Immediately Description
env string ❌ Environment configuration. Default prod. Any characters are allowed; a single word is recommended, for example test.
serviceName string ❌ Sets the name of the business or service it belongs to. Affects the service field data in Log and RUM. Defaults: df_rum_ios, df_rum_android.
autoSync bool ✅ Whether to automatically sync data to the server after collection. Default true.
compressIntakeRequests bool ✅ Applies deflate compression to uploaded sync data. Disabled by default.
syncPageSize int ✅ Sets the number of entries per sync request. Range [5,∞). Note: the larger the number of request entries, the more computing resources data sync consumes.
syncSleepTime int ✅ Sets the interval between syncs in milliseconds. Range [0,5000]. Not set by default.
sessionSamplingRate float ✅ RUM session sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 100. Applies to the RUM data of the same Session. When both this field and the old field rumSampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
rumSampleRate float ✅ Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the RUM sampling rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. Applies to all View, Action, LongTask, and Error data under the same session_id. sessionSamplingRate is recommended.
sessionOnErrorSamplingRate float ✅ RUM error session sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 0. Applies to sessions not selected by regular session sampling; when an error occurs, data from the 1 minute before the error can be collected. When both this field and the old field rumSessionOnErrorSampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
rumSessionOnErrorSampleRate float ✅ Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0. Scope is the same as rumSampleRate. sessionOnErrorSamplingRate is recommended.
rumEnableTraceUserAction bool ❌ Whether to perform Native Action tracking. Default false.
rumEnableTraceUserView bool ❌ Whether to perform Native View automatic tracking. Default false.
rumEnableTraceUserResource bool ❌ Whether to enable Native Resource automatic tracking. Default false.
rumEnableResourceHostIP bool ❌ Whether to collect the IP address of the requested target domain. Scope: only affects the default collection when enableNativeUserResource is true. iOS: supported on >= iOS 13; Android: IP caching exists in the same OkhttpClient.
rumEnableTrackAppUIBlock bool ❌ Whether to collect Native Freeze. Default false.
rumBlockDurationMs int ❌ Sets the Native Freeze freeze threshold. Range [100,∞), in milliseconds. Default 250ms on iOS and 1000ms on Android.
rumEnableTrackAppCrash bool ❌ Whether to enable Android Java Crash and OC/C/C++ crash monitoring. Default false.
rumEnableTrackAppANR bool ❌ Whether to enable Native ANR monitoring. Default false.
rumEnableTraceWebView bool ❌ Whether to enable webview data monitoring. Default true.
rumAllowWebViewHost string json array ❌ Configures the webview host addresses allowed for data tracking. No filtering by default. Example: ["10.0.0.1"]. Since SDK 0.4.3 it applies to both WebView RUM and logs, and takes precedence over the local FTMobileConfig.allowWebViewHost and the old RUM configuration.
logSamplingRate float ✅ Log sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 100. When both this field and the old field logSampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
logSampleRate float ✅ Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the Log collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. logSamplingRate is recommended.
logLevelFilters string json array ✅ Sets level-based log filtering. Not set by default. Example: ["info","warn"].
logEnableCustomLog bool ✅ Whether to upload custom logs. Default false.
logEnableWebViewLog bool ✅ Whether to receive logs generated by the Browser Logs SDK in WebView. Default false; overrides the local FTLogConfig.enableWebViewLog. Independent of the custom log switch; the page still needs to integrate the Browser Logs SDK. Supported since SDK 0.4.3.
traceSamplingRate float ✅ Trace sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 100. When both this field and the old field traceSampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
traceSampleRate float ✅ Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the trace collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. traceSamplingRate is recommended.
traceEnableAutoTrace bool ❌ Sets whether to enable automatic native network tracing for iOS NSURLSession and Android OKhttp. Default false.
traceType string ❌ Sets the distributed tracing type. Defaults include ddTrace, zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, and jaeger.
sessionReplaySamplingRate float ✅ Session Replay sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 100. Replay sampling is performed on top of RUM session sampling. When both this field and the old field sessionReplaySampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
sessionReplaySampleRate float ✅ (supported since SDK 0.4.3) Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the session replay collection rate. Range [0,1]; 0 means collect none, 1 means collect all. Default 1. sessionReplaySamplingRate is recommended.
sessionReplayOnErrorSamplingRate float ✅ Session Replay error session sampling percentage. Range [0,100]. Decimals are supported: 1 means 1%, 0 means collect none, and 100 means collect all. Default 0. Applies to sessions not selected by regular Replay sampling; when an error occurs, data from the 1 minute before the error can be collected. When both this field and the old field sessionReplayOnErrorSampleRate are valid, this field takes precedence, including 0. Supported since SDK 0.4.3.
sessionReplayOnErrorSampleRate float ✅ (supported since SDK 0.4.3) Deprecated since SDK 0.4.3; retained for compatibility with the [0,1] unit. Sets the error collection rate. When a session is not sampled by sessionReplaySampleRate, if an error occurs during the session, data from the 1 minute before the error can be collected. Range [0,1]; 0 means collect none, 1 means collect all. Default 0. sessionReplayOnErrorSamplingRate is recommended.

Flutter

Flutter SDK 0.5.7 and later support remote configuration; SDK 0.5.8 and later support the following percentage sampling fields and logEnableWebViewLog. Flutter Session Replay sampling fields require ft_session_replay_flutter 0.1.1 or a later compatible version to be installed and initialized.

For how to enable and update it, see Flutter Dynamic Configuration. The table below lists server-side remote configuration fields; the field names follow the native SDKs. Fields that are not set retain the existing configuration; the default values in the table refer to the SDK defaults when neither local nor remote configuration is applied.

Common configurations such as sampling, log filtering, and data upload affect Flutter data. Native collection switches for View, Action, Resource, and freezes only control the corresponding native collection and do not modify Dart-side configuration: rumEnableTraceUserView does not control Flutter automatic routing, rumEnableTraceUserResource does not modify enableUserResource, and traceEnableAutoTrace does not modify enableAutoTrace of Dart network tracing. The Flutter LongTask enableLongTask and dartLongTaskThreshold do not support remote configuration for now.

Parameter Name
Data Type Takes Effect Immediately Description
env string ❌ Environment. Default prod. A single word is recommended, for example test.
serviceName string ❌ Business or service name. Affects the service field of Log and RUM. Default df_rum_ios on iOS and df_rum_android on Android.
autoSync bool ✅ Whether to automatically upload collected data. Default true.
compressIntakeRequests bool ✅ Whether to apply deflate compression to uploaded data. Default true since Flutter SDK 0.5.7, and false before that.
syncPageSize int ✅ Number of entries per upload batch, not less than 5. Default 10; the larger the number of entries, the more computing resources sync requires.
syncSleepTime int ✅ Interval between batches in milliseconds. Range [0,5000], default 0.
sessionSamplingRate float ✅ RUM session sampling percentage. Range [0,100], default 100. Affects Flutter and native RUM data in the same session. Supported since SDK 0.5.8.
rumSampleRate float ✅ Compatible with the old RUM session sampling probability. Range [0,1], default 1. sessionSamplingRate is recommended.
sessionOnErrorSamplingRate float ✅ Error compensation sampling percentage when normal RUM session sampling is not hit. Range [0,100], default 0. Supported since SDK 0.5.8.
rumSessionOnErrorSampleRate float ✅ Compatible with the old RUM error compensation sampling probability. Range [0,1], default 0. sessionOnErrorSamplingRate is recommended.
rumEnableTraceUserAction bool ❌ Whether to automatically collect native Actions. Default false. Does not control Actions reported manually by Flutter.
rumEnableTraceUserView bool ❌ Whether to automatically collect native Views. Default false. Does not control Flutter route Views.
rumEnableTraceUserResource bool ❌ Whether to automatically collect native network Resources. Default false. Does not control collection of Dart HttpClient or WebSocket.
rumEnableResourceHostIP bool ❌ Whether to collect the Host IP of native Resource requests. Default false. Only affects native network automatic collection.
rumEnableTrackAppUIBlock bool ❌ Whether to collect native main thread freezes. Default false. Does not control LongTask detection of the Flutter Dart main Isolate.
rumBlockDurationMs int ❌ Native main thread freeze threshold in milliseconds, not less than 100. Default 250 on iOS and 1000 on Android.
rumEnableTrackAppCrash bool ❌ Whether to enable native crash monitoring. Default false.
rumEnableTrackAppANR bool ❌ Whether to enable native ANR monitoring. Default false.
rumEnableTraceWebView bool ❌ Whether to collect WebView RUM data. Default true.
rumAllowWebViewHost string json array ❌ List of WebView Hosts allowed to collect data. No filtering by default, for example ["example.com"]; [] disallows all. Since SDK 0.5.8 it applies to both WebView RUM and logs, and takes precedence over FTMobileFlutter.sdkConfig(allowWebViewHost: ...) and the old RUM configuration.
logSamplingRate float ✅ Log sampling percentage. Range [0,100], default 100. Supported since SDK 0.5.8.
logSampleRate float ✅ Compatible with the old Log sampling probability. Range [0,1], default 1. logSamplingRate is recommended.
logLevelFilters string json array ✅ Log level filtering. No filtering by default, for example ["info","error"].
logEnableCustomLog bool ✅ Whether to upload custom logs reported through interfaces such as FTLogger. Default false.
logEnableConsoleLog bool ✅ Only supported on Android. Controls native console log collection; it does not mean automatic collection of Dart print().
logEnableWebViewLog bool ✅ Whether to receive logs generated by the Browser Logs SDK in WebView. Default false, independent of the custom log switch. The page still needs to integrate the Browser Logs SDK. See WebView Log Collection. Supported since SDK 0.5.8.
traceSamplingRate float ✅ Trace sampling percentage. Range [0,100], default 100. Supported since SDK 0.5.8.
traceSampleRate float ✅ Compatible with the old Trace sampling probability. Range [0,1], default 1. traceSamplingRate is recommended.
traceEnableAutoTrace bool ❌ Whether to enable native network automatic tracing: NSURLSession on iOS and OkHttp on Android. Default false. Does not control enableAutoTrace of Dart network tracing.
traceType string ❌ Distributed tracing type, such as ddTrace, traceparent, or jaeger. Default ddTrace.
sessionReplaySamplingRate float ✅ Replay sampling percentage on top of RUM session sampling. Range [0,100], default 100. Supported since Core SDK 0.5.8 and Replay SDK 0.1.1.
sessionReplaySampleRate float ✅ Server-side compatible old Replay sampling probability. Range [0,1], default 1. sessionReplaySamplingRate is recommended.
sessionReplayOnErrorSamplingRate float ✅ Error compensation sampling percentage when normal Replay sampling is not hit. Range [0,100], default 0. Supported since Core SDK 0.5.8 and Replay SDK 0.1.1.
sessionReplayOnErrorSampleRate float ✅ Server-side compatible old Replay error compensation sampling probability. Range [0,1], default 0. sessionReplayOnErrorSamplingRate is recommended.

All percentage fields support decimals: 0.1 means 0.1%, 1 means 1%; 0 means no sampling, 100 means full sampling. When both valid new and old fields are set for the same item, the new percentage field takes precedence, including an explicit 0. Old probability values must be converted when migrated; for example, 0.125 corresponds to 12.5, both meaning 12.5%.

Rules for when remote configuration takes effect on mobile (Android, iOS/tvOS, HarmonyOS, React Native, Flutter):

  • Takes effect immediately: takes effect right after the mobile SDK syncs the remote configuration without reinitializing the SDK, mainly for rate-limiting scenarios;

  • Deleting configuration: requires a restart to take effect;

  • Incorrect parameter format configuration: if a parameter is not set according to its corresponding data type, or a parsing error occurs, it is treated as an invalid configuration and has no effect.

Feedback

Is this page helpful?