Custom Environment Variables¶
Key Fields¶
Web¶
Parameter Name |
Data Type | Description |
|---|---|---|
sessionSampleRate |
number | Data upload sampling rate. 100 means collect all. 0 means collect none. |
service |
string | The service name of the Web application. |
env |
string | The current environment of the Web application, e.g., prod: Production environment; gray: Gray environment; pre: Pre-release environment; common: Daily environment; local: Local environment. |
version |
string | The version number of the Web application. |
tracingSampleRate |
number | Trace data sampling percentage. 100 means collect all. 0 means collect none. |
usePartitionedCrossSiteSessionCookie |
boolean | Whether to use cross-domain cookies, enabling third-party cookie cross-partition implementation. Cross-domain is not allowed by default. |
storeContextsToLocal |
boolean | Whether to store public data in localstorage. Not stored by default. |
storeContextsKey |
string | Defines the key for storage in localstorage. Leave blank by default for auto-generation. |
sendContentTypeByJson |
boolean | Data sending method as application/json. Default is text. |
allowFallbackToLocalStorage |
boolean | If 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, it is collected 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 full collection, 0 means no collection. |
sessionReplayOnErrorSampleRate |
number | Error session replay compensation sampling rate: When a session is not sampled, if an error occurs during the session, the replay is collected at this rate. 100 means collect all. 0 means collect none. |
trackUserInteractions |
boolean | Whether to enable user interaction collection. |
compressIntakeRequests |
boolean | Compresses RUM data request content to reduce bandwidth usage when sending large amounts of data. Compression is done in a Worker thread. |
traceType |
TraceType | Configures the trace tool type. Default is ddtrace. Currently supports 6 data types: ddtrace, zipkin, skywalking_v3, jaeger, zipkin_single_header, w3c_traceparent. |
MOBILE¶
Parameter Name |
Data Type | Hot Reload | Description |
|---|---|---|---|
env |
string |
❌ | Environment configuration. Default is prod. Any character is allowed. A single word is recommended, e.g., test. |
serviceName |
string |
❌ | Sets the name of the associated business or service, affecting the service field data in Log and RUM. Default: df_rum_ios, df_rum_android. |
autoSync |
bool |
✅ | Whether to automatically sync data to the server after collection. Default is true. |
compressIntakeRequests |
bool |
✅ | Compresses upload sync data using deflate. Disabled by default. |
syncPageSize |
int |
✅ | Sets the number of entries per sync request. Range [5,∞). Note: A larger number of entries means the data sync consumes more computing resources. |
syncSleepTime |
int |
✅ | Sets the sync interval time in milliseconds. Range [0,5000]. Not set by default. |
rumSampleRate |
float |
✅ | Sets the RUM sampling rate. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 1. Scope: All View, Action, LongTask, Error data under the same session_id. Android: ft-sdk > 1.6.16, iOS > 1.5.19 |
rumSessionOnErrorSampleRate |
float |
✅ | Sets the error collection rate. When a session is not sampled by sampleRate, if an error occurs during the session, data from 1 minute before the error can be collected. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 0. Scope is the same as rumSampleRate. Android: ft-sdk > 1.6.16, iOS > 1.5.19 |
rumEnableTraceUserAction |
bool |
❌ | Whether to automatically track user actions. Currently only supports user start and click actions. Default is false. |
rumEnableTraceUserView |
bool |
❌ | Whether to automatically track user page actions. Default is false. |
rumEnableTraceUserResource |
bool |
❌ | Whether to automatically track user resource actions. Default is false. |
rumEnableResourceHostIP |
bool |
❌ | Whether to collect the IP address of the requested target domain. Scope: Only affects default collection when enableUserResource is true. iOS: Supported on >= iOS 13. Android: A single Okhttp has an IP caching mechanism for the same domain. For the same OkhttpClient, if the connected server IP does not change, it will only be generated once. |
rumEnableTrackAppUIBlock |
bool |
❌ | Whether to enable ANR detection. Default is false. |
rumBlockDurationMs |
int |
❌ | Whether to enable UI freeze detection. Default is false. For ft-sdk 1.6.4 and above, blockDurationMs controls the detection time range [100,∞) in milliseconds. Default is 1 second. |
rumEnableTrackAppCrash |
bool |
❌ | Whether to automatically track user actions. Currently only supports user start and click actions. Default is false. |
rumEnableTrackAppANR |
bool |
❌ | Whether to enable ANR detection. Default is false. |
rumEnableTraceWebView |
bool |
❌ | Whether to enable webview data monitoring. Default is true. |
rumAllowWebViewHost |
string json array |
❌ | Configures the allowed webview host addresses for data tracking. No filtering by default. Example: ["10.0.0.1"] |
logSampleRate |
float |
✅ | Sets the Log sampling rate. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 1. Android: ft-sdk > 1.6.16, iOS > 1.5.19 |
logLevelFilters |
string json array |
✅ | Sets level log filtering. Not set by default. Example:["info","warn"] |
logEnableConsoleLog |
bool |
✅ | Whether to upload console logs. Android only. |
logEnableCustomLog |
bool |
✅ | Whether to upload custom logs. Default is false. |
traceSampleRate |
float |
✅ | Sets the trace sampling rate. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 1. Android: ft-sdk > 1.6.16, iOS > 1.5.19 |
traceEnableAutoTrace |
bool |
❌ | Sets whether to enable automatic http trace. Currently only supports automatic tracing for OKhttp. Default is false. |
traceType |
string |
❌ | Sets the type of trace. Default is ddTrace, zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, jaeger. |
sessionReplaySampleRate |
float |
❌ | Sets the session replay sampling rate. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 1. |
sessionReplayOnErrorSampleRate |
float |
❌ | Sets the error collection rate for session replay. When a session is not sampled by setSampleRate, if an error occurs during the session, the replay from 1 minute before the error can be collected. Valid range [0,1]. 0 means no collection, 1 means full collection. Default is 0. |
-
Hot Reload: Can take effect immediately after syncing the dynamic configuration without reinitializing the SDK, mainly for rate-limiting scenarios.
-
Delete Configuration: Requires the next launch to take effect.
-
Parameter Format Configuration Error: If the parameter is not set according to the corresponding data type, or a parsing error occurs, it will be considered an invalid configuration and will have no effect.