Customize and query mobile app data (React Native)


If your mobile app is monitored by React Native, you can use any of the standard options to add custom data to New Relic Mobile apps, including session data, custom breadcrumbs, custom interactions, and custom events. You can also customize the data you want to record and query for mobile apps monitored by React Native.

View and use custom data

You can view your data in the New Relic Mobile UI and query your data with NRQL. For example, default and custom data appears in these Mobile UI pages:

React Native events and attributes

In New Relic, attributes are key-value pairs containing information that determines the properties of an event. The specific details can help you gain greater insight into your mobile application.

Except for MobileRequest and MobileRequestError events, you can use the default events for iOS and Android apps monitored by New Relic Mobile with the same data retention. The React Native agent also supports the following attributes, where the event type is MobileJSError and the data source is Mobile.

MobileJSError attributes Description

Build number

Type: Static


Cluster agent ID

Type: Static


Android: Version name

iOS: NS short bundle version

Type: Static


Set by the agent

Type: Static


Set by the agent

Type: Static


Android: Duplicate of deviceManufacturer

iOS: Device

Type: Static


Android: Randomly generated GUID

iOS: Vendor ID

Type: Static


Set by the agent

Type: Static


Set by the agent

Type: Static


Set by the agent

Type: Static


Legacy agent used for checking if we are on Unity or other third party platform

Type: Static


The iOS or Android app version

Type: Static

To receive alert notifications about fatal JS errors, create a NRQL baseline condition.

NRQL query examples

Here are some example NRQL queries when using the MobileJSError event and default attributes.

Before creating custom attributes, review New Relic's list of reserved terms used by NRQL and Insights. Otherwise unexpected results may occur.

JS error rate per app version

To get the JS error rate per app version:

SELECT filter(count(*), where eventType() = 'MobileJSError')/filter(count(*), WHERE eventType() = 'MobileSession') as 'JS Error Rate' FROM MobileJSError, MobileSession FACET `appVersion` SINCE 3 days AGO LIMIT 5
Time series view of JS errors

To get a time series view of JS errors:

SELECT filter(count(*), where eventType() = 'MobileJSError') as 'JS error count', filter(count(*), WHERE eventType() = 'MobileSession') as 'MobileSession Count' FROM MobileJSError, MobileSession  SINCE 3 days AGO LIMIT 5 TIMESERIES

For more help

During the public beta, we welcome your questions and comments through the React Native beta discussion board in New Relic's Explorers Hub. Support requests also will be routed there.