Google is committed to advancing racial equity for Black communities. See how.

Learn about performance data related to app lifecycle (iOS & Android apps)

Performance Monitoring uses traces to collect data about monitored processes in your app. A trace is a report that contains data captured between two points in time in your app.

For iOS and Android apps, Performance Monitoring automatically collects several traces related to app lifecycle. All these traces are like timers because they measure the time it takes for the process to run (the "duration").

  • App start trace — A trace that measures the time between when the user opens the app and when the app is responsive

  • App-in-foreground trace — A trace that measures the time when the app is running in the foreground and available to the user

  • App-in-background trace — A trace that measures the time when the app is running in the background

View data from these traces in the On device tab of the Firebase console (learn more later on this page). Note that since these traces only collect the metric "duration", they are sometimes called "Duration traces". Also, in the Firebase console (in the On device tab), these traces are grouped under the table labeled Durations.

Definitions for each trace

Performance Monitoring uses method calls and notifications in your app to determine when each type of trace starts and stops. All these traces are like timers because they measure the time it takes for the process to run.

App start trace

This trace measures the time between when the user opens the app and when the app is responsive. In the console, the trace's name is _app_start. The collected metric for this trace is "duration".

  • Starts when the app's FirebasePerfProvider ContentProvider completes its onCreate method.

  • Stops when the first activity's onResume() method is called.

Note that if the app was not cold-started by an activity (for example, by a service or broadcast receiver), no trace is generated.

App-in-foreground trace

This trace measures the time when the app is running in the foreground and available to the user. In the console, the trace's name is _app_in_foreground. The collected metric for this trace is "duration".

  • Starts when the first activity to reach the foreground has its onResume() method called.

  • Stops when the last activity to leave the foreground has its onStop() method called.

App-in-background trace

This trace measures the time when the app is running in the background. In the console, the trace's name is _app_in_background. The reported metric for this trace is "duration".

  • Starts when the last activity to leave the foreground has its onStop() method called.

  • Stops when the first activity to reach the foreground has its onResume() method called.

Metrics collected by these traces

These traces are out-of-the-box traces, so you cannot add custom metrics or custom attributes to them.

All these traces are like timers because they measure the time it takes for the monitored process to run. The name of this collected metric is called "duration".

Track, view, and filter performance data

Track key metrics in your dashboard

Add your key metrics to your dashboard to learn how they're trending. You can quickly identify regressions by seeing week-over-week changes or verify that recent changes in your code are improving performance.

an image of the Firebase Performance Monitoring metrics dashboard

To add a metric to your dashboard, go to the Performance dashboard in the Firebase console, then click the Dashboard tab. Click an empty metric card, then select an existing metric to add to your dashboard. Click on a populated metric card for more options, like to replace or remove a metric.

The dashboard shows collected metric data over time, both in graphical form and as a numerical percentage change.

Learn more about using the dashboard.

View all traces and their data

To view these traces, go to the Performance dashboard in the Firebase console, then click the On device tab.

From the On Device tab, you can click through various screens to explore a trace and drill down into metrics of interest. On most pages, you can use the Filter button (top-left of the screen) to filter the data by attribute, for example:

an image of Firebase Performance Monitoring data being filtered by attribute
  • Filter by App version to view data about a past release or your latest release
  • Filter by Device to learn how older devices handle your app
  • Filter by Country to make sure your database location isn't affecting a specific region

Learn more about viewing data for your traces.

Next Steps

  • View detailed reports of user sessions in which you can see a specific trace in a timeline context of other traces collected during the same session.