---
title: Operations Monitoring
description: >-
  Monitor critical technical operations within user-facing features to identify
  exactly when and why users fail to complete key workflows.
breadcrumbs: Docs > RUM & Session Replay > Operations Monitoring
---

# Operations Monitoring

{% callout %}
##### Join the Preview!

Operations Monitoring is in Preview.

[Request Access](https://www.datadoghq.com/product-preview/operations-monitoring/)
{% /callout %}

## Overview{% #overview %}

{% image
   source="https://datadog-docs.imgix.net/images/real_user_monitoring/operations_monitoring/operations-monitoring-overview-1.ab004694e0cc8ad4d0814e7d4e441f29.png?auto=format"
   alt="Operations tab under RUM > Performance Monitoring" /%}

In Datadog RUM, a feature represents a major user-facing area of your application like checkout, login, or search. Each feature includes operations, which are the critical technical steps that make the experience work.

- Business teams use **features** to track and improve user conversion.
- Engineering teams use **operations** to monitor and minimize technical failures that impact key user moments.

For example, the checkout experience of an e-commerce platform is a feature. Within it, operations might include entering payment details, saving a payment method, and completing a purchase. After the SDK has been instrumented, Datadog RUM measures each operation's performance, including execution volume, completion rate, and failure rate. Measuring operations' health enables you to identify exactly when and why users may not convert in your feature.

The following table shows additional example features and their associated feature operations by industry.

| Industry       | Feature  | Feature Operations                                                                                                   |
| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| Social network | Profile  | Users can load their profileUsers can upload a pictureUsers can update their status                                  |
| E-Commerce     | Checkout | Users can enter payment detailsUsers can save their payment methodUsers can pay                                      |
| Streaming      | Search   | Users can find results for their searchUsers can load the description of a titleUsers can start watching the trailer |
| CRM            | Quote    | Users can start a new quoteUsers can add line items to the quoteUsers can send a quote to recipients                 |

## Prerequisites{% #prerequisites %}

- [RUM without Limits](https://github.com/DataDog/dd-sdk-reactnative/releases/tag/3.0.0) must be enabled in your organization.
- Make sure you've downloaded a supported Datadog RUM SDK version with client-side APIs to define operations:
  - [Browser (6.20.0)](https://github.com/DataDog/browser-sdk/releases/tag/v6.20.0)
  - [Android (3.1.0)](https://github.com/DataDog/dd-sdk-android/releases/tag/3.1.0)
  - [iOS (3.1.0)](https://github.com/DataDog/dd-sdk-ios/releases/tag/3.1.0)
  - [Kotlin Multiplatform (1.4.0)](https://github.com/DataDog/dd-sdk-kotlin-multiplatform/releases/tag/1.4.0)
  - [React Native (3.0.0)](https://github.com/DataDog/dd-sdk-reactnative/releases/tag/3.0.0)
  - [Roku (1.4.0)](https://github.com/DataDog/dd-sdk-roku/releases/tag/1.4.0)

## Setup{% #setup %}

Use the SDK APIs to define your operations.

### Start an operation{% #start-an-operation %}

Every operation must be started by calling the `startFeatureOperation`.

{% tab title="Browser" %}

```javascript
DD_RUM.init({
...,
enableExperimentalFeatures: ["feature_operation_vital"], // you need to have this flag turned on for the API to work
})

startFeatureOperation: (
name: string,
options?: {
 operationKey?: string,
 context?: Context,
 description?: string,
}) => void
```

{% /tab %}

{% tab title="Android" %}

```kotlin
GlobalRumMonitor.get().startFeatureOperation(
	name: String,
	operationKey: String?,
	attributes: Map<String, Any?>
)
```

{% /tab %}

{% tab title="iOS" %}

```swift
RUMMonitor.shared().startFeatureOperation(
	name: String,
	operationKey: String?,
	attributes: [AttributeKey: AttributeValue]?
)
```

{% /tab %}

{% tab title="React Native" %}

```javascript
DdRum.startFeatureOperation(
	name: string,
	operationKey?: string,
	attributes?: Record<string, any>
)
```

{% /tab %}

{% tab title="Roku" %}

```
m.global.datadogRumAgent@.startOperation(
    name as string,
    operationKey = invalid as dynamic, ' optional: string or invalid for unkeyed operations
    context = {} as object             ' optional: AssocArray of custom attributes
)
```

{% /tab %}

{% alert level="warning" %}
The Operation's name cannot contain any whitespaces.
{% /alert %}

### Stop an operation with success{% #stop-an-operation-with-success %}

Every started operation must have a stop. Use `succeedFeatureOperation` to stop an operation with a successful outcome.

{% tab title="Browser" %}

```javascript
DD_RUM.init({
...,
enableExperimentalFeatures: ["feature_operation_vital"], // this flag needs to be enabled for the API to work
})

succeedFeatureOperation: (
name: string,
options?: {
 operationKey?: string,
 context?: Context,
 description?: string,
}) => void
```

{% /tab %}

{% tab title="Android" %}

```kotlin
GlobalRumMonitor.get().succeedFeatureOperation(
	name: String,
	operationKey: String?,
	attributes: Map<String, Any?>
)
```

{% /tab %}

{% tab title="iOS" %}

```swift
RUMMonitor.shared().succeedFeatureOperation(
	name: String,
	operationKey: String?,
	attributes: [AttributeKey: AttributeValue]?
)
```

{% /tab %}

{% tab title="React Native" %}

```javascript
DdRum.succeedFeatureOperation(
	name: string,
	operationKey?: string,
	attributes?: Record<string, any>
)
```

{% /tab %}

{% tab title="Roku" %}

```
m.global.datadogRumAgent@.succeedOperation(
    name as string,
    operationKey = invalid as dynamic, ' optional: string or invalid for unkeyed operations
    context = {} as object             ' optional: AssocArray of custom attributes
)
```

{% /tab %}

{% alert level="warning" %}
The `operationKey` must be the same in the start and end Operation event.
{% /alert %}

### Stop an operation with failure{% #stop-an-operation-with-failure %}

Every started operation must have a stop. Use `failFeatureOperation` to stop an operation with a failure outcome.

{% tab title="Browser" %}

```javascript
DD_RUM.init({
...,
enableExperimentalFeatures: ["feature_operation_vital"], // this flag needs to be enabled for the API to work
})

GlobalRumMonitor.get().failFeatureOperation: (
name: string, 
failureReason: FailureReason, //'error' | 'abandoned' | 'other'
options?: {
 operationKey?: string,
 context?: Context,
 description?: string,
}) => void
```

{% /tab %}

{% tab title="Android" %}

```kotlin
GlobalRumMonitor.get().failFeatureOperation(
	name: String,
	operationKey: String?,
	failureReason: RUMFeatureOperationFailureReason,	// .error, .abandoned, .other
	attributes: Map<String, Any?>
)
```

{% /tab %}

{% tab title="iOS" %}

```swift
RUMMonitor.shared().failFeatureOperation(
	name: String,
	operationKey: String?,
    reason: RUMFeatureOperationFailureReason,  // .error, .abandoned, .other
	attributes: [AttributeKey: AttributeValue]
)
```

{% /tab %}

{% tab title="Roku" %}

```
m.global.datadogRumAgent@.failOperation(
    name as string,
    failureReason as string,           ' "error", "abandoned", or "other"
    operationKey = invalid as dynamic, ' optional: string or invalid for unkeyed operations
    context = {} as object             ' optional: AssocArray of custom attributes
)
```

{% /tab %}

{% tab title="React Native" %}

```javascript
DdRum.failFeatureOperation(
	name: string,
	operationKey?: string,
	reason: FeatureOperationFailure, // 'ERROR' | 'ABANDONED' | 'OTHER'
	attributes: Record<string, any>
)
```

{% /tab %}

### Parallelization{% #parallelization %}

You may have cases where users are starting several feature operations in parallel. To individually track them, use the `operationKey` defined when calling `startFeatureOperation`. You must reuse the same `operationKey` later in other APIs, for example when calling `succeedFeatureOperation`.

{% alert level="warning" %}
Operations that have been started but not explicitly stopped are automatically terminated when the RUM session expires. Those are marked as failed, with `@operation.failure_reason:timeout`.If an operation stop API was called that was not started in the first place, the stop event emitted by the SDK is dropped upon ingestion.
{% /alert %}

## Monitor your availability on Datadog{% #monitor-your-availability-on-datadog %}

{% image
   source="https://datadog-docs.imgix.net/images/real_user_monitoring/operations_monitoring/operations-monitoring-catalog-1.16baaea5398fb39e2f25a8b9afa63f6e.png?auto=format"
   alt="Operations tab under RUM > Performance Monitoring" /%}

After you've configured the SDK APIs, you can monitor your operations by navigating to **RUM > Performance Monitoring > Operations**.

Datadog groups together all operations with the same name into a catalog.

Each operation has two out-of-the-box metrics computed over your full, ingested, unsampled traffic:

- `rum.measure.operation`, which counts the volume of operations reported to Datadog
- `rum.measure.operation.duration`, which measures the elapsed time between the start and end of all the operations reported to Datadog

Both metrics are retained for 15 months, and include several dimensions:

- `operation.name`, which is defined on the client side
- `operation.status`, which is either a success or failure
- `operation.failure_reason`, which can be an error, or abandoned, or other

Those metrics are included in the price of RUM Measure and available to all RUM without Limits customers that define one or more operations.

## Configure retention filters{% #configure-retention-filters %}

Operations are a new type of event in RUM. Operations are bound to a RUM Session, but can span across multiple RUM Views. Operations can be targeted in retention filters. This allows you to align your retention strategy on features that are cornerstones for your user experiences. For example, you can programmatically keep RUM Sessions that had specific operations fail or are taking longer than desired.

{% image
   source="https://datadog-docs.imgix.net/images/real_user_monitoring/operations_monitoring/operations-monitoring-3-temp.c484ccc9d7dfb300cf8866b708210baf.png?auto=format"
   alt="Operations tab under RUM > Performance Monitoring" /%}

Similarly to metrics, those events come with specific attributes you can use in retention filters:

- `@operation.name`
- `@operation.status`
- `@operation.failure_reason`
- `@operation.duration`
- `@operation.start_view.name`
- `@operation.end_view.name`

## Further Reading{% #further-reading %}

- [Learn about RUM](https://docs.datadoghq.com/monitors/create/types/real_user_monitoring/)
