By eliminating crashes and increasing speed across the stack, you can build better performance into every mobile app release. Here are some best practices to take full advantage of mobile monitoring with New Relic.
1. Start collecting data
Start collecting data in production.
You'll see immediate value by adding our mobile monitoring SDK to your app for its next release to the app store. We recommend installing the iOS or Android agent to your production release even if you're simply testing New Relic's capabilities. This will ensure you'll get an adequate amount of data to really understand all of our mobile monitoring capabilities and your end users' experience.
How to do it
First, add a new app in New Relic's user interface (full steps):
Type a name for your mobile app, and select Continue.
Use one app and the associated app token for the development releases of your iOS app, another app and its associated app token for the production releases of that iOS app, and another pair of app tokens for development and production releases of your Android app. You'll be able to compare data from across the four app tokens using our query builder.
Next, install and configure the mobile agent:
Download the latest version of New Relic's SDK for iOS or Android, and add it to your mobile app. (Full steps for iOS and Android)
Configure your installation as needed. For example:
Enable the feature flag to capture MobileRequest events to use our full network analysis capabilities for iOS or Android.
See how much of your user base has upgraded to your latest app version.
Track adoption over time.
Get a count of new installs as compared to upgrades from an earlier version.
See the distribution of usage across geographical locations, carriers, ASN owners (wi-fi providers), devices, connection types, and more.
3. Take preventive steps
Use alert notifications to help uncover the causes behind crashes and errors.
Once you are running our mobile monitoring capabilities in production and have explored some of the key features, you can use New Relic to uncover critical issues with your mobile application. In particular, focus on crashes and errors.
Use metric-based alerts as a starting point to gain high-level visibility into problems.
Then, as new services or functionalities are added, use New Relic’s more targeted, event-based (NRQL) alerts to make sure that the most critical issues are handled swiftly.
Use these alerts to determine whether a crash is impacting a large number of users. If it is, the relevant people (for example, both the mobile app team’s on-call member and the owner of the related back-end service) will be alerted.
Make sure that your team knows how to respond to changes in crash rate (crashes per sessions) and the percentage of users impacted by crashes of your mobile app.
How to do it
Use our metric-based alerts and mobile monitoring UI:
Ensure that key members of your mobile team have opted in to receive emails for new crashes. These emails will take you to the crash type in the UI page for your mobile app.
Create an alert for your crash rate threshold that key members of your team can view in Slack or any other alerts notification channel you choose.
Your alert notification will include a link to our UI, where you can examine a chart with the exceeded threshold. From there, a link will take you to the relevant mobile monitoring page, where you can get additional details.
Combine the metric-based workflow with event-based alerts and specific to your mobile app and system.
Create your NRQL alert that focuses on crashes of your most recently released production version.
Create an additional NRQL alert that focuses on the percentage of users impacted by crashes in your latest app version (to check the overall impact on your user base).
4. Dig deeper into crashes
Take your crash reporting to the next level.
Now it’s time to tackle some of those harder-to-reproduce crashes by:
Applying additional instrumentation to your application.
Leveraging crash event trails, NRQL queries, and to visualize your data.
How to do it
Crashes are an inevitable part of running mobile applications at scale. We provide tools to help you understand your highest-impact crashes. Use the Crash analysis UI to see which crashes are occurring most often, the percentage of crash-free users, which files and methods are associated with perhaps 80 percent of your crashes, which crashes a particular user just experienced, and more.
Go after high-impact crashes with crash analysis:
Add custom attributes to categorize the highest-value customers, and then use them to segment crashes according to your most valuable audiences.
Add breadcrumbs and custom events to produce a detailed trail of events leading up to every crash occurrence (over the last 90 days). Then, view this crash event trail in our mobile monitoring UI.
Use our mobile monitoring's Versions trends page to make sure you’re improving the crash rate over subsequent releases and avoiding regressions.
Use breadcrumbs and custom attributes to better reproduce and debug crashes. For example, use our recordBreadrumb API for Android or iOS to track mid-session changes in state that can help debug crashes, such as:
Change of connection type
Change of orientation
CPU and memory state at key points in the app code
Add custom attributes to existing events, so you can ask even more precise questions of your mobile app. Add dimensions such as:
User ID: Use to react to specific user concerns and to better understand which customers and segments are most impacted.
Store ID: Use to address problems with out-of-date devices, bad wi-fi, and so on.
User segments: Use to better understand which customers and segments are most impacted; for example, logged in vs. non-logged in.
Money in the cart at session end
Origin or attribution of entry into the app
Standardize custom attribute names across your mobile apps, and align with your website (if you're using our browser monitoring), so that you can compare and contrast performance across end-user channels. The mobile agents track the last interaction of crashed and non-crashed sessions to provide visibility into what the user viewed before exiting your app (either intentionally or due to a crash).
5. Focus on KPIs
Bring your key performance indicators to life.
Create custom interactions and events to hone in on the most important signals, including user activity for the business-critical aspects of your app. Using these powerful APIs, you can add custom instrumentation to just about anything. The following are some example use cases.
How to do it
Use custom events to track feature use. For example:
Use custom events to track user flow between app and website.
Use custom events or mobile breadcrumbs to optimize the performance of key user flows (log in, shopping cart, etc.).
use custom events to provide faster, contextualized support experiences for your digital customers.
Use the recordCustomEvent API. Then compare the use of different features using:
SELECT count(*) FROM MyNewMobileEventType FACET name
Use custom events to measure page load time:
Create an app-launch timer to measure the time that elapses between a user-tap to launch your app and the point in your app code where the first screen is available. Record the timer value in New Relic using something like the following:
Track specific user actions or funnel steps in the app (like "add to cart"), and include the price as an attribute on that event.
Measure flows through the application by viewing the related funnel steps with custom events. For example, create a timer to track the start and end times of a subflow or an entire flow across multiple funnel steps to understand how long it took users to get through the process.
Use custom interactions to see traces associated with the same webpages.
Use the agent API to disable default interactions, and focus on custom interactions so that you can review the page loads that are most crucial to your primary funnel.
Define the start and stop times of these custom interactions to trace activities associated with individual steps of that funnel (for example, a specific user action or a page load).
Track the last interactions of crashed and non-crashed sessions so that you can see what the user viewed before exiting your app (either intentionally or from a crash).
Example query for non-crashed sessions:
SELECT count(*) FROM Mobile WHERE sessionCrashed is null FACET lastInteraction SINCE 90 days ago
Example query for crashed sessions:
SELECT count(*) FROM Mobile WHERE sessionCrashed is true FACET lastInteraction SINCE 90 days ago