Note that if you're on our original user model, your account hierarchy may affect your queried data. For more information, see Account structure.
Data ingest usage queries
The usage UI displays your data ingest over time. If you need more detail than the UI provides, here are some example NRQL queries:
This query totals your billable ingested data, and displays a daily value for the past three months:
FROM NrConsumption SELECT sum(GigabytesIngested)
WHERE productLine = 'DataPlatform'
SINCE 3 months ago TIMESERIES 1 day
This query totals your billable ingested data, and displays a daily value for the past three months faceted by the source:
FROM NrConsumption SELECT sum(GigabytesIngested)
WHERE productLine = 'DataPlatform' SINCE 3 months ago
FACET usageMetric TIMESERIES 1 day
This query breaks down Metric data by the top ten metric names. You could also facet by appName or host to adjust the analysis.
FROM Metric SELECT bytecountestimate()/10e8 as 'GB Estimate'
SINCE '2021-04-01' UNTIL '2021-04-08'
FACET metricName LIMIT 10 TIMESERIES 1 day
This query shows the current full platform ingested data. In other words, it shows how much you'd be billed for your data for that month if you were billed right now.
FROM NrMTDConsumption SELECT latest(GigabytesIngested)
For information about data ingest limits and query limits, see Query system limits.
User count queries
For a display of your user count, see the usage UI. If you need more detail than that, you can use the example NRQL queries below. For details about how users are calculated, see User calculations.
Here are example queries for these two pricing versions:
Important
This section applies for organizations on our primary version of New Relic One pricing, which has three user types: basic users, core users, and full platform users.
Here are some rules for querying your users:
Use only the NrMTDConsumption event.
The attributes used to query by user type are: BasicUsersBillable, CoreUsersBillable, and FullPlatformUsersBillable.
Here are some example NRQL queries for determining user count:
Month-to-date full platform users
This query shows the billable full platform users for the month. In other words, it shows how much you'd be billed for your full platform users for that month if you were billed right now.
FROM NrMTDConsumption SELECT latest(FullPlatformUsersBillable)
Month-to-date core users
This query shows the number of core users you'd be billed for if you were billed right now:
FROM NrMTDConsumption SELECT latest(CoreUsersBillable)
Estimated cost
For how to determine an estimate of the cost for your billable users, see Estimated cost queries.
Track users during the switch to core users pricing version
If your organization started out with New Relic One pricing without core users and opted in to switch to the core users release, the usage UI will track the count of your billable users over that transition. Here's an example of a query that would display the count of full platform users over that transition period:
FROM NrMTDConsumption SELECT latest(billableConsumption) as 'Full platform users' where metric in ('FullPlatformUsers', 'FullUsers') SINCE 4 month ago limit max TIMESERIES
You can use the NrMTDConsumption or NrConsumption event.
The attributes used to query by user type are: BasicUsersBillable, and FullUsersBillable.
Billable full platform users for the month
This query shows the billable full platform users for the month. In other words, it shows how much you'd be billed for your users for the current month if you were charged at that moment.
FROM NrMTDConsumption SELECT latest(FullUsersBillable)
This query shows how many full platform users were counted by hour. This is useful for seeing how the full platform user count changed over time.
FROM NrConsumption SELECT max(FullUsers) SINCE 10 days ago TIMESERIES 1 hour
Projected monthly full platform user count
This query shows a projected count of monthly full platform users. This query would not be good for using in a dashboard; it requires values based on a) the days remaining in the month, b) the start of the month. Here's an example querying the projected end-of-month count with 10 days left in that month:
FROM NrMTDConsumption SELECT predictLinear(FullUsers, 10 days) SINCE '2020-09-01'
Count of full platform users and basic users
The usage UI shows the count of full platform users and basic users. The query used is:
FROM NrUsage SELECT max(usage) SINCE 10 days ago
WHERE productLine='FullStackObservability'
WHERE metric in ('FullUsers', 'BasicUsers')
FACET metric
To see the count of full platform users and basic users over time:
FROM NrUsage SELECT max(usage) SINCE 10 days ago
WHERE productLine='FullStackObservability'
WHERE metric in ('FullUsers', 'BasicUsers') FACET metric TIMESERIES 1 hour
Estimated cost
For how to determine an estimate of the cost for your billable users, see Estimated cost queries.
Cost-related queries
In May of 2022, we're deprecating the estimatedCost attribute from usage events and removing the estimated cost for the current month from the UI (learn more). If you currently use the estimatedCost attribute in your queries or alert conditions, you should remove them, or replace them with the recommended queries below.
Here's a query for arriving at an estimate of your data ingest cost for the current month. To run this query that you'll need to know your organization's per-GB ingested data cost.
FROM NrMTDConsumption SELECT latest(GigabytesIngestedBillable)*YOUR_PER_GB_COST
The version you have dictates how you query your user count data.
Primary version, with core users
Here's a query for getting the current month's cost for your full platform users. Note that you'll have to know your organization's full platform user cost.
FROM NrMTDConsumption SELECT latest(FullUsersBillable)* YOUR_PER_FULL_PLATFORM_USER_COST
Version without core users
Here's a query for getting the current month's cost for your full platform users. Note that you'll have to know your organization's full platform user cost.
FROM NrMTDConsumption SELECT latest(FullPlatformUsersBillable)* YOUR_PER_FULL_PLATFORM_USER_COST
Here's an equivalent one for your core users:
FROM NrMTDConsumption SELECT latest(CoreUsersBillable)* YOUR_PER_CORE_USER_COST
Set usage alerts
To help manage your billing, you can set alerts to notify you of unexpected increases in data ingest or user count.
Before building usage-related alert conditions, here are some tips:
This query will create an alert when your hourly usage exceeds a fixed value:
FROM NrConsumption SELECT sum(GigabytesIngested)
WHERE productLine = 'DataPlatform'
If your organization has multiple child accounts, you may want to set threshold alerts for a specific account:
FROM NrConsumption SELECT sum(GigabytesIngested)
WHERE productLine = 'DataPlatform' AND consumingAccountId = YOUR_CHILD_ACCOUNT_ID
This query will create an alert when your usage exceeds fixed monthly threshold for GBs:
FROM NrMTDConsumption SELECT latest(GigabytesIngested)
WHERE productLine = 'DataPlatform'
This is an example for an alert query that will trigger when your user count of full platform users exceeds a certain number:
FROM NrMTDConsumption SELECT latest(FullPlatformUsersBillable)
Note that this query applies for organizations with the primary version of New Relic One pricing, with core users. For more about this and about how to query user counts, see Query users.
In May of 2022, the estimatedCost attribute will be deprecated (learn more). If you're using that attribute, you should replace it with the query recommended here.
Note that to run this query you'll need to know your organization's per-GB ingested data cost.
FROM NrMTDConsumption SELECT latest(GigabytesIngestedBillable)*YOUR_PER_GB_COST
To see changes made to your account (for example, changes related to managing users), you can query NrAuditEvent.
Usage-related data types
Tip
For an advanced deep dive into managing data ingest in a complex organization, see Data ingest governance.
Usage data is attached to the following events. For more detail on which event to use for querying users, see Query users.
NrUsage records usage every hour and is used to see the types of data being reported (for example, APM data or browser monitoring data).
NrConsumption records usage every hour, and is the equivalent of "real-time" usage. Use this event to observe usage trends over time.
NrMTDConsumption generates aggregate values from the NrConsumption event. Use this event to see usage by monthly billing period. For organizations on the core users release, this is the best event for querying user count.
Data ingest attributes
Below are some of the most important attributes attached to usage events.
Attribute
Description
productLine
The category of usage. There are three options: DataPlatform, FullStackObservability, and ProactiveDetection. (Starting November 1, 2021, IncidentIntelligence is no longer a billing factor.) For more details about these categories, see New Relic platform.
metric
This consolidates multiple categories of usage into a single metric. Helpful when faceting by productLine. It's an enum with possible values of BasicUsers, FullUsers, and GigabytesIngested. Values for the core user release include FullPlatformUsers and CoreUsers.
consumingAccountId
ID of the New Relic account directly responsible for the stored events, as determined from the license key used.