You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -203,15 +203,16 @@ Android Profiling is in Preview.
203
203
204
204
{% img src="real_user_monitoring/android/android-profiling-ttid.png" alt="Android profiling data in a time to initial display vital event." style="width:90%;" /%}
205
205
206
-
Android profiling captures detailed data about your application's performance during launch, helping you identify slow methods and optimize startup time. Android profiling is built on top of the [ProfilingManager Android API][4] and samples the device's CPU to collect method call stacks from the application's process.
206
+
Android profiling helps you identify and optimize slow methods during important moments in user sessions. Android profiling is built on top of the [ProfilingManager Android API][4] and samples the device's CPU to collect method call stacks from the application's process.
207
207
208
208
{% alert level="warning" %}
209
209
Only devices running Android 15 (API level 35) or higher generate profiling data.
210
210
{% /alert %}
211
211
212
212
## Prerequisites
213
213
214
-
- Your Android application must use the Datadog Android SDK version 3.6.0+.
214
+
- Application launch profiling requires Android SDK version 3.6.0+.
215
+
- Continuous profiling requires Android SDK version 3.12.0+.
215
216
- [RUM without Limits][5] must be enabled in your organization.
216
217
217
218
## Setup
@@ -222,59 +223,83 @@ To start collecting data, set up [Mobile RUM for Android][6].
222
223
223
224
### Step 2 - Configure the profiling sampling rate
224
225
225
-
1.Initialize the RUMSDK and configure the `applicationLaunchSampleRate`, which determines the percentage of application launches that are profiled (for example, 15% means profiling runs on 15 out of100 launches).
226
+
Initialize the RUM SDK and configure the `setApplicationLaunchSampleRate` and `setContinuousSampleRate` parameters, which are independent of each other:
226
227
227
-
{% alert level="danger"%}
228
-
If no value is specified, the default `applicationLaunchSampleRate` is 15 percent.
229
-
{%/alert %}
228
+
- `setApplicationLaunchSampleRate` determines how often the time to initial display is profiled (for example, 15 means profiling runs on 15 out of 100 launches).
229
+
- `setContinuousSampleRate` determines whether the time to full display, application not responding (ANR) errors, long tasks, or [RUM Operations][19] are profiled (for example, 15 means that 15 out of 100 sessions will have their time to full display, ANRs, and long tasks profiled).
230
230
231
-
```kotlin
232
-
class SampleApplication : Application() {
233
-
override fun onCreate() {
234
-
super.onCreate()
235
-
val configuration = Configuration.Builder(
236
-
clientToken = "<CLIENT_TOKEN>",
237
-
env = "<ENV_NAME>",
238
-
variant = "<APP_VARIANT_NAME>"
239
-
).build()
231
+
Both sample rates are applied on top of the [RUM session sampling rate][17].
val rumConfig = RumConfiguration.Builder(applicationId)
251
+
.build()
252
+
Rum.enable(rumConfig)
253
+
254
+
// Enable Profiling
255
+
Profiling.enable(
256
+
ProfilingConfiguration.Builder()
257
+
.setApplicationLaunchSampleRate(15f)
258
+
.setContinuousSampleRate(15f)
245
259
.build()
246
-
Rum.enable(rumConfig)
247
-
248
-
// Enable Profiling
249
-
val profilingConfig = ProfilingConfiguration.Builder()
250
-
.setApplicationLaunchSampleRate(15) // default is 15%
251
-
.build()
252
-
253
-
Profiling.enable(profilingConfig)
254
-
}
260
+
)
255
261
}
256
-
```
262
+
}
263
+
```
257
264
258
-
{% alert level="warning"%}
259
-
The total volume of profiles may not match the percentage configured in`applicationLaunchSampleRate`. This variation results from [rate limitations](https://developer.android.com/topic/performance/tracing/profiling-manager/will-my-profile-always-be-collected#how-rate-limiting-works) within the data collector, including profiling support on older devices and the maximum profiling frequency per device.
260
-
{%/alert %}
265
+
{% alert level="warning" %}
266
+
The total volume of profiles may not match the percentage configured in `applicationLaunchSampleRate` or `continuousSampleRate`. This variation results from [rate limitations][20] within the data collector, including profiling support on older devices and the maximum profiling frequency per device.
267
+
{% /alert %}
261
268
262
269
The [ProfilingManager API][7] also supports disabling rate limiting during debug builds.
263
270
264
271
## Explore profiling data
265
272
266
-
Profiling data is captured on vitals and rolls up to views and sessions. Use`@profiling.has_profile`in the Sessions Explorer to filter to profiled events and investigate which code ran and how it affected the user's experience. This is available for sessions, views, and vitals.
273
+
You can use the `@profiling.has_profile` attribute in the Sessions Explorer to filter to profiled events and investigate which code ran and how it affected the user's experience. This is available for sessions, views, errors, long tasks, vitals, and operations.
267
274
268
-
### During the time to initial display
275
+
### During the time to initial display and time to full display
269
276
270
-
Android application launch profiling data is attached to the [time to initial display][8] vital event in a RUM session. You can access the time to initial display from the session side panel, view side panel, or directly from the time to initial display vital side panel.
277
+
Android application launch profiling data is attached to the [time to initial display][8] and [time to full display][8] vital eventsin a RUMsession. You can access profiles forthe time to initial display and time to full display from the session side panel, view side panel, or directly from the vital side panels.
271
278
272
-
{% img src="real_user_monitoring/android/android-profiling-session.png" alt="Android profiling data in RUM session." style="width:90%;" /%}
279
+
{% img src="real_user_monitoring/android/android-profiling-ttfd.png" alt="Android profiling data for a time to full display event." style="width:90%;"/%}
273
280
274
281
Use the **flame graph** to identify which methods consume the most CPU time during launch, the **thread timeline** to see parallel execution patterns, and the **call graph** to trace method dependencies. You can also download the profiling data for external analysis or deeper investigation.
275
282
276
283
{% img src="real_user_monitoring/android/android-profiling-thread-timeline.png" alt="Android profiling data for the time to initial display in a thread timeline." style="width:90%;"/%}
277
284
285
+
### During application not responding errors
286
+
287
+
Android profiling data is attached to [application not responding (ANR)][16] errors in a RUMsession. You can access profiles forANR errors from the view side panel or from the error event side panel.
288
+
289
+
{% img src="real_user_monitoring/android/android-profiling-anr.png" alt="Android profiling data for an application not responding error event." style="width:90%;"/%}
290
+
291
+
### During long tasks
292
+
293
+
Android profiling data is attached to long task events in a RUMsession. You can access profiles for long tasks from the view side panel or from the long task event side panel.
294
+
295
+
{% img src="real_user_monitoring/android/android-profiling-long-task.png" alt="Android profiling data for a long task event." style="width:90%;"/%}
296
+
297
+
### During operations
298
+
299
+
Android profiling data is attached to operations events in a RUMsession. You can access profiles for operations from the view side panel or from the operations event side panel.
300
+
301
+
{% img src="real_user_monitoring/android/android-profiling-operation.png" alt="Android profiling data for an operation." style="width:90%;"/%}
302
+
278
303
{%/if%}
279
304
<!-- end Android -->
280
305
@@ -287,11 +312,12 @@ iOS Profiling is in Preview.
287
312
288
313
{% img src="real_user_monitoring/ios/ios-profiling-ttid.png" alt="iOS profiling data in a time to initial display vital event." style="width:90%;"/%}
289
314
290
-
iOS profiling captures detailed data about your application's performance during launch, helping you identify slow functions and optimize startup time. iOS profiling is built on top of the [mach Kernel API][9] and periodically samples all application threads to collect call stacks.
315
+
iOS profiling helps you identify and optimize slow methods during important moments in user sessions. iOS profiling is built on top of the [mach Kernel API][9] and periodically samples all application threads to collect call stacks.
291
316
292
317
## Prerequisites
293
318
294
-
- Your iOS application must use the Datadog iOS SDK version 3.6.0+.
319
+
- Application launch profiling requires iOS SDK version 3.6.0+.
320
+
- Continuous profiling requires iOS SDK version 3.14.0+.
295
321
- [RUM without Limits][10] must be enabled in your organization.
296
322
297
323
## Setup
@@ -301,10 +327,15 @@ To start collecting data, set up [Mobile RUM for iOS][11].
301
327
302
328
### Step 2- Configure the profiling sampling rate
303
329
304
-
Initialize the RUMSDK and configure the `applicationLaunchSampleRate`, which determines the percentage of application launches that are profiled (for example, 5% means profiling runs on 5 out of100 launches).
330
+
Initialize the RUMSDK and configure the `applicationLaunchSampleRate` and `continuousSampleRate` parameters, which are independent of each other:
331
+
332
+
-`applicationLaunchSampleRate` determines how often the time to initial display is profiled (for example, 5 means profiling runs on 5 out of100 launches).
333
+
-`continuousSampleRate` determines whether the time to full display, application hangs, long tasks, or [RUM Operations] [21] are profiled (for example, 5 means that 5 out of100 sessions will have their time to full display, application hangs, and long tasks profiled).
334
+
335
+
Both sample rates are applied on top of the [RUM session sampling rate][21].
305
336
306
337
{% alert level="danger"%}
307
-
If no value is specified, the default `applicationLaunchSampleRate` is 5 percent.
338
+
If no value is specified, the default for both `applicationLaunchSampleRate`and `continuousSampleRate`is 5%.
308
339
{%/alert %}
309
340
310
341
```swift
@@ -330,23 +361,47 @@ If no value is specified, the default `applicationLaunchSampleRate` is 5 percent
330
361
)
331
362
332
363
// Enable Profiling feature
333
-
Profiling.enable() // default is 5%
364
+
Profiling.enable(with:
365
+
Profiling.Configuration(
366
+
applicationLaunchSampleRate: 5.0,
367
+
continuousSampleRate: 5.0
368
+
)
369
+
)
334
370
```
335
371
336
372
## Explore profiling data
337
373
338
-
Profiling data is captured on vitals and rolls up to views and sessions. Use`@profiling.has_profile`in the Sessions Explorer to filter to profiled events and investigate which code ran and how it affected the user's experience. This is available for sessions, views, and vitals.
374
+
You can use the `@profiling.has_profile`attributein the Sessions Explorer to filter to profiled events and investigate which code ran and how it affected the user's experience. This is available for sessions, views, errors, long tasks, vitals, and operations.
339
375
340
-
### During the time to initial display
376
+
### During the time to initial display and time to full display
341
377
342
-
iOS application launch profiling data is attached to the [time to initial display][12] vital event in a RUM session. You can access the time to initial display from the session side panel, view side panel, or directly from the time to initial display vital side panel.
378
+
iOS application launch profiling data is attached to the [time to initial display][12] and [time to full display][12] vital events in a RUM session. You can access profiles for the time to initial display and time to full display from the session side panel, view side panel, or directly from the vital side panels.
343
379
344
-
{% img src="real_user_monitoring/ios/ios-profiling-session.png" alt="iOS profiling data in a view event to initial display vital event." style="width:90%;" /%}
380
+
{% img src="real_user_monitoring/ios/ios-profiling-ttfd.png" alt="iOS profiling data in a time to full display vital event." style="width:90%;" /%}
345
381
346
382
Use the **flame graph** to identify which functions consume the most Wall time during launch, the **thread timeline** to see parallel execution patterns, and the **call graph** to trace function dependencies. You can also download the profiling data for external analysis or deeper investigation.
347
383
348
384
{% img src="real_user_monitoring/ios/ios-profiling-thread-timeline.png" alt="iOS profiling data for the time to initial display in a thread timeline." style="width:90%;" /%}
349
385
386
+
### During application hangs
387
+
388
+
iOS profiling data is attached to [application hangs][18] in a RUM session. You can access profiles for application hangs from the view side panel or from the error event side panel.
389
+
390
+
{% img src="real_user_monitoring/ios/ios-profiling-app-hang.png" alt="iOS profiling data in an application hang event." style="width:90%;" /%}
391
+
392
+
### During long tasks
393
+
394
+
iOS profiling data is attached to long task events in a RUM session. You can access profiles for long tasks from the view side panel or from the long task event side panel.
395
+
396
+
{% img src="real_user_monitoring/ios/ios-profiling-long-task.png" alt="iOS profiling data in a long task event." style="width:90%;" /%}
397
+
398
+
### During operations
399
+
400
+
iOS profiling data is attached to operations events in a RUM session. You can access profiles for operations from the view side panel or from the operations event side panel.
401
+
402
+
{% img src="real_user_monitoring/ios/ios-profiling-operation.png" alt="iOS profiling data in an operation event." style="width:90%;" /%}
403
+
404
+
350
405
{% /if %}
351
406
<!-- end iOS -->
352
407
@@ -365,3 +420,9 @@ Use the **flame graph** to identify which functions consume the most Wall time d
0 commit comments