Getting Started Getting Started with New Relic Mobile Everything You Need to Know About Improving the Performance of Your Mobile App
Table of Contents Introduction CHAPTER 1: Mobile App Monitoring Overview CHAPTER 2: Network & App Performance Overview CHAPTER 3: App Code Diagnostics CHAPTER 4: Mobile Device Profiles CHAPTER 5: Alerting CHAPTER 6: Cross-System Visibility CHAPTER 7: Usage CHAPTER 8: Maintenance Conclusion 03 04 08 13 18 20 21 23 25 27 02
Introduction You ve deployed New Relic Mobile because you know a thing or two about mobile app performance. You realize that no matter how perfect your code is, there are a ton of other moving parts that affect the performance of your app. You ve deployed New Relic Mobile to keep your users happy and coming back for more. What you may not know, however, is what exactly you can do with the tool. This guide is here to give you a basic understanding of all the must-use features of New Relic Mobile. Over the course of this tutorial, you ll learn how to: Gain real-time visibility into performance problems and end-user experiences Understand how multiple backend (internal and third-party) services are affecting your app s performance Learn how individual components in the fragmented mobile ecosystem might be negatively impacting app performance Compare the performance of multiple versions of your app to see if anything needs tuning There s a lot of great stuff to take advantage of, so let s get started 03
CHAPTER ONE: Mobile App Monitoring Overview Here s where the magic happens Once you log into your New Relic account, the first thing you ll want to do is select Mobile from the left-hand menu bar. This will then take you to a summary screen of all the mobile apps that you re monitoring. You ll immediately see a handful of key performance metrics like interaction speed, HTTP error percentages, and network failure percentages, along with a color-coded traffic light that indicates each app s current status. Green = Normal Yellow = Caution Red = Critical Gray = Not reporting 04
Overview Dashboard After you ve clicked on a particular app, you ll then be at the overview dashboard. This is where you can find key performance metrics, including: Execution time: Chart showing average execution time for the various interactions in the app like image/view load, database, or network HTTP response time: Chart of average HTTP response time per host (measured in seconds) for the selected time period HTTP errors/network failures: Chart showing percentages of API or HTTP errors (403, 503, etc.) and network failures (DNS lookups, socket timeouts, etc.) that occurred during a selected time period Slowest interactions: List of the top five slowest interactions in your app, with average execution time and throughput Sessions by version: Chart showing the number of active sessions for different app versions Recent events: List of events, alerts, warnings, and links to details about your app 05
See an area where you d like to dig further? If you want to... Do this... Limit the information to a specific version of your app (if available) Select your choice from the Versions menu below the New Relic title bar at the top. Change the time period for data that appears on the dashboard From the selected app or server dashboard, select an available option from the time picker below the New Relic title bar. (Default is the last 30 minutes, ending now). Note: The amount of available data depends on your highest subscription level with New Relic. For example, if you have a Lite subscription for your New Relic agent apps and an Enterprise trial subscription for your mobile apps, the Enterprise data retention applies. View details in a table Select any row under Slowest Interactions to view additional details. View details on a chart Point to any place on the chart. Or, select any place on the chart to view this timeframe on its own dashboard. Show details about a specific date or time period on a chart Drag right or left on any area of the chart to zoom in on the selected range. 06
Standard New Relic User Interface Functions If you re brand new to New Relic, it ll also be helpful to familiarize yourself with these standard UI functions: If you want to... Do this... View an app s dashboard From the Mobile list, select the application s name to go directly to the application s Overview dashboard. Or, to drill down to specific dashboard details, select the application s Active Sessions, Interactions/min, Interaction speed, HTTP requests, HTTP error %, or Network failure % data on the application s row. Filter the list of recent events Select the icon for specific types of Recent events: All, notifications, critical problems, non-critical problems, or notes. View dashboard details about a recent event or alert From the Recent Events list, select the link for the event or alert. Set up an RSS feed for event notifications On the Recent Events section of the dashboard, select the orange RSS icon. Remove or return an app on the list To delete an app from the list, select its gear icon, and then select Delete App. To restore a deleted app to the list: scroll to the bottom of the Deleted Apps list, select the app s gear icon, and select Restore App. View a different app on the dashboard From the app s menu bar, select the menu arrow next to the current app s name, and search for another app or select one from the list, or select the Mobile menu to start over. Find out why an app s traffic light is gray To view a list of troubleshooting tips if no data is reported for an app, select See Instructions. Delete an app from the list To delete an app completely, make sure its traffic light is gray, and then select Delete App. Create a URL that shows current webpage information At the bottom of the webpage, select the Permalink icon, and then copy the URL or select the Clipboard icon. This is useful, for example, to copy and paste the Permalink into a support ticket to help troubleshoot any problems at a specific point in time. Hide the New Relic title bar and menus (Kiosk mode) At the bottom of the webpage, click the Kiosk mode button. To restore them, click the Kiosk button at the top of the webpage. This is useful to hide private information; for example, with demos, advertisements, trade shows, etc. 07
CHAPTER TWO: Network and App Performance Pinpoint exactly what s slowing your app down Mobile applications have various moving parts. So when something goes wrong, it can often be hard to locate the exact source of the problem. Is it a background service or a carrier that s slowing you down? Is it regional or global? With New Relic s network and app performance monitoring, you never have to wonder again. HTTP Requests Dashboard Monitoring the performance of HTTP requests and their response time can help provide useful information to improve your users experience with your app. The HTTP Requests dashboard includes charts for your top five domains by response time and average throughput. From here you can sort and drill down into detailed information for the domains or specific requests, including network failures, HTTP errors, average throughput, and average data sent and received for the selected time period. To view your top five domains or drill down into details about specific HTTP requests, go to the New Relic menu bar, then select Mobile > (selected app) > Network > HTTP Requests. From here, you can drill down into detailed information about specific requests. Or you can get further drill-down details around things like HTTP request time, average throughput, and data transfer (avg). You can also drill down into the web transaction details for the app server. 08
The HTTP Requests dashboard includes several options: To change the information that appears (including response time, requests per minute, total time, or transfer size), select your choice from the Sort by menu. To adjust the amount of information that appears, select Hide < 1% throughput. To select the mobile app versions or time period that the dashboard shows, use the Versions menu and time picker below the New Relic title bar. To view or hide all requests made by your app, select Expand all or Collapse all. To view dashboard details for a specific host or HTTP request (including request time, average throughput, and data transfer), select its name. To go to the Transactions dashboard for a specific request s web application (if the web app has New Relic APM installed), select App server drill-down. To return to the main HTTP Requests dashboard, select the Close (X) button. 09
Errors Dashboard The New Relic Mobile Errors dashboard lets you keep tabs on all your HTTP request errors (403, 422, 500, 502, etc.) and network failures for your hosts, including: Secure connection failed Timed out Cannot find host Not connected to Internet Cannot connect to host You can select a specific host or a specific message to drill down into additional details. (For example, error messages generated form Android apps will display a stack trace.) You can also send an email or file a ticket from individual error messages. Tip: To configure New Relic Mobile to notify you when the HTTP status, network failure rates, or HTTP response times exceed your defined thresholds, go to Chapter 5: Alerting. To view HTTP errors or network failures for your mobile app: From the New Relic menu bar, select Mobile > (selected app) > Network > Errors. Use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. The Errors dashboard includes several additional options: To select the mobile app versions or time period that the dashboard shows, use the Versions menu and time picker below the New Relic title bar. To change the view to errors or failures, select the Sort by option. To hide low-usage hosts, select the Hide < 1% throughput option. To view dashboard details for a specific host, HTTP status error, or network failure, select its name. To view or hide information about a host on an individual chart, select its name link below the chart. To view details about a specific error message or request, select its name. Then, to return to the main Errors dashboard, select the Close (X) button. 10
Any HTTP request that returns a 400 or 500 status code will be captured in New Relic Mobile. If you want to view details about an error trace, select its request URL link on the Errors dashboard. From here you can: View the Response body Share the error details with others by email File a ticket about it (for example, Lighthouse, Pivotal Tracker, JIRA) Delete or hide the error See an error URL that s unknown? When your application attempts to connect to a specific URI, New Relic s servers attempt to parse the URI and extract the host portion of the URI. If the URI is poorly formed, the host cannot be identified, so it is labeled Unknown. For example, a call to google,com (with a comma accidentally used instead of a period) would result in both a network failure on DNS lookup and Unknown in the New Relic user interface. Each bar on the Errors dashboard shows the percentage of requests to the specific hosts that resulted in errors or failures. The bar chart sorts by error rate, so 100% errors are always listed first. For example, if there is only one call to a host and that call fails, the chart shows a 100% error rate. Since all requests to an unparseable URI will fail, the error rate for an Unknown host will always be 100%. To solve this problem, try to identify where the malformed URLs are listed in your app code, and modify them so they no longer fail. Geography Dashboard Depending on where your mobile users are located, your app s performance may vary. The New Relic Mobile Geography dashboard shows your mobile users experience as a world view with color-coded response times, network failure rates, active users, network requests per minute, or data transfer size. This is where you can drill down into detailed information about each country. 11
To view the Geography dashboard, go to Mobile > (your mobile app) > Network > Geography. Here s how you can view and sort for details: To change the information that appears (including response time, requests per minute, total transfer size, active users, or network failure rate), select your choice from the Sort by menu. To adjust the amount of information that appears, select Hide < 1% throughput. To view summary information about a location, point to any area in color on the map, or point to the country s name on the list. To view detailed information about a location (including average response time, calls per minute, active users, and network failure by type), select its location on the map, or select its name on the list. To close the detail window and return to the Geography dashboard, select the Close (X) button. To view details for a specific point in time, point to any place on a chart, or click to view additional dashboard details. To show details about a specific date or time period on a chart, drag right or left on any area of the chart to zoom in on the selected range. Carriers Dashboard Wondering if a specific carrier is slowing you down? The New Relic Mobile Carriers dashboard provides charts that show your mobile carriers and their response time impact, error rate, and active devices. Wi-Fi is included as a carrier. From here you can sort and drill down into detailed information about specific carriers. To view the main dashboard showing your users wireless carriers, go to Mobile > (selected app) > Network > Carriers. You can use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. To change the information that appears (including response time, active devices, or network errors), select your choice from the Sort by menu. To adjust the amount of information that appears, select Hide < 1% throughput. To select the mobile app versions or time period that the dashboard shows, use the Versions menu and time picker below the New Relic title bar. To view dashboard details for a specific carrier, select its name. Then, to return to the main Carriers dashboard, select the Close (X) button. 12
CHAPTER THREE: App Code Diagnostics Track user activity and create custom metrics You know your code is awesome. Now you can see it in action. With New Relic s mobile app code diagnostics, you can see exactly how users are interacting with your app, get alerts when anything abnormal happens, and make sure that everything is working as it should be. Interactions Dashboard One of New Relic Mobile s most useful features is User Interaction Traces. An interaction is any activity that a user performs inside your application it could be anything from waiting for a screen or image to load, to posting a photo or updating a profile. All of these individual interactions are traced to provide a full picture of how they are each affecting the overall performance of your app. You ll find a list of your app s most expensive user interactions in the Interactions Dashboard, which can be sorted by average time, total time consumed, and view count. You can see code executing on the main thread, as well as code executing on worker threads. Note: New Relic automatically shows you data for certain interactions (viewloads, image loads, database, JSON parsing, networking) right out of the box. If there are other interactions you would like to track, use our SDK API to set up your own interactions. To view interactions for your mobile app: 1. From the New Relic menu bar, select Mobile > (selected app) > App > Interactions. 2. To view information on a particular interaction, select its name from the left column or from the chart. 13
The Interactions breakdown table shows the full list of all methods the New Relic SDK instruments. You can see a breakdown by selecting an interaction, and expanding the breakdown table using the link below the charts. For each traced method, this chart shows: Thread type (foreground or background) Class and method name (if any of the metrics are custom instrumented, the category will show up as custom) Percent of total execution time spent in this method Average number of calls to this method per interaction Overall average execution time of each call to this method 14
Interactions Timeline If you re using the Mobile Enterprise product, you can also view the Interactions Timeline. Here s how: 1. From the New Relic menu bar, select Mobile > (selected app) > App > Interactions. 2. From the Slowest traces table, select the Activity or Duration link for the trace. As you move your mouse over the timeline, you ll see information on the method underneath, memory used by your application, and any active network requests. The labels on the left indicate which thread each method is running on. To view a waterfall of execution flow within a method, select a method block. On-Device Metrics While you re in the Interactions Timeline, you can also see how your app is interacting with your end users devices. New Relic provides usage metrics, like database, CPU and memory, in addition to operating system metrics. Just hover over the timeline to view these metrics as shown in the image below. With on-device metrics, you can get insight into your app s device-level data. 15
Custom Metrics With the custom metric API, you can record arbitrary numerical data and named events. Custom metrics can help to track high-level events specific to your application. Several API calls are available to record custom metrics that provide different levels of detail. To record a custom metric from your application, use this method: ios Application [NewRelic recordmetricwithname:(nsstring *)name category:(nsstring *)category value:(nsnumber *)value]; This method will record a metric of the form: Custom/ [Category]/[Name] with a count of 1 and a total value equal to the value passed in. Multiple calls will aggregate the count and value according to standard New Relic metric aggregation rules. Android Application NewRelic.recordMetric(String name, String category, double value) If you want to specify more details about a custom metric, there are See NewRelic.h for variations that accept additional arguments and two other API methods available: NewRelic.recordMetric(String name, String category, int count, double totalvalue, double exclusivevalue) See NewRelic.h for variations that accept additional arguments and give you more control over the metrics you record. To learn more, go to the mobile SDK APIs page on our Docs site. NewRelic.recordMetric(String name, String category, int count, double totalvalue, double exclusivevalue, MetricUnit countunit, MetricUnit valueunit) Parameter count Description The number of times the event has happened. totalvalue exclusivevalue The total value of the recording. The exclusive value of the recording, for example, if the total value contains measurements accounted for elsewhere. countunit Unit of measurement for the metric count. Valid values are PERCENT, BYTES, SECONDS, BYTES_PER_SECOND and OPERATIONS. valueunit Unit of measurement for the metric value. Valid values are PERCENT, BYTES, SECONDS, BYTES_PER_SECOND and OPERATIONS. The name parameter is the textual name of the metric that will appear in the New Relic UI. Use clear, concise metric names to help you get the most out of the metrics. Guidelines for naming a custom metric: Use case and whitespace characters appropriate for display in the user interface Metric names are rendered as-is in the UI. Capitalize the metric name. Avoid using the characters / ] [ *. Avoid multi-byte characters. 16
To view the custom metrics you collect, follow standard procedures to create custom dashboards. Once you ve created a custom metric, you ll be able to view the same details that you get for all other interactions that New Relic automatically tracks. You can tell which ones they are by taking a look at the category it ll be marked as Custom, as seen in the example below. Custom metrics are great for tracking any business metrics that are not automatically being tracked. For example, let s say you want to start tracking purchases in your app. You can record a custom metric with the SKU of the particular purchase as the name, and the dollar amount as the value. New Relic will thenstart pulling this data in, giving you a quick and easy way to seehow many purchases are being made in your app. 17
CHAPTER FOUR: Mobile Device Profiles See how devices and operating systems are impacting performance Wondering which device is most popular with your users? Curious about which operating system is the fastest? New Relic Mobile offers mobile device profiles that give you all that and more. Devices Dashboard The Devices dashboard provides performance details about the top devices be it ipad, iphone, ipod Touch, Android Tablet or something else using your mobile application. Charts compare the devices by Interaction time, HTTP request time, active users, and network failures. From here you can drill down into details by a specific model (for example, iphone 4, 4S, 5) as well. To view the Devices dashboard: 1. From the New Relic menu bar, select Mobile > (selected app) > App > Devices. 2. Use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. 3. To select the mobile app versions or time period that the dashboard shows, use the Versions menu and the time picker below the New Relic title bar. 4. Optional: Select the Sort by and Hide < 1% throughput options. 5. To view the dashboard details for a specific device or model (including HTTP request times, error rates, and active users), click its name. 6. To return to the main Devices dashboard, select the Close (X) button. 18
Operating Systems Dashboard You can also break down performance data by operating system in the OS dashboard. The New Relic Mobile s OS Versions dashboard provides performance details about the top operating system versions using your mobile application, such as ipad, iphone, ipod Touch, Android Tablet, etc. Charts compare the OS versions by HTTP request time, active users, and network failures. From here, you can also drill down into details by a specific model (for exampe, ios 5, 6, 7). To view performance details about your users OS versions, including HTTP request time, active users, and failures: 1. From the New Relic menu bar, select Mobile > (selected app) > App > OS Versions. 2. To select the mobile app versions or time period that the dashboard shows, use the Versions menu and the time picker below the New Relic title bar. 3. Optional: Select the Sort by and Hide < 1% throughput options. 4. To view dashboard details for a specific OS version (including HTTP request times, error rates, and active users), click its name. 5. To return to the main OS Versions dashboard, select the Close (X) button. From the OS Versions dashboard, you can use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. You can also drill down into detailed information about specific OS versions. 19
CHAPTER FIVE: Alerting Know what s up with your app at all times App errors can hit at any time, day or night. That s why New Relic Mobile offers alerting capabilities that will make sure you re always in the know. To receive alerts based on the health of network services your mobile apps talk to, account administrators can customize Caution and Critical alert conditions for each external host. This includes: HTTP status error rates Network failure rates Response time Set Up an Alert To set up an alert, choose which hostnames you want to monitor, and then configure the Caution (yellow) and Critical (red) thresholds. To customize alert conditions for your mobile app: From the New Relic menu bar, select Mobile > (selected app) > Settings > Alerts > Change alert thresholds. To enable alert conditions for an external host, select the corresponding checkbox. For each external host using alert notifications, select the Caution (yellow) and Critical (red) alert conditions, then click Save. To enable alert notifications for your mobile app, select the corresponding checkbox, then click Save alert settings. If a Critical (red) event has been open for several minutes, New Relic Mobile will send an alert notification to users who have been set up to receive alert notifications. New Relic will also send a notification when all Critical events close. Once you ve created an alert, you can see it in the alerts dashboard by selecting Mobile > (selected app) > Mobile > Alerts. Get Alert Details Each alert notification includes the alert icon and summary information. To view dashboard details about a specific alert notification on the New Relic Mobile Alerts dashboard, select its link. From here you can use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. To view the Alerts dashboard for your other applications (not just mobile apps), select the All alerts link. 20
CHAPTER SIX: Cross-System Visibility Web and mobile monitoring together If you re not already using New Relic to monitor your web apps, you may want to because we offer unified visibility across your mobile apps, back-end services, and web apps. That means you can see your entire end-to-end ecosystem, including which web services are talking to your mobile apps, and easily pinpoint problems when they happen. Map Dashboard New Relic s App Map helps you quickly identify performance problems between your mobile app and its related services. This map dashboard gives you a clear architectural picture of your mobile app s relationships to other services and the influence of each on the others. If one service fails, you can see at a glance which other services are affected. To view your mobile app and its related services as an architectural map: 1. From the New Relic menu bar, select Mobile > (selected app) > Network > Map. 2. To view HTTP request details for a service, click its name. 3. To view dashboard details for a New Relic app related to the service, click the service s name below the associated hostname. 4. To view throughput details as a chart, click the icon or the bar below the service s name. 5. To drill down into additional details for a service, point (or click and drag) anywhere on the throughput chart. 21
The following chart will explain everything you re seeing in the App Map rendering. Map details Comments Lines The weights of lines between your app and its related services indicate their relative throughput: thick, thin, dotted. Icons Related services include icons to identify them; for example, New Relic apps, webpages, tools, etc. Color The service s label is color coded to indicate its current alert status: Green: Live Yellow: Caution Red: Critical Gray: Inactive Active users The App Map lists the number of active users for your mobile app for the selected versions and time period. (To change these settings, use the Versions menu and time picker below the New Relic title bar). Network error rate percentage To view summary percentages for your mobile app and each related service, from the New Relic menu bar, select Mobile > (selected app) > Mobile > Errors. Average response time The title for each service includes this value. Requests per minute (rpm) This value appears below the service s name. Throughput This appears as a chart below the service s name. 22
CHAPTER SEVEN: Usage Spot trends and make better business decisions New Relic Mobile doesn t just help you streamline performance monitoring and troubleshoot problems faster; it also gives you valuable insight into who is using your app and which versions of your app are most popular. In this way, New Relic Mobile can also be used for spotting trends and making hard-hitting business decisions. App Version Comparison Want to compare the adoption and performance between different versions of your app? From the New Relic menu bar, select Mobile > (selected app) > Usage > Versions. The versions analysis provides a list of all versions of your app that have been detected, plus overview information on all versions active in the last 7 days. Use any of New Relic s standard user interface functions and dashboard features to drill down into detailed information. Tip: To view the average number of active users per minute for a specific version, point to any place on the chart. 23
Monthly Uniques Report If you re curious to see how many unique devices are accessing your app each month, check out the monthly uniques report. This shows you a bar chart tracking the number of devices running your app each month over the last year. To view the report: From the New Relic menu bar, select Mobile > (selected app) > Usage > Monthly uniques. To see the total number of unique devices for any month, hover over the month s bar in the chart. Use any of New Relic s standard user interface features and dashboard features as available to drill down into detailed information. A couple things to keep in mind about New Relic s monthly uniques report: New Relic does not use hardware identifiers for unique install tracking. On ios we use the OpenUDID library. On Android we generate a unique GUID when the application is installed. The current month s device count is a month-to-date value and does not include the full month s usage. 24
CHAPTER EIGHT: Maintenance Keep things in tip-top shape Things change, and so will your mobile app and its monitoring needs. Here are a couple tips and tricks for maintaining your monitored apps in New Relic Mobile. Renaming an App You can change your mobile app s name in the New Relic user interface at anytime, and New Relic will continue to collect, aggregate, and report data to your app based on the application token used when configuring your mobile app. You do not need to change any code in your application. Heads-up: Data reported from your mobile app is tied to a named app based on the application token. All apps with a single application token will report into the same app in the New Relic Mobile user interface, regardless of the app s name when installed on a mobile device. To rename your mobile app: 1. From the New Relic menu bar, select Mobile > (selected app) > Settings > Application. 2. Type a new name. 3. Click Save settings. Tip: After New Relic Mobile starts to receive data for an app, you can also click its gear icon on the Mobile list to change its name, change its alert settings, or delete it. Deleting an App If you decide you d like to delete an app in New Relic, first be cautioned: When you delete a mobile app, New Relic Mobile will remove it from your list of available mobile applications, and that name no longer is available to use. New Relic will also stop collecting data from installed applications that use the deleted app s application token. You must be the account s Admin to delete a mobile app. 1. From the New Relic menu bar, select Mobile. 2. From the list of mobile apps, click the gear icon for the app you want to delete. 3. Select Delete app, and then select OK at the confirmation prompt to continue or select Cancel to keep the app. Tip: To restore (or completely remove) a deleted mobile app, get support at support.newrelic.com. 25
Viewing an App s Token New Relic will automatically assign a unique, 40-character hexadecimal string for each mobile app you add for monitoring. This application token is similar to a New Relic license key and is required to authenticate your app with New Relic Mobile. To view your application token,go to Mobile > (selected app) > Settings, then select Application or Installation. Heads-up: Data reported from your mobile app is tied to a named app based on the application token. All apps with a single application token will report into the same app in the New Relic Mobile user interface, regardless of the app s name when installed on a mobile device. If you need to change an application token, get support at support.newrelic.com. Customizing App Settings Want to change your mobile app s name, alert conditions, or any other settings? From the New Relic menu bar, go to Mobile > (selected app) > Settings. Tabs are available to maintain your mobile app settings: To change your mobile app s name in the New Relic website, select Application. To change the Caution and Critical alert conditions for HTTP status code error rates, network failure error rates, or response time, select Alerts. To turn on or turn off alert notifications for your mobile app, select Installation. To view your mobile app s authentication token, select Application or Installation. To change another mobile app s settings, select your choice from the drop-down menu next to the currently selected mobile app s name. To upgrade the New Relic SDK in your mobile app, select Upgrade. Tip: You can also click the gear icon for an app on the Mobile list to change the application name or alert settings. 26
Conclusion Woohoo! You re now armed with the power and wisdom to take your mobile apps from great to AWESOME. As long as you re taking full advantage of New Relic Mobile, you should be well on your way toward improved performance, fewer problems, and happier mobile customers. And if at any time you have trouble with New Relic or have any questions not answered in this guide, check out the complete documentation at https://docs.newrelic.com/docs. If you need additional help, get support at support.newrelic.com. 27