DatadogRum class

Available extensions

Properties

contextInjectionSetting TraceContextInjection

Available on DatadogRum, provided by the DatadogRumInternal extension

no setter
hashCode int
The hash code for this object.
no setterinherited
logger InternalLogger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
traceSampleRate double
The sample rate for tracing resources.
final

Methods

addAction(RumActionType type, String name, [Map<String, Object?> attributes = const {}]) → void
Register the occurrence of a User Action.
addAttribute(String key, Object? value) → void
Adds a custom attribute with key and value to all future events sent by the RUM monitor. Note that value must be supported by StandardMessageCodec. Passing a value of null is the same as calling removeAttribute
addError(Object error, RumErrorSource source, {StackTrace? stackTrace, String? errorType, Map<String, Object?> attributes = const {}}) → void
Notifies that the Exception or Error error occurred in currently presented View, with an origin of source. You can optionally set additional attributes for this error, an errorType and a stackTrace
addErrorInfo(String message, RumErrorSource source, {StackTrace? stackTrace, String? errorType, Map<String, Object?> attributes = const {}}) → void
Notifies that an error occurred in currently presented View, with the supplied message and with an origin of source. You can optionally supply a stackTrace, errorType, and send additional attributes for this error
addFeatureFlagEvaluation(String name, Object value) → void
Adds the result of evaluating a feature flag with a given name and value to the view. Feature flag evaluations are local to the active view and are cleared when the view is stopped
addTiming(String name) → void
Adds a specific timing named name in the currently presented View. The timing duration will be computed as the number of nanoseconds between the time the View was started and the time the timing was added.
addViewAttribute(String key, Object? value) → void
Adds a custom attribute with key and value to the current view. Note that value must be supported by StandardMessageCodec. Passing a value of null is the same as calling removeViewAttribute
addViewAttributes(Map<String, Object?> attributes) → void
Adds a collection of custom attributes to the current view. Note that values in this map must be supported by StandardMessageCodec.
addViewLoadingTime({bool override = false}) → void
Adds view loading time to current RUM view based on the time elapsed since the view was started. If this method is called multiple times, only the first timing is used, unless overwrite is set to true. If overwrite is true, the new load timing overwrites any previous value.
failFeatureOperation(String name, RumFeatureOperationFailureReason failureReason, {String? operationKey, Map<String, Object?> attributes = const {}}) → void
Finishes a feature operation with the given name with a failure status and the given failureReason.
getCurrentSessionId() Future<String?>
Get the current active session ID. The session ID will be null if no session is active or if the session has been sampled out.
handleFlutterError(FlutterErrorDetails details) → void
Send a Flutter error to RUM. This is used in conjunction with FlutterError.onError by doing the following during initialization
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String key) → void
Removes the custom attribute key from all future events sent by the RUM monitor. Events created prior to this call will not lose this attribute.
removeViewAttribute(String key) → void
Removes the custom attribute key from the current view. Events created prior to this call will not lose this attribute.
removeViewAttributes(List<String> keys) → void
Removes all custom attributes with the supplied keys from the current view. Events created prior to this call will not lose this attribute.
shouldSampleTrace(String? sessionId, TracingId traceId) bool
Uses the configured DatadogRumConfiguration.traceSampleRate to determine if a sample should be traced.
startAction(RumActionType type, String name, [Map<String, Object?> attributes = const {}]) → void
Notifies that a User Action of type has started, named name. This is used to track long running user actions (e.g. "scroll"). Such an User Action must be stopped with stopAction, and will be stopped automatically if it lasts for more than 10 seconds. You can optionally provide custom attributes.
startFeatureOperation(String name, {String? operationKey, Map<String, Object?> attributes = const {}}) → void
Starts a feature operation with the given name.
startResource(String key, RumHttpMethod httpMethod, String url, [Map<String, Object?> attributes = const {}]) → void
Notifies that the a Resource identified by key started being loaded from given url using the specified httpMethod. The supplied custom attributes will be attached to this Resource.
startView(String key, [String? name, Map<String, Object?> attributes = const {}]) → void
Notifies that the View identified by key starts being presented to the user. This view will show as name in the RUM explorer, and defaults to key if it is not provided. You can also attach custom attributes, who's values must be supported by StandardMessageCodec.
stopAction(RumActionType type, String name, [Map<String, Object?> attributes = const {}]) → void
Notifies that the User Action of type, named name has stopped. This is used to stop tracking long running user actions (e.g. "scroll"), started with startAction.
stopResource(String key, int? statusCode, RumResourceType kind, [int? size, Map<String, Object?> attributes = const {}]) → void
Notifies that the Resource identified by key stopped being loaded successfully and supplies additional information about the Resource loaded, including its kind, the statusCode of the response, the size of the Resource, and any other custom attributes to attach to the resource.
stopResourceWithError(String key, Exception error, [Map<String, Object?> attributes = const {}]) → void
Notifies that the Resource identified by key stopped being loaded with an Exception specified by error. You can optionally supply custom attributes to attach to this Resource.
stopResourceWithErrorInfo(String key, String message, String type, [Map<String, Object?> attributes = const {}]) → void
Notifies that the Resource identified by key stopped being loaded with the supplied message. You can optionally supply custom attributes to attach to this Resource.
stopSession() → void
Stops the current session. A new session will start in response to a call to startView, addAction, or startAction. If the session is started because of a call to addAction or startAction, the last know view is restarted in the new session.
stopView(String key, [Map<String, Object?> attributes = const {}]) → void
Notifies that the View identified by key stops being presented to the user. You can also attach custom attributes, who's values must be supported by StandardMessageCodec.
succeedFeatureOperation(String name, {String? operationKey, Map<String, Object?> attributes = const {}}) → void
Finishes a feature operation with the given name with a successful status.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

enable(DatadogSdk core, DatadogRumConfiguration configuration) Future<DatadogRum?>