-
public final class RumConfiguration.BuilderA Builder class for a RumConfiguration.
-
-
Constructor Summary
Constructors Constructor Description RumConfiguration.Builder(String applicationId)
-
Method Summary
Modifier and Type Method Description final RumConfiguration.BuildersetSessionSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)Sets the sample rate for RUM Sessions. final RumConfiguration.BuildersetTelemetrySampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)Sets the sample rate for Internal Telemetry (info related to the work of the SDK internals). final RumConfiguration.BuildertrackUserInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders, InteractionPredicate interactionPredicate)Enable the user interaction automatic tracker. final RumConfiguration.BuildertrackUserInteractions(Array<ViewAttributesProvider> touchTargetExtraAttributesProviders)Enable the user interaction automatic tracker. final RumConfiguration.BuildertrackUserInteractions()Enable the user interaction automatic tracker. final RumConfiguration.BuilderdisableUserInteractionTracking()Disable the user interaction automatic tracker. final RumConfiguration.BuilderuseViewTrackingStrategy(ViewTrackingStrategy strategy)Sets the automatic view tracking strategy used by the SDK. final RumConfiguration.BuildertrackLongTasks(Long longTaskThresholdMs)Enable long operations on the main thread to be tracked automatically. final RumConfiguration.BuildertrackLongTasks()Enable long operations on the main thread to be tracked automatically. final RumConfiguration.BuildertrackNonFatalAnrs(Boolean enabled)Enable tracking of non-fatal ANRs. final RumConfiguration.BuildersetViewEventMapper(ViewEventMapper eventMapper)Sets the ViewEventMapper for the RUM ViewEvent. final RumConfiguration.BuildersetResourceEventMapper(EventMapper<ResourceEvent> eventMapper)Sets the EventMapper for the RUM ResourceEvent. final RumConfiguration.BuildersetActionEventMapper(EventMapper<ActionEvent> eventMapper)Sets the EventMapper for the RUM ActionEvent. final RumConfiguration.BuildersetErrorEventMapper(EventMapper<ErrorEvent> eventMapper)Sets the EventMapper for the RUM ErrorEvent. final RumConfiguration.BuildersetLongTaskEventMapper(EventMapper<LongTaskEvent> eventMapper)Sets the EventMapper for the RUM LongTaskEvent. final RumConfiguration.BuildertrackBackgroundEvents(Boolean enabled)Enables/Disables tracking RUM event when no Activity is in foreground. final RumConfiguration.BuildertrackFrustrations(Boolean enabled)Enables/Disables tracking of frustration signals. final RumConfiguration.BuildersetVitalsUpdateFrequency(VitalsUpdateFrequency frequency)Allows to specify the frequency at which to update the mobile vitals data provided in the RUM ViewEvent. final RumConfiguration.BuilderuseCustomEndpoint(String endpoint)Let the RUM feature target a custom server. final RumConfiguration.BuildersetSessionListener(RumSessionListener sessionListener)Sets the Session listener. final RumConfiguration.BuildersetInitialResourceIdentifier(InitialResourceIdentifier initialResourceIdentifier)Sets a custom identifier for initial network resources used to compute the time to network settled in a RUM View event. final RumConfiguration.BuildersetLastInteractionIdentifier(LastInteractionIdentifier lastInteractionIdentifier)Sets a custom identifier for the last interaction in the previous view used to compute the time from the last interaction to the next view metric. final RumConfigurationbuild()Builds a RumConfiguration based on the current state of this Builder. -
-
Constructor Detail
-
RumConfiguration.Builder
RumConfiguration.Builder(String applicationId)
- Parameters:
applicationId- your applicationId for RUM events
-
-
Method Detail
-
setSessionSampleRate
final RumConfiguration.Builder setSessionSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)
Sets the sample rate for RUM Sessions.
- Parameters:
sampleRate- the sample rate must be a value between 0 and 100.
-
setTelemetrySampleRate
final RumConfiguration.Builder setTelemetrySampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)
Sets the sample rate for Internal Telemetry (info related to the work of the SDK internals). Default value is 20.
- Parameters:
sampleRate- the sample rate must be a value between 0 and 100.
-
trackUserInteractions
@JvmOverloads() final RumConfiguration.Builder trackUserInteractions(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.
-
trackUserInteractions
@JvmOverloads() final RumConfiguration.Builder trackUserInteractions(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.
-
trackUserInteractions
@JvmOverloads() final RumConfiguration.Builder trackUserInteractions()
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.
-
disableUserInteractionTracking
final RumConfiguration.Builder disableUserInteractionTracking()
Disable the user interaction automatic tracker.
-
useViewTrackingStrategy
final RumConfiguration.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.
-
trackLongTasks
@JvmOverloads() final RumConfiguration.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
@JvmOverloads() final RumConfiguration.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
-
trackNonFatalAnrs
final RumConfiguration.Builder trackNonFatalAnrs(Boolean enabled)
Enable tracking of non-fatal ANRs. This is enabled by default on Android API 29 and below, and disabled by default on Android API 30 and above. Android API 30+ has a capability to report fatal ANRs (always enabled). Please note, that tracking non-fatal ANRs is using Watchdog thread approach, which can be noisy, and also leads to ANR duplication on Android 30+ if fatal ANR happened, because Watchdog thread approach cannot categorize ANR as fatal or non-fatal.
- Parameters:
enabled- whether tracking of non-fatal ANRs is enabled or not.
-
setViewEventMapper
final RumConfiguration.Builder setViewEventMapper(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.
-
setResourceEventMapper
final RumConfiguration.Builder setResourceEventMapper(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.
-
setActionEventMapper
final RumConfiguration.Builder setActionEventMapper(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.
-
setErrorEventMapper
final RumConfiguration.Builder setErrorEventMapper(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.
-
setLongTaskEventMapper
final RumConfiguration.Builder setLongTaskEventMapper(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.
-
trackBackgroundEvents
final RumConfiguration.Builder trackBackgroundEvents(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 RumConfiguration.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.
-
setVitalsUpdateFrequency
final RumConfiguration.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
-
useCustomEndpoint
final RumConfiguration.Builder useCustomEndpoint(String endpoint)
Let the RUM feature target a custom server.
-
setSessionListener
final RumConfiguration.Builder setSessionListener(RumSessionListener sessionListener)
Sets the Session listener.
- Parameters:
sessionListener- the listener to notify whenever a new Session starts.
-
setInitialResourceIdentifier
final RumConfiguration.Builder setInitialResourceIdentifier(InitialResourceIdentifier initialResourceIdentifier)
Sets a custom identifier for initial network resources used to compute the time to network settled in a RUM View event. By default, the SDK uses a TimeBasedInitialResourceIdentifier with a threshold of 100ms.
- Parameters:
initialResourceIdentifier- the InitialResourceIdentifier to use.
-
setLastInteractionIdentifier
final RumConfiguration.Builder setLastInteractionIdentifier(LastInteractionIdentifier lastInteractionIdentifier)
Sets a custom identifier for the last interaction in the previous view used to compute the time from the last interaction to the next view metric. By default, the SDK uses a TimeBasedInteractionIdentifier with a threshold of 3000ms.
- Parameters:
lastInteractionIdentifier- the LastInteractionIdentifier to use.
-
build
final RumConfiguration build()
Builds a RumConfiguration based on the current state of this Builder.
-
-
-
-