Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS-9915] Mobile App Performance updates for iOS and Android #27404

Merged
Merged
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: May Lee <may.lee@datadoghq.com>
  • Loading branch information
rtrieu and maycmlee authored Feb 6, 2025
commit 1d68ea672563a8858199054eb15411d1d6d26fbd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are additional [metrics and attributes that are specific to a given event
| View | 30 days | A view represents a unique screen (or screen segment) on your mobile application. A view starts and stops when the `onActivityResumed` and `onActivityPaused` callbacks are called through the `ActivityLifecycleCallbacks` interface. Each occurrence is classified as a distinct view. While a user stays on a view, RUM event attributes (Errors, Resources, and Actions) get attached to the view with a unique `view.id`. |
| Resource | 15 days | A resource represents network requests to first-party hosts, APIs, and third-party providers in your mobile application. All requests generated during a user session are attached to the view with a unique `resource.id`. |
| Error | 30 days | An error represents an exception or crash emitted by the mobile application attached to the view it is generated in. |
| Action | 30 days | An action represents user activity in your mobile application (such as an application launch, tap, swipe, or back). Each action is attached with a unique `action.id` attached to the view it gets generated in. When an action is being tracked, other actions within the next `100 ms` do not get sent, unless they are [custom actions][1]. |
| Action | 30 days | An action represents user activity in your mobile application (such as an application launch, tap, swipe, or back). Each action is attached with a unique `action.id` that is also attached to the view it gets generated in. When an action is being tracked, other actions within the next `100 ms` do not get sent, unless they are [custom actions][1]. |
| Long Task | 15 days | A long task event is generated for any task in the application that blocks the main thread for more than the specified duration threshold. |

The following diagram illustrates the RUM event hierarchy:
Expand All @@ -46,7 +46,7 @@ The `ApplicationLaunch` view includes any logs, actions, and resources created b

The Android RUM SDK offers various strategies to [automatically track views][2] like Activities, Fragments, or Navigation destinations. You can also track views manually by directly calling the RUM APIs. The precise moment a view starts or stops depends on the chosen tracking strategy or manual instrumentation:

- Activities (`ActivityViewTrackingStrategy`): When you rely on this strategy, the SDK automatically starts a RUM view when the Activity enters the foreground (`onResume`) and stops it when the Activity leaves the foreground (onPause).
- Activities (`ActivityViewTrackingStrategy`): When you rely on this strategy, the SDK automatically starts a RUM view when the Activity enters the foreground (`onResume`) and stops it when the Activity leaves the foreground (`onPause`).
- Fragments (`FragmentViewTrackingStrategy`): Each `Fragment` in your application is tracked as a separate RUM view. The SDK starts the view in the Fragment's `onResume` lifecycle method and stops it in `onPause`.
Mixed (`MixedViewTrackingStrategy`): Activities and Fragments each become distinct RUM views based on their respective lifecycle events (`onResume` and `onPause`).
- Navigation (`NavigationViewTrackingStrategy`): Each navigation destination is treated as a distinct RUM view, so view boundaries align with navigation events in your graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ val rumConfig = RumConfiguration.Builder(applicationId)
.build()
```

If you need more control over which resources are considered "initial" in TNS, you provide your own implementation of the `InitialResourceIdentifier` interface. This enables you to define custom classification logic based on resource properties like ID or start time.
If you need more control over which resources are considered "initial" in TNS, you can provide your own implementation of the `InitialResourceIdentifier` interface. This enables you to define custom classification logic based on resource properties like ID or start time.

### Interaction to next view
The **Interaction-to-Next-View (INV)** measures the time between the last user interaction in the previous view and the start of the current view. INV is represented by the `@view.interaction_to_next_view_time `attribute in RUM view events.

By default, INV is calculated from the last **tap**, **click**, or **swipe** action occurring within a **3-second** threshold before the view starts. This behavior is controlled by the `TimeBasedInteractionIdentifier`, which classifies such actions as the "last interaction."

To customize the default 3-second threshold for ITNV calculation, you can adjust the threshold value in the `TimeBasedInteractionIdentifier` and set it using `setLastInteractionIdentifier()` configuration. This allows you to include actions within a custom time window before the next view starts.
To customize the default 3-second threshold for ITNV calculation, you can adjust the threshold value in the `TimeBasedInteractionIdentifier` and set it using the `setLastInteractionIdentifier()` configuration. This allows you to include actions within a custom time window before the next view starts.

```javascript
import com.datadog.android.rum.RumConfiguration
Expand Down Expand Up @@ -104,7 +104,7 @@ Once the timing is sent, the timing is accessible as `@view.custom_timings.<timi
All view timings are measured relative to the view's start. The exact moment a view starts depends on the type of instrumentation used for tracking views. For more details, see [Views instrumentation versus app lifecycle][2].

## Troubleshooting
When using the default TimeBasedInitialResourceIdentifier and TimeBasedInteractionIdentifier, TNS and INV timings may be missing in specific cases:
When using the default `TimeBasedInitialResourceIdentifier` and `TimeBasedInteractionIdentifier`, TNS and INV timings may be missing in specific cases:

- `@view.interaction_to_next_view_time` (INV) is not set for the first view of a session if no tap, click, or swipe actions were tracked in the previous view, or if the interval between the last such action and the start of the current view exceeds 3 seconds.
- `@view.network_settled_time` (TNS) is unavailable if no resources were tracked during the view, or if none started within the initial 100ms of the view.
Expand Down
Loading