Skip to content

Custom Environment Variables


Key Fields

Web

Parameter Name
Data Type Description
sessionSampleRate number Data reporting sample rate: 100 means full collection; 0 means no collection.
service string Service name of the Web application.
env string Current environment of the Web application, e.g.,
prod: production environment;
gray: canary environment;
pre: pre-release environment;
common: daily environment;
local: local environment.
version string Version number of the Web application.
tracingSampleRate number Trace data sampling percentage: 100 means full collection; 0 means no collection.
usePartitionedCrossSiteSessionCookie boolean Whether to use cross-site cookies, enabling the third-party cookie partitioning implementation (CHIPS). 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. Left empty by default; generated automatically.
sendContentTypeByJson boolean Sends data using the application/json content type; defaults to text.
allowFallbackToLocalStorage boolean When cookies are unavailable, you can enable this option to store data in localstorage.
sessionOnErrorSampleRate number Error session compensation sample rate: when a session is not sampled, error sessions are collected at this ratio if an error occurs during the session. 100 means collect all error sessions; 0 means ignore error sessions.
sessionReplaySampleRate number Session Replay full collection sample rate: controls the full data collection ratio for all session replays. 100 means full collection; 0 means no collection.
sessionReplayOnErrorSampleRate number Error session replay compensation sample rate: when a session is not sampled, session replays are collected at this ratio if an error occurs during the session. 100 means full collection; 0 means no collection.
trackUserInteractions boolean Whether to enable user interaction collection.
compressIntakeRequests boolean Compresses RUM request content to reduce bandwidth usage when sending large amounts of data. Compression is performed on a Worker thread.
traceType TraceType Configures the distributed tracing tool type; defaults to ddtrace. Currently supports 6 data types: ddtrace, zipkin, skywalking_v3, jaeger, zipkin_single_header, and w3c_traceparent.

Android

Parameter Name
Data Type Hot Reload Description
env string ❌ Environment configuration; defaults to prod. Any string is accepted; a single word such as test is recommended.
serviceName string ❌ Sets the name of the associated business or service, affecting the service field data in Log and RUM. Defaults to df_rum_android.
autoSync bool ✅ Whether to automatically sync collected data to the server; defaults to 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 sync interval, in milliseconds. Range [0,5000]; not set by default.
rumSampleRate float ✅ Sets the RUM sample rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. Scope: all View, Action, LongTask, and Error data under the same session_id. Android: ft-sdk > 1.6.16
rumSessionOnErrorSampleRate float ✅ Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0. Same scope as rumSampleRate. Android: ft-sdk > 1.6.16
rumEnableTraceUserAction bool ❌ Whether to automatically track user operations. Currently only supports app launch and click operations; defaults to false.
rumEnableTraceUserView bool ❌ Whether to automatically track user page operations; defaults to false.
rumEnableTraceUserResource bool ❌ Whether to automatically track user network requests; only supports OkHttp; defaults to false.
rumEnableResourceHostIP bool ❌ Whether to collect the IP of the requested target domain. Scope: only affects the default collection when EnableTraceUserResource is true. Android: a single Okhttp has an IP cache mechanism for the same domain, and the same OkhttpClient will generate the IP only once as long as the server IP it connects to does not change.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection; defaults to false.
rumBlockDurationMs int ❌ Sets the UI freeze detection threshold, range [100,∞), in milliseconds; default is 1 second.
rumEnableTrackAppCrash bool ❌ Whether to report App crash logs; defaults to false.
rumEnableTrackAppANR bool ❌ Whether to enable ANR detection; defaults to false.
rumEnableTraceWebView bool ❌ Whether to enable webview data monitoring; defaults to true.
rumAllowWebViewHost string json array ❌ Configures the webview host addresses allowed for data tracking. No filtering by default. Example: ["10.0.0.1"].
logSampleRate float ✅ Sets the Log collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. Android: ft-sdk > 1.6.16
logLevelFilters string json array ✅ Sets log level filtering. Not set by default. Example: ["info","warn"].
logEnableConsoleLog bool ✅ Whether to report console logs. Supported on Android only.
logEnableCustomLog bool ✅ Whether to upload custom logs; defaults to false.
traceSampleRate float ✅ Sets the trace collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. Android: ft-sdk > 1.6.16
traceEnableAutoTrace bool ❌ Sets whether to enable automatic http trace. Currently only supports automatic tracing for OKhttp; defaults to false.
traceType string ❌ Sets the type of distributed tracing; defaults to DDTrace.
sessionReplaySampleRate float ❌ Sets the session replay collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 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 up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0.

