Skip to content

SDK Configuration Parameters for Environment Variables


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 The service name of the Web application.
env string The current environment of the Web application, such as
prod: production environment;
gray: gray release environment;
pre: pre-release environment;
common: daily environment;
local: local environment.
version string The version number of the Web application.
tracingSampleRate number Tracing data sampling percentage: 100 means full collection; 0 means no collection.
usePartitionedCrossSiteSessionCookie boolean Whether to use cross-domain cookies and enable third-party cookie partitioning. Cross-domain is not allowed by default.
storeContextsToLocal boolean Whether to store common data in localstorage. It does not store by default.
storeContextsKey string Defines the key stored in localstorage, left blank by default and auto-generated.
sendContentTypeByJson boolean Sends data with application/json format, default is text.
allowFallbackToLocalStorage boolean If cookies are unavailable, this option can be enabled 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, data will be collected at this ratio. 100 means fully collect error sessions, 0 means ignore error sessions.
sessionReplaySampleRate number Session Replay full collection sampling rate: Controls the proportion of all session replay data collection. 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, data will be collected at this ratio. 100 means full collection; 0 means no collection.
trackUserInteractions boolean Whether to enable user behavior collection.
compressIntakeRequests boolean Compresses RUM data request content to reduce bandwidth usage when sending large amounts of data. Compression is completed in the Worker thread.
traceType TraceType Configures the tracing 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 prod, any character, it is recommended to use a single word, for example test
serviceName string Sets the name of the associated business or service, affects the service field data in Logs and RUM. Default: df_rum_ios, df_rum_android.
autoSync bool Whether to automatically synchronize data to the server after collecting data, default true.
compressIntakeRequests bool Compresses uploaded synchronization data using deflate, default off.
syncPageSize int Sets the number of entries per sync request. Range [5,∞), note: larger entry numbers mean more computational resources used for data synchronization.
syncSleepTime int Sets the intermittent time between syncs, unit milliseconds. Range [0,5000], default not set.
rumSampleRate float Sets the RUM sampling rate, range [0,1], 0 means no collection, 1 means full collection, default value is 1. Scope: applies to all View, Action, LongTask, Error data under the same session_id.
rumSessionOnErrorSampleRate float Sets the error collection rate, when the session is not sampled by sampleRate, if an error occurs during the session, data from the previous 1-minute range can be collected, range [0,1], 0 means no collection, 1 means full collection, default value is 0. Scope same as rumSampleRate.
rumEnableTraceUserAction bool Whether to automatically trace user operations, currently only supports user startup and click operations, default is false.
rumEnableTraceUserView bool Whether to automatically trace user page operations, default is false.
rumEnableTraceUserResource bool Whether to automatically trace user page operations, default is false.
rumEnableResourceHostIP bool Whether to collect the IP address of the requested target domain. Scope: only affects the default collection when enableUserResource is true. iOS: supported on >= iOS 13. Android: for a single Okhttp, there is an IP cache mechanism for the same domain, and under the premise that the IP connected to the server does not change, it will only generate once for the same OkhttpClient.
rumEnableTrackAppUIBlock bool Whether to enable ANR detection, default is false.
rumBlockDurationMs int Whether to enable UI lag detection, default is false, ft-sdk 1.6.4 and above versions can control the detection time range [100,∞) via blockDurationMs, unit milliseconds, default is 1 second.
rumEnableTrackAppCrash bool Whether to automatically trace user operations, currently only supports user startup and click operations, default is false.
rumEnableTrackAppANR bool Whether to enable ANR detection, default is false.
rumEnableTraceWebView bool Whether to enable webview data monitoring, default is false.
rumAllowWebViewHost string json array Configures the allowed webview host addresses for data tracking, default does not filter. 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, default 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 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 http trace, currently only supports automatic tracking for OKhttp, default is false.
traceType string Sets the tracing type, default is ddTrace, zipkinMultiHeader, zipkinSingleHeader, traceparent, skywalking, 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 the session is not sampled by setSampleRate, if an error occurs during the session, data from the previous 1-minute range can be collected, range [0,1], 0 means no collection, 1 means full collection, default value is 0.

Hot Reload: Can take effect immediately after dynamic configuration synchronization without reinitializing the SDK, mainly for throttling scenarios. Delete Configuration: Requires next startup to take effect. Parameter Format Configuration Error: If parameters are not set according to the corresponding data types or parsing errors occur, they will be considered invalid configurations and have no effect.