![]() |
VOOZH | about |
To set up Cloud Cost Management in Datadog, you need:
You can setup using the API, Terraform, or directly in Datadog by following the instructions below.
Navigate to Setup & Configuration, add an AWS account and follow the steps to configure the AWS integration.
Note: Datadog recommends configuring a Cost and Usage Report from an AWS management account for cost visibility into related member accounts.
If you send a Cost and Usage Report from an AWS member account, ensure that you have selected the following options in your management account’s preferences:
These settings ensure complete cost accuracy by allowing periodic cost calculations against the AWS Cost Explorer.
The CloudFormation stack can be configured in three ways depending on your existing AWS resources:
Enter the following details for your Cost and Usage Report:
us-east-1./ (such as / or /cost), or ending with / (such as cost/). Prefixes containing / in the middle are supported (such as cost/hourly).Note:
The Terraform configuration supports three setups depending on your existing AWS resources:
Note: If using an existing bucket, verify that AWS has permission to write CURs to it. If not, you may need to update your bucket’s policy.
Enter the following details for your Cost and Usage Report:
us-east-1./ (such as / or /cost), or ending with / (such as cost/). Prefixes containing / in the middle are supported (such as cost/hourly).Note:
In the CCM Terraform setup UI, follow the instructions in the Apply Terraform Configuration step. Resolve any issues that appear while running terraform plan or terraform apply before returning to CCM to confirm account creation.
Create a Legacy Cost and Usage Report in AWS under the Data Exports section.
Select the Export type Legacy CUR export.
Select the following content options:
Select the following delivery options:
If you have navigated away from the report that you created in the prerequisites section, follow AWS documentation to view your Data Exports. Select the legacy CUR export that you created, then select Edit to see the details of the export.
To enable Datadog to locate the Cost and Usage Report, complete the fields with their corresponding details:
us-east-1./ (such as / or /cost), or ending with / (such as cost/). Prefixes containing / in the middle are supported (such as cost/hourly).Note: Datadog only supports legacy Cost and Usage Reports (CURs) generated by AWS. Do not modify or move the files generated by AWS, or attempt to provide access to files generated by a third party.
Create a policy in AWS to ensure Datadog has permissions to access the CUR and the S3 bucket it is stored in. Use the following JSON:
{"Version": "2012-10-17","Statement": [{"Sid": "DDCloudCostReadBucket","Effect": "Allow","Action": ["s3:ListBucket"],"Resource": "arn:aws:s3:::BUCKETNAME"},{"Sid": "DDCloudCostGetBill","Effect": "Allow","Action": ["s3:GetObject"],"Resource": "arn:aws:s3:::BUCKETNAME/REPORT_PREFIX/REPORT_NAME/*"},{"Sid": "DDCloudCostCheckAccuracy","Effect": "Allow","Action": ["ce:Get*"],"Resource": "*"},{"Sid": "DDCloudCostListCURs","Action": ["cur:DescribeReportDefinitions"],"Effect": "Allow","Resource": "*"},{"Sid": "DDCloudCostListOrganizations","Action": ["organizations:Describe*","organizations:List*"],"Effect": "Allow","Resource": "*"}]}Note: Make note of the name you created for this policy for next steps.
Attach the new S3 policy to the Datadog integration role.
Note: It may take between 48 and 72 hours for all available data to populate in your Datadog organization after a complete Cost and Usage Report is generated. If 72 hours have passed and the data has still not yet populated, contact [Datadog Support][18].
Cloud Cost Management generates some recommendations from data sourced from AWS Cost Optimization Hub. For Datadog to receive these recommendations, the Datadog AWS integration IAM role must include the following permissions:
cost-optimization-hub:GetRecommendationcost-optimization-hub:ListRecommendationsThese permissions are part of the default AWS integration IAM policy. If you configured the AWS integration recently with the CloudFormation or Terraform templates, you have these permissions already.
If you set up the AWS integration before these permissions were added to the default policy, update your IAM policy to include them. For the current policy, see the Amazon Web Services integration documentation.
Use Account Filtering to control which AWS member accounts to pull into Cloud Cost Management. Filtering out accounts does not incur additional Datadog costs.
Using Account Filtering requires an AWS management account. You can configure account filters after an account has been configured in Cloud Cost Management.
Note: Account filters are not supported for tag search.
Navigate to Cloud Cost > Settings, select Accounts, and then click Manage Account for the management account you want to filter.
Click Billing dataset to access the Account Filtering UI.
If you configure a Cost and Usage Report that already has historical data available in S3, Datadog automatically ingests up to 15 months of historical cost data.
If your newly configured report does not have historical data, you can request a backfill from AWS:
To request a backfill of historical AWS cost data:
When the data is backfilled by AWS, Datadog automatically ingests the data within 24 hours.
AWS cannot backfill cost data that predates your AWS account or reflects a previous AWS Organizations structure.
For more information, see the AWS Cost and Usage Reports troubleshooting guide.
Visualize your ingested data using out-of-the-box cost types. The cost types differ mainly in how they report on discount rates, savings plans and reservations.
On-demand costs represent the cost of usage at the public, on-demand rate published by AWS. This excludes all savings plans, reservations, discounts, taxes, and fees.
Note: In most cases, on-demand costs are not a reliable source to estimate actual costs.
Amortized cost metrics distribute commitment savings throughout the discount term. This is also called accrual basis. Reservations and savings plans are drawn down from a monthly commitment and applied directly to covered usage, at the time of usage. Any unused remainder appears as a fee.
In contrast, unblended cost metrics show all charges on the date that they are incurred. This is also called cost basis. Reservation and savings plan fees show up on the date they were charged, and are not applied directly to covered usage. After billing data for a month is finalized, unblended metrics match the AWS invoice exactly.
Net costs apply private discounts directly to usage. The cost of usage for a specific resource represents the effective cost after all savings are realized.
In contrast, other metrics show private discounts as separate, negative-valued line items with no resource attribution tags. Rather than attributing the discounts directly to usage, those metrics subtract discounts from the total cost.
Net amortized costs provide the most accurate representation for cost allocation, with all savings applied directly to usage. Net cost metrics are available if your AWS account has privately negotiated enterprise discounts. If your account does not have enterprise discounts, then net amortized cost and amortized cost are equivalent.
Container allocation metrics contain all of the same costs as the AWS metrics, but with additional breakdowns and insights for container workloads. See container cost allocation for more details.
The following scenario demonstrates how different cost types behave. Imagine you have:
Here’s how the instance cost, savings plan hourly commitment, and discount appear in each cost type:
| Cost type | Usage | Savings Plan | Discount | Explanation |
|---|---|---|---|---|
| On Demand | $3.00 | This is the public on-demand rate. | ||
| Unblended | $3.00 | $2.00 | -$0.20 | Savings plan recurring fee and EDP discount are separate line items, not associated with a specific resource. (Note: the $3 resource cost is offset with SavingsPlanNegation.) |
| Net Unblended | $1.80 | Savings plan recurring fee appears as a line item with the discount applied; the cost is not associated with a specific resource. | ||
| Amortized | $2.00 | -$0.20 | Savings plan discount is applied directly to the resource cost. EDP discount is a separate line item. | |
| Net Amortized | $1.80 | Savings plan and EDP discounts are applied directly to resource cost. | ||
| Net Amortized - Shared Resources Allocated | $1.80 | The same cost as Net Amortized, but this cost can be further broken down by Kubernetes dimensions and pod tags. |
In general:
aws.cost.net.amortized.shared.resources.allocated provides the most complete cost allocation for specific workloads and teams.aws.cost.net.amortized.aws.cost.amortized.shared.resources.allocated or aws.cost.amortized.| Metric | Description |
|---|---|
aws.cost.net.amortized.shared.resources.allocated | All of your AWS net amortized costs, with additional breakdowns and insights for container workloads. Requires container cost allocation. |
aws.cost.net.amortized | Net amortized costs, without container cost breakdowns. |
aws.cost.net.unblended | Net unblended costs, without container cost breakdowns. Matches the AWS invoice, with specialized discounts pre-calculated within usage costs. |
aws.cost.amortized.shared.resources.allocated | All of your AWS amortized costs, with additional breakdowns and insights for container workloads. Requires container cost allocation. |
aws.cost.amortized | Amortized costs, without container cost breakdowns. |
aws.cost.unblended | Unblended costs, without container cost breakdowns. Matches the AWS invoice. |
aws.cost.ondemand | Costs based on the list rate provided by AWS, excluding all savings plans, reservations, discounts, taxes, and fees. |
Datadog automatically enriches your AWS cost data with tags from multiple sources. For a comprehensive overview of how tags are applied to cost data, see Tags.
The following tag sources are available for AWS:
All string-valued columns from the AWS Cost and Usage Report (CUR) are added as tags on cost metrics.
To ensure consistency, Datadog normalizes tag keys using underscores and lowercase. For example, the CUR column lineItem/ResourceId maps to the tag key line_item/resource_id. Tag values are generally unmodified, maintaining exact casing and most special characters.
Examples:
| CUR Column | CUR Value | Cloud Cost Tag |
|---|---|---|
| lineItem/ResourceId | i-12345678a9b12cd3e | line_item/resource_id:i-12345678a9b12cd3e |
| product/region | us-east-1 | product/region:us-east-1 |
| product/usagetype | DataTransfer-Regional-Bytes | product/usagetype:DataTransfer-Regional-Bytes |
AWS resource tags are user-defined tags that appear in the AWS console when viewing a particular resource, such as an EC2 instance or S3 bucket.
When you enable the Datadog AWS integration, Datadog automatically collects resource tags for most AWS resources. These tags are applied to all costs found in the CUR for a given resource. Resource tags are retrieved regularly and are applied to cost data starting from the day they are created or modified. Historical tag values are not overwritten when tags change.
If the AWS integration is not enabled, you can enable resource tag enrichment by activating cost allocation tags in AWS billing. This allows you to select a subset of resource tag keys to include as columns in the AWS CUR. Datadog automatically includes those columns as tags when processing the CUR.
AWS Organizations support user-defined tags on organizational units and accounts. Datadog automatically fetches and applies these tags to cost data. Account tags are applied to all usage associated with those accounts. Organization tags are applied to all billing data for the matching payer account.
Requires the Datadog AWS Integration on the organization account.
AWS integration tags are tags set on the AWS Integration tile in the Datadog integrations page. They are applied to all costs found in the CUR for the associated AWS account.
Datadog adds out-of-the-box tags to ingested cost data to help you further break down and allocate your costs. These tags are derived from your Cost and Usage Report (CUR) and make it easier to discover and understand cost data.
The following out-of-the-box tags are available for filtering and grouping data:
| Tag | Description |
|---|---|
aws_product | The AWS service being billed. |
aws_product_family | The category for the AWS service being billed (for example, Compute or Storage). |
aws_management_account_name | The AWS management account name associated with the item. |
aws_management_account_id | The AWS management account ID associated with the item. |
aws_member_account_name | The AWS member account name associated with the item. |
aws_member_account_id | The AWS member account ID associated with the item. |
aws_cost_type | The type of charge covered by this item (for example, Usage, or Tax). |
aws_pricing_term | Whether the usage is Reserved, Spot, or On-Demand. |
aws_reservation_arn | The ARN of the Reserved Instance that the item benefited from. |
aws_savings_plan_arn | The ARN of the Savings Plan the item benefited from. |
aws_usage_type | The usage details of the item (for example, BoxUsage:i3.8xlarge). |
aws_operation | The operation associated with the item (for example, RunInstances). |
aws_region | The region associated with the item (for example, us-east-1). |
aws_availability_zone | The availability zone associated with the item. |
aws_resource_id | The resource ID associated with the item. |
aws_instance_type | The instance type of the item. |
aws_instance_family | The instance family associated with your item (for example, Storage optimized). |
aws_datatransfer_type | The type of data transfer associated with the item (for example, cross-zone or cross-region). |
aws_datatransfer_direction | The direction of data transfer associated with the item (for example, in or out). |
is_aws_ec2_compute | Whether the usage is related to EC2 compute. |
is_aws_ec2_compute_on_demand | Whether the usage is on-demand. |
is_aws_ec2_compute_reservation | Whether the usage is associated with a Reserved Instance. |
is_aws_ec2_capacity_reservation | Whether the usage is associated with a Capacity Reservation. |
is_aws_ec2_spot_instance | Whether the usage is associated with a Spot Instance. |
is_aws_ec2_savings_plan | Whether the usage is associated with a Savings Plan. |
aws_bill_entity | The AWS seller that your account is with. Transactions can either be an AWS Marketplace purchase (AWS Marketplace) or a purchase of other AWS services (AWS). |
aws_bill_type | The type of bill that this report covers (such as Purchase). |
aws_cost_type | The type of charge covering the line item (such as SavingsPlanCoveredUsage). |
aws_discount_lease_term | The length of time that a Reserved instance is reserved for. |
aws_discount_purchase_option | How you chose to pay for a reservation (such as All Upfront). |
aws_ec2_compute_product_family | The type of usage for an EC2 Compute line item (such as BoxUsage or SpotUsage). |
aws_pricing_usage_unit | The pricing unit that AWS used for calculating the usage cost (such as Hours). |
aws_reservation_modification_status | Indicates whether the RI lease was modified or unaltered (such as Manual). |
bill/billing_entity | The AWS seller that your account is with. Transactions can either be an AWS Marketplace purchase (AWS Marketplace) or a purchase of other AWS services (AWS). |
bill/bill_type | The type of bill that this report covers (such as Purchase). |
bill/invoicing_entity | The AWS entity that issues the invoice. |
bill/payer_account_id | The account ID of the paying account. For an organization in AWS Organizations, this is the account ID of the management account. |
is_aws_ec2_compute_savings_plan | true for line items that represent EC2 Compute usage, paid for using a Savings Plan. |
line_item/currency_code | The currency that this line item is shown in (USD by default). |
line_item/legal_entity | The provider of your AWS services. |
line_item/line_item_type | The type of charge covered by the line item (such as Credit). |
line_item/operation | The specific AWS operation covered by the line item (such as RunInstances). |
line_item/product_code | The code of the product measured (such as Amazon EC2 for Amazon Elastic Cloud Compute). |
line_item/resource_id | The individual resource ID associated with the line item (Optional). |
line_item/tax_type | The type of tax that AWS applied to the line item. |
line_item/usage_account_id | The ID of the account that used the line item. |
line_item/usage_type | The usage details of the line item (such as USW2-BoxUsage:m2.2xlarge). |
pricing/lease_contract_length | The length of time that the RI is reserved for. |
pricing/purchase_option | How you chose to pay for the line item (such as All Upfront). |
pricing/term | Whether your AWS usage is Reserved or On-Demand. |
pricing/unit | The pricing unit that AWS used for calculating the usage cost (such as Hours). |
reservation/availability_zone | The availability zone of the resource associated with the line item (such as us-east-1). |
reservation/modification_status | Shows whether the RI lease was modified or unaltered (such as Manual). |
reservation/reservation_arn | The ARN of the RI that the line item benefited from. |
reservation/subscription_id | The unique ID that maps the line item with the associated offer. |
savings_plan/instance_type_family | The instance family that is associated with the specified usage (such as m4). |
savings_plan/offering_type | The type of Savings Plan purchased (such as ComputeSavingsPlans). |
savings_plan/payment_option | The payment options available for the Savings Plan (such as All Upfront). |
savings_plan/purchase_term | Describes the duration or term of the Savings Plan (such as 1yr). |
savings_plan/region | The AWS Region that hosts the AWS services (such as US East (N. Virginia)). |
savings_plan/savings_plan_arn | The unique Savings Plan identifier. |
Viewing costs in context of observability data is important to understand how infrastructure changes impact costs, identify why costs change, and optimize infrastructure for both costs and performance. Datadog updates resource-identifying tags on cost data for top AWS products to simplify correlating observability and cost metrics.
For example, to view cost and utilization for each RDS database, you can create a table with aws.cost.amortized, aws.rds.cpuutilization, and aws.rds.freeable_memory (or any other RDS metric) and group by dbinstanceidentifier. To see Lambda usage and costs side by side, you can graph aws.lambda.concurrent_executions and aws.cost.amortized grouped by functionname.
The following out-of-the-box tags are available:
| AWS Product | Tag |
|---|---|
| ec2 | instance_id |
| s3 | bucketname |
| rds | dbinstanceidentifier |
| lambda | functionname |
| dynamodb | tablename |
| elasticache | cacheclusterid |
| cloudfront (distribution) | distributionid |
| cloudfront (function) | functionname |
| ec2 natgateway | natgatewayid |
| redshift | clusteridentifier |
| kinesis | streamname |
| queue | queuename |
| sns | topicname |
| elb (application, gateway, network) | loadbalancer |
| elb (all other costs) | loadbalancername |
Container cost allocation adds tags from the workloads incurring cost. Examples include tags from Kubernetes pods and nodes and ECS tasks and containers.
Requires container cost allocation, and applies only to shared.resources.allocated metrics.
Finally, all of your tag pipeline rulesets are applied, providing complete cost allocation when infrastructure tagging is not possible. Tag pipelines are the final enrichment layer and add new tags to your cost data.
AWS Billing Conductor is a custom billing service for AWS Marketplace Channel Partners and organizations that have chargeback requirements. Billing Conductor enables customers to create a second, pro forma version of their costs to share with their customers or account owners. Billing rates, credits and fees, and overhead costs can be customized at your discretion. You can also select which accounts to include in the CUR.
Important limitations:
To create a billing conductor CUR, follow the AWS Cost and Usage Reports user guide. Ensure the CUR meets Datadog’s requirements. After the billing conductor CUR is created, follow the Cloud Cost Management instructions above to set it up in Datadog.
Additional helpful documentation, links, and articles:
| |