iOS/tvOS

Parameter Name
Data Type Hot Reload Description
env string ❌ Environment configuration; defaults to prod. Any string is accepted; a single word such as test is recommended.
serviceName string ❌ Sets the name of the associated business or service, affecting the service field data in Log and RUM. Defaults to df_rum_ios.
autoSync bool ✅ Whether to automatically sync collected data to the server; defaults to 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 sync interval, in milliseconds. Range [0,5000]; not set by default.
rumSampleRate float ✅ Sets the RUM sample rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. Scope: all View, Action, LongTask, and Error data under the same session_id. iOS: ft-sdk > 1.5.21
rumSessionOnErrorSampleRate float ✅ Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0. Same scope as rumSampleRate. Hot reload: iOS: ft-sdk > 1.5.21
rumEnableTraceUserAction bool ❌ Whether to track user Action operations; defaults to false.
rumEnableTraceUserView bool ❌ Whether to track user View operations; defaults to false.
rumEnableTraceUserResource bool ❌ Whether to track user network requests; defaults to false.
rumEnableResourceHostIP bool ❌ Whether to collect the IP of the requested target domain; supported on >= iOS 13.0 and >= tvOS 13.0.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection; defaults to false.
rumBlockDurationMs int ❌ Sets the UI freeze detection threshold, range [100,∞), in milliseconds; default is 250ms.
rumEnableTrackAppCrash bool ❌ Whether to collect crash logs; defaults to false.
rumEnableTrackAppANR bool ❌ Whether to enable ANR detection; defaults to false.
rumEnableTraceWebView bool ❌ Whether to enable webview data monitoring; defaults to true.
rumAllowWebViewHost string json array ❌ Configures the webview host addresses allowed for data tracking. No filtering by default. Example: ["10.0.0.1"].
logSampleRate float ✅ Sets the Log collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. iOS: ft-sdk > 1.5.19
logLevelFilters string json array ✅ Sets log level filtering. Not set by default. Example: ["info","warn"].
logEnableCustomLog bool ✅ Whether to upload custom logs; defaults to false.
traceSampleRate float ✅ Sets the trace collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. iOS: ft-sdk > 1.5.19
traceEnableAutoTrace bool ❌ Sets whether to enable automatic http trace. Currently only supports NSURLSession; defaults to false.
traceType string ❌ Sets the type of distributed tracing; defaults to DDTrace.
sessionReplaySampleRate float ❌ Sets the session replay collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 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 up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0.

HarmonyOS

Parameter Name
Data Type Hot Reload Description
env string ❌ Environment configuration; defaults to prod. New values are merged from the cache at the next SDK initialization.
serviceName string ❌ Sets the service field for Log, RUM, and Trace; defaults to df_rum_harmonyos. New values take effect at the next SDK initialization.
autoSync bool ✅ Whether to automatically sync collected data to the server; defaults to true. When disabled, data can be uploaded manually via FTSDK.flushSyncData().
compressIntakeRequests bool ✅ Whether to use zlib-wrapped deflate compression for subsequent upload requests; defaults to 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, and dynamically updated values are 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 sample rate, range [0,1]; 0 means no collection, 1 means full collection, default 1. Applies to View, Action, LongTask, and Error data under the same session_id.
rumSessionOnErrorSampleRate float ✅ Sets the error session compensation sample rate, range [0,1], default 0. When a session is not collected by rumSampleRate and an error occurs, data from up to 1 minute before the error is collected at this ratio.
rumEnableTraceUserAction bool ❌ Whether to enable automatic Action collection; default false. New values take effect at the next SDK initialization.
rumEnableTraceUserView bool ❌ Whether to enable automatic View collection; default false. New values take effect at the next SDK initialization.
rumEnableTraceUserResource bool ❌ Whether to enable automatic Resource collection; default false. New values take effect at the next SDK initialization.
rumEnableResourceHostIP bool ❌ Whether to collect the IP of the requested target domain; default false. New values take effect at the next SDK initialization.
rumEnableTrackAppUIBlock bool ❌ Whether to enable UI freeze detection; default false. New values take effect at the next SDK initialization.
rumBlockDurationMs int ❌ UI freeze threshold, in milliseconds, minimum 100, default 1000. It must be configured together with rumEnableTrackAppUIBlock to take effect at the next initialization.
rumEnableTrackAppCrash bool ❌ Whether to enable App crash monitoring; default false. New values take effect at the next SDK initialization.
rumEnableTrackAppANR bool ❌ Whether to enable ANR monitoring; default false. New values take effect at the next SDK initialization.
rumEnableTraceWebView bool ❌ Whether to enable WebView data monitoring; default false. New values take effect at the next SDK initialization.
rumAllowWebViewHost string json array ❌ Configures the WebView Host addresses allowed for collection. No filtering by default. Example: ["10.0.0.1"]. New values take effect at the next SDK initialization.
logSampleRate float ✅ Sets the Log sample 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.*. You must also integrate and enable the corresponding HarmonyOS compilation plugin. Supported in ft_sdk 0.1.17 and later.
traceSampleRate float ✅ Sets the Trace sample rate, range [0,1], default 1.
traceEnableAutoTrace bool ❌ Whether to enable automatic HTTP Trace; default false. New values take effect at the next SDK initialization.
traceType string ❌ Sets the Trace type; defaults to ddtrace. Supports ddtrace, zipkin_multi_header, zipkin_single_header, traceparent, skywalking, and jaeger. New values take effect at the next SDK initialization.
sessionReplaySampleRate float ❌ Sets the session replay collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 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 up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0.

