-
public interface RumMonitorA class enabling Datadog RUM features.
It allows you to record User events that can be explored and analyzed in Datadog Dashboards.
You can only have one active RumMonitor, and should register/retrieve it from the GlobalRum object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classRumMonitor.BuilderA Builder class for a RumMonitor.
-
Method Summary
Modifier and Type Method Description abstract UnitstartView(Object key, String name, Map<String, Object> attributes)Notifies that a View is being shown to the user, linked with the key instance. abstract UnitstopView(Object key, Map<String, Object> attributes)Stops a previously started View, linked with the key instance. abstract UnitaddUserAction(RumActionType type, String name, Map<String, Object> attributes)Notifies that a User Action happened. abstract UnitstartUserAction(RumActionType type, String name, Map<String, Object> attributes)Notifies that a User Action started. abstract UnitstopUserAction(RumActionType type, String name, Map<String, Object> attributes)Notifies that a User Action stopped, and update the action's type and name. abstract UnitstartResource(String key, String method, String url, Map<String, Object> attributes)Notify that a new Resource is being loaded, linked with the key instance. abstract UnitstopResource(String key, Integer statusCode, Long size, RumResourceKind kind, Map<String, Object> attributes)Stops a previously started Resource, linked with the key instance. abstract UnitstopResourceWithError(String key, Integer statusCode, String message, RumErrorSource source, Throwable throwable, Map<String, Object> attributes)Stops a previously started Resource that failed loading, linked with the key instance. abstract UnitstopResourceWithError(String key, Integer statusCode, String message, RumErrorSource source, String stackTrace, String errorType, Map<String, Object> attributes)Stops a previously started Resource that failed loading, linked with the key instance by providing the intercepted stacktrace. abstract UnitaddError(String message, RumErrorSource source, Throwable throwable, Map<String, Object> attributes)Notifies that an error occurred in the active View. abstract UnitaddErrorWithStacktrace(String message, RumErrorSource source, String stacktrace, Map<String, Object> attributes)Notifies that an error occurred in the active View. abstract UnitaddTiming(String name)Adds a specific timing in the active View. abstract UnitaddFeatureFlagEvaluation(String name, Object value)Adds result of evaluating a feature flag to the view. abstract UnitstopSession()Stops the current session. abstract _RumInternalProxy_getInternal()For Datadog internal use only. -
-
Method Detail
-
startView
abstract Unit startView(Object key, String name, Map<String, Object> attributes)
Notifies that a View is being shown to the user, linked with the key instance.
-
stopView
abstract Unit stopView(Object key, Map<String, Object> attributes)
Stops a previously started View, linked with the key instance.
-
addUserAction
abstract Unit addUserAction(RumActionType type, String name, Map<String, Object> attributes)
Notifies that a User Action happened. This is used to track discrete user actions (e.g.: tap).
- Parameters:
type- the action typename- the action identifierattributes- additional custom attributes to attach to the action.
-
startUserAction
abstract Unit startUserAction(RumActionType type, String name, Map<String, Object> attributes)
Notifies that a User Action started. This is used to track long running user actions (e.g.: scroll). Such a user action must be stopped with stopUserAction, and will be stopped automatically if it lasts more than 10 seconds.
- Parameters:
type- the action typename- the action identifierattributes- additional custom attributes to attach to the action.
-
stopUserAction
abstract Unit stopUserAction(RumActionType type, String name, Map<String, Object> attributes)
Notifies that a User Action stopped, and update the action's type and name. This is used to stop tracking long running user actions (e.g.: scroll), started with startUserAction.
- Parameters:
type- the action type (overriding the last started action)name- the action identifier (overriding the last started action)attributes- additional custom attributes to attach to the action.
-
startResource
abstract Unit startResource(String key, String method, String url, Map<String, Object> attributes)
Notify that a new Resource is being loaded, linked with the key instance.
- Parameters:
key- the instance that represents the resource being loaded (usually your request or network call instance).method- the method used to load the resource (E.g.url- the url or local path of the resource being loadedattributes- additional custom attributes to attach to the resource.
-
stopResource
abstract Unit stopResource(String key, Integer statusCode, Long size, RumResourceKind kind, Map<String, Object> attributes)
Stops a previously started Resource, linked with the key instance.
- Parameters:
key- the instance that represents the active view (usually your request or network call instance).statusCode- the status code of the resource (if any)size- the size of the resource, in byteskind- the type of resource loadedattributes- additional custom attributes to attach to the resource.
-
stopResourceWithError
abstract Unit stopResourceWithError(String key, Integer statusCode, String message, RumErrorSource source, Throwable throwable, Map<String, Object> attributes)
Stops a previously started Resource that failed loading, linked with the key instance.
- Parameters:
key- the instance that represents the active view (usually your request or network call instance).statusCode- the status code of the resource (if any)message- a message explaining the errorsource- the source of the errorthrowable- the throwableattributes- additional custom attributes to attach to the error.
-
stopResourceWithError
abstract Unit stopResourceWithError(String key, Integer statusCode, String message, RumErrorSource source, String stackTrace, String errorType, Map<String, Object> attributes)
Stops a previously started Resource that failed loading, linked with the key instance by providing the intercepted stacktrace. Note: This method should only be used from hybrid application.
- Parameters:
key- the instance that represents the active view (usually your request or network call instance).statusCode- the status code of the resource (if any)message- a message explaining the errorsource- the source of the errorstackTrace- the error stacktraceerrorType- the type of the error.attributes- additional custom attributes to attach to the error.
-
addError
abstract Unit addError(String message, RumErrorSource source, Throwable throwable, Map<String, Object> attributes)
Notifies that an error occurred in the active View.
- Parameters:
message- a message explaining the errorsource- the source of the errorthrowable- the throwableattributes- additional custom attributes to attach to the error.
-
addErrorWithStacktrace
abstract Unit addErrorWithStacktrace(String message, RumErrorSource source, String stacktrace, Map<String, Object> attributes)
Notifies that an error occurred in the active View.
This method is meant for non-native or cross platform frameworks (such as React Native or Flutter) to send error information to Datadog. Although it can be used directly, it is recommended to pass a Throwable instead.
- Parameters:
message- a message explaining the errorsource- the source of the errorstacktrace- the error stacktrace informationattributes- additional custom attributes to attach to the error
-
addTiming
abstract Unit addTiming(String name)
Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
- Parameters:
name- the name of the new custom timing attribute.
-
addFeatureFlagEvaluation
abstract Unit addFeatureFlagEvaluation(String name, Object value)
Adds result of evaluating a feature flag to the view. Feature flag evaluations are local to the active view and are cleared when the view is stopped.
- Parameters:
name- the name of the feature flagvalue- the value the feature flag evaluated to
-
stopSession
abstract Unit stopSession()
Stops the current session. A new session will start in response to a call to
startView,addUserAction, orstartUserAction. If the session is started because of a call toaddUserAction, orstartUserAction, the last know view is restarted in the new session.
-
_getInternal
abstract _RumInternalProxy _getInternal()
For Datadog internal use only.
-
-
-
-