The usage UI displays your data ingest over time. If you need more detail than the UI provides, you can use NRQL queries like these:
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.
Synthetics usage
There are a certain number of synthetics checks included for free with each edition. For details on that, see Synthetics limits.
The NrDailyUsage event is the event type that can best help you understand synthetics usage. It's generated once per day. Usage timestamps correspond to the time that New Relic receives and processes a synthetic check. This may introduce a slight difference in usage data compared to the time the synthetic check was executed.
By using FACET, you can break your consumption into multiple categories, including account, location, monitor type, and monitor name. If you have a parent account structure, ensure you run queries in a parent account to see the aggregated usage for that parent and its child accounts.
Both successful and failed checks contribute to overall synthetics consumption. Below are sample queries to view and facet your synthetics consumption:
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 1 month ago
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 6 months ago FACET monthOf(timestamp)
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 1 month ago FACET consumingAccountName
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 1 month ago FACET syntheticsTypeLabel
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 1 month ago FACET syntheticsMonitorName
SELECT (sum(syntheticsFailedCheckCount) + sum(syntheticsSuccessCheckCount)) AS 'Total Checks' FROM NrDailyUsage WHERE syntheticsTypeLabel != 'Ping' SINCE 1 month ago FACET syntheticsLocationLabel
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.
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
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
User queries for organizations without core users
These queries apply for some older New Relic organizations that have only two user types available: basic users and full platform users.
For organizations that don't have core users enabled, here are some rules for querying your users:
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
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
Cost-related queries
Here are some query recommendations for helping you understand the estimated cost for the current month.
Here's a query for arriving at an estimate of your data ingest cost for the current month. 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
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 our usage-based 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 was 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, 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, FullPlatformUsers, 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 used.