-
public final class Configuration.BuilderA Builder class for a Configuration.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanlogsEnabledprivate final BooleantracesEnabledprivate final BooleancrashReportsEnabledprivate final BooleanrumEnabled
-
Constructor Summary
Constructors Constructor Description Configuration.Builder(Boolean logsEnabled, Boolean tracesEnabled, Boolean crashReportsEnabled, Boolean rumEnabled)
-
Method Summary
Modifier and Type Method Description final BooleangetLogsEnabled()final BooleangetTracesEnabled()final BooleangetCrashReportsEnabled()final BooleangetRumEnabled()final Configurationbuild()Builds a Configuration based on the current state of this Builder. final Configuration.BuildersetUseDeveloperModeWhenDebuggable(Boolean developerModeEnabled)Sets the DataDog SDK to be more verbose when an application is set to debuggable.final Configuration.BuildersetFirstPartyHosts(List<String> hosts)Sets the list of first party hosts. final Configuration.BuildersetFirstPartyHostsWithHeaderType(Map<String, Set<TracingHeaderType>> hostsWithHeaderType)Sets the list of first party hosts and specifies the type of HTTP headers used for distributed tracing. final Configuration.BuildersetWebViewTrackingHosts(List<String> hosts)Sets the list of WebView tracked hosts. final Configuration.BuilderuseSite(DatadogSite site)Let the SDK target your preferred Datadog's site. final Configuration.BuilderuseCustomLogsEndpoint(String endpoint)Let the SDK target a custom server for the logs feature. final Configuration.BuilderuseCustomTracesEndpoint(String endpoint)Let the SDK target a custom server for the tracing feature. final Configuration.BuilderuseCustomCrashReportsEndpoint(String endpoint)Let the SDK target a custom server for the crash reports feature. final Configuration.BuilderuseCustomRumEndpoint(String endpoint)Let the SDK target a custom server for the RUM feature. final Configuration.BuildertrackInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders, InteractionPredicate interactionPredicate)Enable the user interaction automatic tracker. final Configuration.BuildertrackInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders)Enable the user interaction automatic tracker. final Configuration.BuildertrackInteractions()Enable the user interaction automatic tracker. final Configuration.BuilderdisableInteractionTracking()Disable the user interaction automatic tracker. final Configuration.BuildertrackLongTasks(Long longTaskThresholdMs)Enable long operations on the main thread to be tracked automatically. final Configuration.BuildertrackLongTasks()Enable long operations on the main thread to be tracked automatically. final Configuration.BuilderuseViewTrackingStrategy(ViewTrackingStrategy strategy)Sets the automatic view tracking strategy used by the SDK. final Configuration.BuilderaddPlugin(DatadogPlugin plugin, Feature feature)Adds a plugin to a specific feature. final Configuration.BuildersetBatchSize(BatchSize batchSize)Defines the batch size (impacts the size and number of requests performed by Datadog). final Configuration.BuildersetUploadFrequency(UploadFrequency uploadFrequency)Defines the preferred upload frequency. final Configuration.BuildersampleRumSessions(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate)Sets the sampling rate for RUM Sessions. final Configuration.BuildersampleTelemetry(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate)Sets the sampling rate for Internal Telemetry (info related to the work of the SDK internals). final Configuration.BuildertrackBackgroundRumEvents(Boolean enabled)Enables/Disables tracking RUM event when no Activity is in foreground. final Configuration.BuildertrackFrustrations(Boolean enabled)Enables/Disables tracking of frustration signals. final Configuration.BuildersetRumViewEventMapper(ViewEventMapper eventMapper)Sets the ViewEventMapper for the RUM ViewEvent. final Configuration.BuildersetRumResourceEventMapper(EventMapper<ResourceEvent> eventMapper)Sets the EventMapper for the RUM ResourceEvent. final Configuration.BuildersetRumActionEventMapper(EventMapper<ActionEvent> eventMapper)Sets the EventMapper for the RUM ActionEvent. final Configuration.BuildersetRumErrorEventMapper(EventMapper<ErrorEvent> eventMapper)Sets the EventMapper for the RUM ErrorEvent. final Configuration.BuildersetRumLongTaskEventMapper(EventMapper<LongTaskEvent> eventMapper)Sets the EventMapper for the RUM LongTaskEvent. final Configuration.BuildersetSpanEventMapper(SpanEventMapper eventMapper)Sets the SpanEventMapper for the Trace com.datadog.android.tracing.model.SpanEvent. final Configuration.BuildersetLogEventMapper(EventMapper<LogEvent> eventMapper)Sets the EventMapper for the LogEvent. final Configuration.BuildersetAdditionalConfiguration(Map<String, Object> additionalConfig)Allows to provide additional configuration values which can be used by the SDK. final Configuration.BuildersetProxy(Proxy proxy, Authenticator authenticator)Enables a custom proxy for uploading tracked data to Datadog's intake. final Configuration.BuildersetEncryption(Encryption dataEncryption)Allows to set the encryption for the local data. final Configuration.BuildersetVitalsUpdateFrequency(VitalsUpdateFrequency frequency)Allows to specify the frequency at which to update the mobile vitals data provided in the RUM ViewEvent. -
-
Constructor Detail
-
Configuration.Builder
Configuration.Builder(Boolean logsEnabled, Boolean tracesEnabled, Boolean crashReportsEnabled, Boolean rumEnabled)
- Parameters:
logsEnabled- whether Logs are tracked and sent to DatadogtracesEnabled- whether Spans are tracked and sent to DatadogcrashReportsEnabled- whether crashes are tracked and sent to DatadogrumEnabled- whether RUM events are tracked and sent to Datadog
-
-
Method Detail
-
getLogsEnabled
final Boolean getLogsEnabled()
-
getTracesEnabled
final Boolean getTracesEnabled()
-
getCrashReportsEnabled
final Boolean getCrashReportsEnabled()
-
getRumEnabled
final Boolean getRumEnabled()
-
build
final Configuration build()
Builds a Configuration based on the current state of this Builder.
-
setUseDeveloperModeWhenDebuggable
final Configuration.Builder setUseDeveloperModeWhenDebuggable(Boolean developerModeEnabled)
Sets the DataDog SDK to be more verbose when an application is set to
debuggable. This is equivalent to setting: sampleRumSessions(100) setBatchSize(BatchSize.SMALL) setUploadFrequency(UploadFrequency.FREQUENT) Datadog.setVerbosity(Log.VERBOSE) These settings will override your configuration, but only when the application isdebuggable- Parameters:
developerModeEnabled- Enable or disable extra debug info when an app is debuggable
-
setFirstPartyHosts
final Configuration.Builder setFirstPartyHosts(List<String> hosts)
Sets the list of first party hosts. Requests made to a URL with any one of these hosts (or any subdomain) will:
be considered a first party resource and categorised as such in your RUM dashboard;
be wrapped in a Span and have DataDog trace id injected to get a full flame-graph in APM.
- Parameters:
hosts- a list of all the hosts that you own.
-
setFirstPartyHostsWithHeaderType
final Configuration.Builder setFirstPartyHostsWithHeaderType(Map<String, Set<TracingHeaderType>> hostsWithHeaderType)
Sets the list of first party hosts and specifies the type of HTTP headers used for distributed tracing. Requests made to a URL with any one of these hosts (or any subdomain) will:
be considered a first party resource and categorised as such in your RUM dashboard;
be wrapped in a Span and have trace id of the specified types injected to get a full flame-graph in APM. Multiple header types are supported for each host.
- Parameters:
hostsWithHeaderType- a list of all the hosts that you own and the tracing headers to be used for each host.
-
setWebViewTrackingHosts
final Configuration.Builder setWebViewTrackingHosts(List<String> hosts)
Sets the list of WebView tracked hosts. When a WebView loads a URL from any of these hosts, and the page has Datadog's Browser SDK setup, then the Logs and RUM Events from the webview will be tracked in the same session..
- Parameters:
hosts- a list of all the hosts that you want to track when loaded in the WebView.
-
useSite
final Configuration.Builder useSite(DatadogSite site)
Let the SDK target your preferred Datadog's site.
-
useCustomLogsEndpoint
final Configuration.Builder useCustomLogsEndpoint(String endpoint)
Let the SDK target a custom server for the logs feature.
-
useCustomTracesEndpoint
final Configuration.Builder useCustomTracesEndpoint(String endpoint)
Let the SDK target a custom server for the tracing feature.
-
useCustomCrashReportsEndpoint
final Configuration.Builder useCustomCrashReportsEndpoint(String endpoint)
Let the SDK target a custom server for the crash reports feature.
-
useCustomRumEndpoint
final Configuration.Builder useCustomRumEndpoint(String endpoint)
Let the SDK target a custom server for the RUM feature.
-
trackInteractions
final Configuration.Builder trackInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders, InteractionPredicate interactionPredicate)
Enable the user interaction automatic tracker. By enabling this feature the SDK will intercept UI interaction events (e.g.: taps, scrolls, swipes) and automatically send those as RUM UserActions for you.
- Parameters:
touchTargetExtraAttributesProviders- an array with your own implementation of the target attributes provider.interactionPredicate- an interface to provide custom values for the actions events properties.
-
trackInteractions
final Configuration.Builder trackInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders)
Enable the user interaction automatic tracker. By enabling this feature the SDK will intercept UI interaction events (e.g.: taps, scrolls, swipes) and automatically send those as RUM UserActions for you.
- Parameters:
touchTargetExtraAttributesProviders- an array with your own implementation of the target attributes provider.
-
trackInteractions
final Configuration.Builder trackInteractions()
Enable the user interaction automatic tracker. By enabling this feature the SDK will intercept UI interaction events (e.g.: taps, scrolls, swipes) and automatically send those as RUM UserActions for you.
-
disableInteractionTracking
final Configuration.Builder disableInteractionTracking()
Disable the user interaction automatic tracker.
-
trackLongTasks
final Configuration.Builder trackLongTasks(Long longTaskThresholdMs)
Enable long operations on the main thread to be tracked automatically. Any long running operation on the main thread will appear as Long Tasks in Datadog RUM Explorer
- Parameters:
longTaskThresholdMs- the threshold in milliseconds above which a task running on the Main thread Looper is considered as a long task (default 100ms).
-
trackLongTasks
final Configuration.Builder trackLongTasks()
Enable long operations on the main thread to be tracked automatically. Any long running operation on the main thread will appear as Long Tasks in Datadog RUM Explorer
-
useViewTrackingStrategy
final Configuration.Builder useViewTrackingStrategy(ViewTrackingStrategy strategy)
Sets the automatic view tracking strategy used by the SDK. By default ActivityViewTrackingStrategy will be used.
- Parameters:
strategy- as the ViewTrackingStrategy Note: If null is passed, the RUM Monitor will let you handle View events manually.
-
addPlugin
final Configuration.Builder addPlugin(DatadogPlugin plugin, Feature feature)
Adds a plugin to a specific feature. This plugin will only be registered if the feature was enabled.
- Parameters:
plugin- a DatadogPluginfeature- the feature for which this plugin should be registered
-
setBatchSize
final Configuration.Builder setBatchSize(BatchSize batchSize)
Defines the batch size (impacts the size and number of requests performed by Datadog).
- Parameters:
batchSize- the desired batch size
-
setUploadFrequency
final Configuration.Builder setUploadFrequency(UploadFrequency uploadFrequency)
Defines the preferred upload frequency.
- Parameters:
uploadFrequency- the desired upload frequency policy
-
sampleRumSessions
final Configuration.Builder sampleRumSessions(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate)
Sets the sampling rate for RUM Sessions.
- Parameters:
samplingRate- the sampling rate must be a value between 0 and 100.
-
sampleTelemetry
final Configuration.Builder sampleTelemetry(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate)
Sets the sampling rate for Internal Telemetry (info related to the work of the SDK internals). Default value is 20.
- Parameters:
samplingRate- the sampling rate must be a value between 0 and 100.
-
trackBackgroundRumEvents
final Configuration.Builder trackBackgroundRumEvents(Boolean enabled)
Enables/Disables tracking RUM event when no Activity is in foreground.
By default, background events are not tracked. Enabling this feature might increase the number of sessions tracked and impact your billing.
- Parameters:
enabled- whether background events should be tracked in RUM.
-
trackFrustrations
final Configuration.Builder trackFrustrations(Boolean enabled)
Enables/Disables tracking of frustration signals.
By default frustration signals are tracked. Currently the SDK supports detecting error taps which occur when an error follows a user action tap.
- Parameters:
enabled- whether frustration signals should be tracked in RUM.
-
setRumViewEventMapper
final Configuration.Builder setRumViewEventMapper(ViewEventMapper eventMapper)
Sets the ViewEventMapper for the RUM ViewEvent. You can use this interface implementation to modify the ViewEvent attributes before serialisation.
- Parameters:
eventMapper- the ViewEventMapper implementation.
-
setRumResourceEventMapper
final Configuration.Builder setRumResourceEventMapper(EventMapper<ResourceEvent> eventMapper)
Sets the EventMapper for the RUM ResourceEvent. You can use this interface implementation to modify the ResourceEvent attributes before serialisation.
- Parameters:
eventMapper- the EventMapper implementation.
-
setRumActionEventMapper
final Configuration.Builder setRumActionEventMapper(EventMapper<ActionEvent> eventMapper)
Sets the EventMapper for the RUM ActionEvent. You can use this interface implementation to modify the ActionEvent attributes before serialisation.
- Parameters:
eventMapper- the EventMapper implementation.
-
setRumErrorEventMapper
final Configuration.Builder setRumErrorEventMapper(EventMapper<ErrorEvent> eventMapper)
Sets the EventMapper for the RUM ErrorEvent. You can use this interface implementation to modify the ErrorEvent attributes before serialisation.
- Parameters:
eventMapper- the EventMapper implementation.
-
setRumLongTaskEventMapper
final Configuration.Builder setRumLongTaskEventMapper(EventMapper<LongTaskEvent> eventMapper)
Sets the EventMapper for the RUM LongTaskEvent. You can use this interface implementation to modify the LongTaskEvent attributes before serialisation.
- Parameters:
eventMapper- the EventMapper implementation.
-
setSpanEventMapper
final Configuration.Builder setSpanEventMapper(SpanEventMapper eventMapper)
Sets the SpanEventMapper for the Trace com.datadog.android.tracing.model.SpanEvent. You can use this interface implementation to modify the com.datadog.android.tracing.model.SpanEvent attributes before serialisation.
- Parameters:
eventMapper- the SpanEventMapper implementation.
-
setLogEventMapper
final Configuration.Builder setLogEventMapper(EventMapper<LogEvent> eventMapper)
Sets the EventMapper for the LogEvent. You can use this interface implementation to modify the LogEvent attributes before serialisation.
- Parameters:
eventMapper- the EventMapper implementation.
-
setAdditionalConfiguration
final Configuration.Builder setAdditionalConfiguration(Map<String, Object> additionalConfig)
Allows to provide additional configuration values which can be used by the SDK.
- Parameters:
additionalConfig- Additional configuration values.
-
setProxy
final Configuration.Builder setProxy(Proxy proxy, Authenticator authenticator)
Enables a custom proxy for uploading tracked data to Datadog's intake.
- Parameters:
proxy- the Proxy configurationauthenticator- the optional Authenticator for the proxy
-
setEncryption
final Configuration.Builder setEncryption(Encryption dataEncryption)
Allows to set the encryption for the local data. By default no encryption is used for the local data.
- Parameters:
dataEncryption- An encryption object complying Encryption interface.
-
setVitalsUpdateFrequency
final Configuration.Builder setVitalsUpdateFrequency(VitalsUpdateFrequency frequency)
Allows to specify the frequency at which to update the mobile vitals data provided in the RUM ViewEvent.
- Parameters:
frequency- as VitalsUpdateFrequency
-
-
-
-