Environment Variables SDK Configuration Parameters¶
Use Cases¶
For configuration instructions, refer to Adding Environment Variables for RUM SDK.
Key Fields¶
Web¶
| Parameter Name | Data Type | Description |
|---|---|---|
sessionSampleRate |
number | Data reporting sampling rate, 100 means full collection; 0 means no collection. |
service |
string | Web application service name. |
env |
string | Web application current environment, e.g., prod: production environment; gray: gray environment; pre: pre-release environment; common: daily environment; local: local environment. |
version |
string | Web application version number. |
tracingSampleRate |
number | Trace data sampling percentage: 100 means full collection; 0 means no collection. |
usePartitionedCrossSiteSessionCookie |
boolean | Whether to use cross-domain cookies, enabling third-party cookie cross-partition implementation. Default is not allowed. |
storeContextsToLocal |
boolean | Whether to store common data in localstorage, default is not stored. |
storeContextsKey |
string | Define the key to store in localstorage, default is empty and automatically generated. |
sendContentTypeByJson |
boolean | Data sent as application/json, default is text. |
allowFallbackToLocalStorage |
boolean | If cookies are not available, 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 full error session collection, 0 means ignore error sessions. |
sessionReplaySampleRate |
number | Session Replay full collection sampling 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 sampling rate: when a session is not sampled, if an error occurs during the session, it is collected at this rate. 100 means full collection; 0 means no collection. |
trackUserInteractions |
boolean | Whether to enable user interaction collection. |
compressIntakeRequests |
boolean | Compress RUM data request content to reduce bandwidth usage when sending large amounts of data. Compression is done in the Worker thread. |
traceType |
TraceType | Configure the trace tool type, default is ddtrace. Currently supports ddtrace, zipkin, skywalking_v3, jaeger, zipkin_single_header, w3c_traceparent 6 data types. |
Mobile¶
| Parameter Name | Data Type | Hot Update | Description |
|---|---|---|---|
env |
string |
❌ | Environment configuration, default prod, any character, recommend using a single word, e.g., test |
serviceName |
string |
❌ | Set the name of the 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 to the server after data collection, default true. |
compressIntakeRequests |
bool |
✅ | Compress upload sync data with deflate, default is off. |
syncPageSize |
int |
✅ | Set the number of sync request entries. Range [5,∞), note: the larger the number of request entries, the more computational resources the data sync will occupy. |
syncSleepTime |
int |
✅ | Set the sync interval time, unit milliseconds. Range [0,5000], default is not set. |
rumSampleRate |
float |
❌ | Set RUM sampling rate, range [0,1], 0 means no collection, 1 means full collection, default is 1. Scope is all View, Action, LongTask, Error data under the same session_id. |
rumSessionOnErrorSampleRate |
float |
❌ | Set 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, range [0,1], 0 means no collection, 1 means full collection, default is 0. Scope is the same as rumSampleRate. |
rumEnableTraceUserAction |
bool |
❌ | Whether to automatically trace user actions, currently only supports user start and click actions, default is false. |
rumEnableTraceUserView |
bool |
❌ | Whether to automatically trace user page actions, default is false. |
rumEnableTraceUserResource |
bool |
❌ | Whether to automatically trace user page actions, default is false. |
rumEnableResourceHostIP |
bool |
❌ | Whether to collect the IP of the request target domain name. Scope: only affects the default collection when enableUserResource is true. iOS: >= iOS 13 supports. Android: a single Okhttp has an IP cache mechanism for the same domain name, the same OkhttpClient, if the 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, ft-sdk 1.6.4 and above can control the detection time range [100,∞) with blockDurationMs, unit milliseconds, default is 1 second. |
rumEnableTrackAppCrash |
bool |
❌ | Whether to automatically trace 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 |
❌ | Configure allowed webview host addresses for data tracking, default is no filter. Example: ["10.0.0.1"] |
logSampleRate |
float |
❌ | Set Log collection rate, range [0,1], 0 means no collection, 1 means full collection, default is 1. |
logLevelFilters |
string json array |
✅ | Set level log filtering, default is not set. Example:["info","warn"] |
logEnableConsoleLog |
bool |
✅ | Whether to report console logs. Android only. |
logEnableCustomLog |
bool |
✅ | Whether to upload custom logs, default is false. |
traceSampleRate |
float |
❌ | Set trace collection rate, range [0,1], 0 means no collection, 1 means full collection, default is 1. |
traceEnableAutoTrace |
bool |
❌ | Set whether to enable automatic http trace, currently only supports OKhttp auto-tracing, default is false. |
traceType |
string |
❌ | Set the type of trace, default is ddTrace, zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, jaeger. |
sessionReplaySampleRate |
float |
❌ | Set session replay collection rate, range [0,1], 0 means no collection, 1 means full collection, default is 1. |
sessionReplayOnErrorSampleRate |
float |
❌ | Set error collection rate, when a session is not sampled by setSampleRate, if an error occurs during the session, data from 1 minute before the error can be collected, range [0,1], 0 means no collection, 1 means full collection, default is 0. |
Hot Update: Can take effect immediately after synchronizing dynamic configuration without re-initializing the SDK, mainly for rate-limiting scenarios. Delete Configuration: Needs to take effect on next startup. Parameter Format Configuration Error: If the parameter is not set according to the corresponding data type, or parsing error occurs, it will be considered invalid configuration and have no effect.