AWS Billing monitoring integration

Access to this feature depends on your subscription level. Requires Infrastructure Pro.

New Relic Infrastructure integrations include an integration for reporting your AWS Billing data to New Relic products. This document explains how to activate this integration and describes the data that can be reported.

Features

New Relic's AWS Billing integration collects financial data for all your applications and AWS accounts, and then groups it in one place to make it easier for teams to gain cost visibility. This integration collects data from different sub-accounts and services, and also evaluates your AWS budgets in terms of actual spend and forecasted spend.

For a practical look at how to set up and use this integration, read the AWS Billing integration blog post.

Requirements

Before you enable AWS budgets, you must:

  • Set up an AWS budget through AWS Console for New Relic to collect AWS Billing data.
  • Enable the Receive billing alerts checkbox in AWS console > Billing > Preferences.

Enable AWS budgets

Enabling AWS budgets allows New Relic to capture service consumptions as well as usage and costs information for the budgets you configured in AWS.

If you have not created a role in AWS, follow the procedure to connect AWS to New Relic Infrastructure before configuring a budget policy.

  1. From the AWS Management console, select Services > IAM > Roles.
  2. Select the role you have configured for New Relic, then select Permissions.
  3. From the selected role's Inline policy tab, select the expand down-arrow icon if one already exists, or select the option to add a new inline policy to the role.
  4. Select the option to add a custom policy.
  5. Enter a new custom policy name; for example, NewRelicBudget.
  6. Enter the following permission statement in the Policy Document:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "budgets:ViewBudget"
          ],
          "Resource": "*"
        }
      ]
    }
    
  7. Save your changes.

If you're configuring New Relic to fetch AWS budgets data from an AWS member account, make sure that the account owner has activated IAM user access to the Billing and Cost Management console.

Find and use data

To find your integration data in Infrastructure, go to infrastructure.newrelic.com > Integrations > Amazon Web Services and select one of the AWS Billing integration links.

For general information about how to find and use integration data, see Understand integration data.

In New Relic Insights, data is attached to the FinanceSample event type. That event type can have four different provider values, depending on the type of billing data:

Details for these types of billing data and how to query them in Insights are below:

Budgets

Data from the BillingBudget provider is related to AWS budgets. This data allows you to monitor:

  • Money spent on a budget
  • Limits you set for each budget
  • Forecasted expenses

You can configure budgets based on usage or expense, in different currencies, or for a monthly, quarterly, or annual time period. Budgets are a great tool to monitor and control costs and take advantage of the AWS predictive model to see forecasted costs.

NRQL example: For a table of different budgets with actual spend, forecast, limits, and usage vs. monetary cost, run the following NRQL query in New Relic Insights:

SELECT latest(`provider.budgetType`) as 'Budget Type',
	max(`provider.actualAmount`) as 'Actual Amount',
	max(`provider.limitAmount`) as 'Budget Limit',
	latest(`provider.forecastedAmount`) as 'Forecast' 
FROM FinanceSample 
WHERE provider='BillingBudget' 
AND providerAccountId = 'YOUR_AWS_ACCOUNT_ID' 
FACET `provider.budgetName` 
SINCE 1 day ago
Aggregated service costs

The data stored in the BillingServiceCost provider is aggregated for service costs containing the latest and most recent data for all AWS service costs in all registered accounts.

If you have configured multiple AWS accounts, New Relic recommends filtering by each account with the attribute providerAccountName or providerAccountId.

NRQL example: To group providers by service names, run the following NRQL query in New Relic Insights:

SELECT latest(`provider.estimatedCharges.Maximum`) 
FROM FinanceSample  
WHERE provider='BillingServiceCost' 
AND providerAccountId = 'YOUR_AWS_ACCOUNT_ID' 
SINCE 1 day ago 
FACET `provider.serviceName` 
LIMIT 20
Aggregated account/subaccount costs

