Mobile subscription usage attributes and queries

This document contains the attributes available for New Relic Mobile subscription usage, and provides example NRQL queries for use in Insights or API calls.

Data generation

Once per day, for every monitored application, a New Relic Mobile account will generate a NrDailyUsage Insights event. Each event will summarize the Mobile usage for the current calendar month, up to and including the last 24 hours. For more about how usage is calculated, see Calculation details.

When querying Mobile usage data, use a productLine attribute value of Mobile.

For query examples, see Mobile query examples.

General attributes

The following are general (not Mobile-specific) account-related attributes. These attributes can help you understand how your accounts and sub-accounts are using New Relic products.

Attribute Description
consumingAccountId

ID of the New Relic account that is directly responsible for the stored events, as determined from the license key used.

consumingAccountName Name of the New Relic account that is directly responsible for the stored events, as determined from the license key used.
masterAccountId

The ID of the master account that is either responsible for stored events or that is the parent of the consuming account. When a master account is the consuming account, masterAccountId is the consumingAccountId.

This attribute is present even for accounts that do not have a master account. This is to ensure continued reporting if the account is later made a master account.

masterAccountName

Name of the master account that is either responsible for stored events, or that is the parent of the consuming account. When a master account is the consuming account, masterAccountName is the consumingAccountName.

This attribute is present even for accounts that do not have a master account. This is to ensure continued reporting if the account is later made a master account.

partnershipId

Partner ID of the New Relic customer partnership associated with the account responsible for the stored events.

This attribute is only present if the consuming account is associated with a New Relic customer partnership.

partnershipName

Name of the New Relic customer partnership associated with the account responsible for the stored events.

This attribute is only present if the consuming account is associated with a customer partnership.

subAccountId

ID of the sub-account that is responsible for the stored event. When this attribute is present, subAccountId is the consumingAccountId.

This attribute is only present if the consuming account is a sub-account (not a master account).

subAccountName

Name of the sub-account responsible for stored events. When present, this attribute is the same as the consumingAccountName.

This attribute is only present if the consuming account is a sub-account (not a master account).

timestamp UNIX timestamp (seconds since epoch) of the day and time when event generation was initiated.

Mobile attributes

The following are usage-related attributes generated by New Relic Mobile. To query Mobile data, use a productLine attribute value of Mobile.

Attribute Description
mobileAppId ID uniquely identifying the application reporting this usage, as it appears in the Mobile product.
mobileAppName Name of the application reporting this usage, as it appears in the Mobile product.
mobileUniqueUsersPerMonth Number of unique users (device IDs) counted during the current calendar month to date for a Mobile app.
productLine The New Relic product the usage data is from. For Mobile data, this value is Mobile.
usageType

The type of entity this event records values for. For Mobile, this value is Application.

Query examples

Here are some examples of NRQL queries you can use with your subscription usage data. You can run NRQL queries with the Insights query tool, use the resulting charts in Insights dashboards, and use the NRQL in API calls.

Monthly active users (MAUs) for last complete month

A chart of monthly active users for the last complete month:

SELECT sum(mobileUniqueUsersPerMonth) 
FROM NrDailyUsage 
WHERE usageType='Application' AND productLine='Mobile' 
SINCE last month UNTIL this month TIMESERIES 1 day

The billable MAU number for the month is the maximum number on this chart. You can also get the billable number for a given month directly with this query, using the last day of the month in the since clause, for example:

SELECT sum(mobileUniqueUsersPerMonth) 
FROM NrDailyUsage 
SINCE '2018-05-31' UNTIL '2018-06-01'
Monthly active users (MAUs), by app, for last complete month

A count of monthly active users from the last complete month, faceted by application name:

SELECT max(mobileUniqueUsersPerMonth) 
FROM NrDailyUsage 
WHERE usageType='Application' AND productLine='Mobile' 
SINCE last month UNTIL this month 
FACET mobileAppName

The sum of these numbers will be the account's billable MAUs for the last complete month.

Unique mobile apps in the last month

This query shows a count of unique mobile applications over the past month:

SELECT uniqueCount(mobileAppName) 
FROM NrDailyUsage 
WHERE usageType='Application' AND productLine='Mobile' 
SINCE 1 month ago
Account hierarchy

This query is useful for seeing the account hierarchy (partnership, master, sub-accounts):

SELECT count(*) 
FROM NrDailyUsage 
FACET partnershipName,masterAccountName,masterAccountId,consumingAccountName,consumingAccountId 
LIMIT 1000 
SINCE 1 day ago

For more help

Recommendations for learning more: