How to use the new table NrDailyUsage

New Relic recently updated the Usage page in a much more informative way, which helps us to understand how and when costs are generated. As we have to charge our users with the costs their subaccounts create with New Relic we want to provide a dashboard, where they can follow their ressource consumption at New Relic.

In order to proof that our NRQL is correct we try to match our results with the ones shown by the system provided.

This NR view https://account.newrelic.com/accounts/1510441/usage/unified shows 7.28 B Insights events for the last 30 days (on July 25th).

This query
SELECT latest(insightsTotalEventCount) from NrDailyUsage where productLine = 'Insights' since 30 days ago
gives a totally different result ( 1.1 B ) which is completlly unreasonably small… It is slightly modified with a where clause from the documentation for current Insights usage from
https://docs.newrelic.com/docs/accounts/new-relic-account-usage/insights-usage/insights-usage-attributes-queries#query-examples

When we try to get the Insights events by account, we also fail completely. As base value we take the ones from this view: https://account.newrelic.com/accounts/1510441/usage/unified/insightsEvents where stored Insights events are listed by account.

Here e.g. the biggest account is shown with 3.06 B events for the last 30 days.

We tried these queries:
SELECT latest(insightsTotalEventCount) from NrDailyUsage facet consumingAccountName where productLine = 'Insights' since 30 days ago limit 500
but this delivers 2.5 B events for the same account. Here one subaccount would have more events than the whole account. Even if the first query would return the accidentially latest record for any subaccount (instead of summarizing over all subaccounts) , this is not plausible, because I cannot find a subaccount which has the number of events from the first query.

To be honest, we are quite confused about the data model in NrDailyUsage. Could you please help to understand the data model and how we could recreate the numbers shwon on usage view.

If we use the example from the docu Paid Insights Pro usage by sub-account
SELECT sum(insightsTotalEventCount)-sum(insightsIncludedEventCount) as 'Paid events' from NrDailyUsage since 7 days ago where masterAccountId = YOUR_MASTER_ACCOUNT_ID facet consumingAccountId, consumingAccountName timeseries 1 day
and insert our Masteraccount -id, we get different values than shown here:
https://account.newrelic.com/accounts/1510441/usage/unified/insightsEvents

Thank you.

1 Like

Hello @wkiNewRelic - It looks like you created a support ticket for this post. I will be addressing the questions here in the ticket and sharing the resolution with the community.

I have the exact same questions. @dkoyano can you share your conclusions here, please?

@ernestom - Check out the Level Up post below, hopefully it can shed some light on Usage queries for you.

2 Likes

I was following your instruction for Insights usage @RyanVeitch. However, I have a doubt based on this query “SELECT rate(SUM(insightsTotalEventCount - insightsIncludedEventCount), 1 day) as usage FROM NrDailyUsage WHERE productLine = ‘Insights’ AND usageType = ‘Event’ AND insightsEventNamespace != ‘Tracing Spans’ SINCE ‘2018-10-01 00:00:00 -0500’ UNTIL ‘2018-11-01 00:00:00 -0600’ LIMIT 5” , why we are not taking into consideration Tracing Spans?? Thanks

Hey @cfocil - TracingSpans are not billable events, so they are hidden from the usage query.

2 Likes

Is there a way to get monthly basis the insight billeds? I tried a lot, but could not get one report by month.

@luizvictor.queiroz - You should be able to get the last 30 days on your unified usage page as documented here. However, there isn’t an automated way to get a report. Please let me know if this isn’t what you are looking or if you have additional questions.

Hi,

We cannot have access to it because our accounts are structured in a way by new Relic that only our Grand Partner has access.
Indeed, we would like to see those numbers in each dashboard, to keep a track on it by each account.

Can you help us with this?

@luizvictor.queiroz - It looks like you are a restricted user. Only Owners and Admins can view the UI as documented here. However, anyone on your account can query usage data using the NrDailyUsage Insights event and the example queries in the docs. You can also request an Admin on your account make you an Admin or do this for you.

1 Like