The BillingAccountCost provider stores aggregated data for account and sub-accounts containing the latest and most recent aggregate of financial data. Please bear in mind that if you have many AWS Accounts configured it is recommended to filter by each account with the attribute providerAccountName or providerAccountId.

NRQL example: To group providers by account names, run the following NRQL query in New Relic Insights:

SELECT latest(`provider.estimatedCharges.Maximum`) 
FROM FinanceSample  
WHERE provider='BillingAccountCost' 
AND providerAccountId = 'YOUR_AWS_ACCOUNT_ID'  
SINCE 1 day ago 
FACET `provider.accountId` 
LIMIT 20
Unaggregated account/subaccount and AWS service costs

The BillingAccountServiceCost provider contains unaggregated data filterable by AWS account ID or AWS service name.

NRQL example: To understand the cost split of AWS services for a particular AWS account ID, run the following NRQL query in New Relic Insights:

SELECT latest(`provider.estimatedCharges.Maximum`) 
FROM FinanceSample 
WHERE provider='BillingAccountServiceCost' 
AND providerAccountId = 'YOUR_AWS_ACCOUNT_ID'  
SINCE 1 day ago 
FACET `provider.serviceName`
LIMIT 100

NRQL example: To understand the cost split of AWS accounts for your AWS EC2 service, run the following NRQL query in New Relic Insights:

	SELECT latest(`provider.estimatedCharges.Maximum`) 
	FROM FinanceSample 
	WHERE provider='BillingAccountServiceCost' 
	AND providerAccountId = 'YOUR_AWS_ACCOUNT_ID' 
	AND `provider.serviceName`='AmazonEC2' 
	FACET `provider.accountId` 
	SINCE 1 day ago 
	LIMIT 100

Configuration and polling

You can change the polling frequency and filter data using configuration options.

Default polling information for the AWS Billing integration:

  • New Relic polling interval: 1 hour
  • Amazon CloudWatch data interval: 4 hours

Metric data

The New Relic Infrastructure AWS Billing integration collects the following metric data:

Data Description
AWS Billing metrics

EstimatedCharges: The estimated charges for your AWS usage. This can either be estimated charges for one service or a rollup of estimated charges for all services.

AWS Budgets metrics
  • actualAmount: The actual cost or usage being tracked by a budget.
  • limitAmount: The total amount of cost or usage that you want to track with a budget as an upper limit.
  • forecastedAmount: The forecasted cost or usage being tracked by a budget.
Service metrics
  • Active Service: The number of services that are running on the cluster in an ACTIVE state.
  • Pending Tasks: The number of tasks in the cluster that are in PENDING state.
  • Running Tasks: The number of tasks in the cluster that are in RUNNING state.
  • Registered Instances: The number of container instances registered into the cluster.

Inventory data

Inventory data provides information about the service's state and configuration. For more about inventory data, see Understand and use data.

Name Description
/budgets
  • name: The name of a budget. Unique within accounts.
  • startTime: Start date for the period of time covered by a budget.
  • endTime: End date for the period of time covered by a budget.
  • limitAmount: The total amount of cost or usage that you want to track with a budget as an upper limit.
  • limitUnit: The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB.
  • timeUnit: The length of time until a budget resets the actual and forecasted spend. Valid values: monthly, quarterly, annually.
  • type: Whether this budget tracks monetary cost or usage.
/budgets/costFilters

name: The name of a budget. Unique within accounts.

Other system data

The AWS Billing integration also collects the following attributes:

Attributes Description
AWS Billing attributes
  • Service Name: The name of the AWS service. This dimension is omitted for the total of estimated charges across all services.
  • Linked Account: User-generated string to identify the cluster.
  • Currency: Required. The monetary currency to bill the account (unit = USD).
AWS Budgets attributes
  • budgetName: The name of a budget. Unique within accounts
  • budgetType: Whether the budget tracks monetary cost or usage

For more help

Recommendations for learning more: