Create New Relic cost alert on New Relic cost

I need to create alert on NewRelic Cost. This alert should be for a monthly timeframe
As NewRelic doesn’t support alert on that duration so I believe I need to use NerdGraph API for this.
I am finding it very difficult to extract this information I feel the documentation is not much of help in this case.

I was able to use NRQL to get data injected and user count which is key factors I believe in NewRelic cost. But was not able to get the exact cost of NewRelic. In any case, because of the alert timeframe limitations, I believe NRQL will not work for us.

Hi @muda

The recommendation is to alert on the NrMtdConsumption event type. This tracks the current total up until now for the current month.

So if for example you have set a monthly budget for your New Relic usage of ~ $2000, then you can set up an alert on the MTDConsumption event to trigger when you hit perhaps $1700. That will fire at any point in the current month when the budget is breached.

See some examples here: Query and alert on billing/usage data | New Relic Documentation

1 Like

Hi RyanVeitch,

I had tried NrMtdConsumption but non of them come close to the monthly cost we are getting. I have tried to use billableConsumption, estimatedCost.

estimated cost seems to go up to 100 which is very far from the actual cost
billableConsumption is also showing half the amount

Do I need to calculate this using multiple parameter to get the actual cost

Hi RyanVeitch,

Second question how to get the cost of single billable user or combine cost of all billable user

Hey @muda

Here are a couple of queries you can use →

Note that different subscription levels have different user costs - you should substitute your per user cost in to these queries.

User costs:

FROM NrMTDConsumption SELECT latest(FullUsers) * INSERT_YOUR_USER_COST SINCE last month UNTIL this month COMPARE WITH 1 month ago

Overall break down:

SELECT (filter(sum(GigabytesIngested), WHERE productLine = 'DataPlatform') - 100) * 0.25 + filter(average(FullUsers) * INSERT_YOUR_USER_COST , where metric= 'FullUsers') as 'Total $', filter(sum(GigabytesIngested), WHERE productLine = 'DataPlatform') as 'Gbs Ingested', (filter(sum(GigabytesIngested), WHERE productLine = 'DataPlatform') - 100) * 0.25 as 'Gbs Ingested $', filter(average(FullUsers), where metric= 'FullUsers') as 'Full Users', filter(average(FullUsers) * INSERT_YOUR_USER_COST , where metric= 'FullUsers') as 'Full Users $' FROM NrConsumption FACET monthOf(timestamp) SINCE this year
1 Like