React Native

Parameter Name
Data Type Hot Reload Description
env string ❌ Environment configuration; defaults to prod. Any string is accepted; a single word such as test is recommended.
serviceName string ❌ Sets the name of the associated business or service, affecting the service field data in Log and RUM. Defaults: df_rum_ios, df_rum_android.
autoSync bool ✅ Whether to automatically sync collected data to the server; defaults to 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 sync interval, in milliseconds. Range [0,5000]; not set by default.
rumSampleRate float ✅ Sets the RUM sample rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1. Scope: all View, Action, LongTask, and Error data under the same session_id.
rumSessionOnErrorSampleRate float ✅ Sets the error collection rate. When a session is not sampled by rumSampleRate, if an error occurs during the session, data from up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0. Same scope as rumSampleRate.
rumEnableTraceUserAction bool ❌ Whether to perform Native Action tracking; default false.
rumEnableTraceUserView bool ❌ Whether to perform automatic Native View tracking; default false.
rumEnableTraceUserResource bool ❌ Whether to enable automatic Native Resource tracking; default false.
rumEnableResourceHostIP bool ❌ Whether to collect the IP of the requested target domain. Scope: only affects the default collection when enableNativeUserResource is true. iOS: supported on >= iOS 13; Android: the same OkhttpClient has an IP cache mechanism.
rumEnableTrackAppUIBlock bool ❌ Whether to collect Native Freeze; default false.
rumBlockDurationMs int ❌ Sets the Native Freeze freeze threshold, range [100,∞), in milliseconds. iOS default is 250ms; Android default is 1000ms.
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; defaults to true.
rumAllowWebViewHost string json array ❌ Configures the webview host addresses allowed for data tracking. No filtering by default. Example: ["10.0.0.1"].
logSampleRate float ✅ Sets the Log collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1.
logLevelFilters string json array ✅ Sets log level filtering. Not set by default. Example: ["info","warn"].
logEnableCustomLog bool ✅ Whether to upload custom logs; defaults to false.
traceSampleRate float ✅ Sets the trace collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 1.
traceEnableAutoTrace bool ❌ Sets whether to enable automatic tracing of native network requests, iOS NSURLSession and Android OKhttp; defaults to false.
traceType string ❌ Sets the type of distributed tracing; defaults to ddTrace, zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, and jaeger.
sessionReplaySampleRate float ❌ Sets the session replay collection rate, range [0,1]; 0 means no collection, 1 means full collection, default value is 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 up to 1 minute before the error can be collected. Range [0,1]; 0 means no collection, 1 means full collection, default value is 0.

Remote configuration application rules for mobile SDKs (Android, iOS/tvOS, HarmonyOS, React Native):

  • Hot Reload: Takes effect immediately after the mobile SDK syncs the remote configuration, without the need to reinitialize the SDK. It is mainly used for rate limiting scenarios.

  • Deleting a configuration: Takes effect at the next launch.

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

Feedback

Is this page helpful?