Understand Your Kubernetes and ECS Spend With Datadog Cloud Cost Management | Datadog

Understand your Kubernetes and ECS spend with Datadog Cloud Cost Management

Author Aaron Kaplan
Author Kayla Taylor
Author Tyler Edelen

Published: 6月 7, 2023

Rising container usage has fueled a growing reliance on container orchestration systems such as Kubernetes, EKS, and ECS. As organizations increasingly opt to run these systems in the cloud, their cloud spend tends not only to grow but also to become more opaque due to the dynamic complexity of these environments. Typically, various services, teams, and products share cluster resources, and as nodes are added and removed, those resources continuously shift. As a result, attributing and allocating costs and resources becomes difficult and imprecise, often necessitating guesswork. But this lack of precision inhibits cost analysis and creates blind spots that can impede important tradeoffs between performance and spend.

We’re happy to announce that Datadog Cloud Cost Management now offers support for EKS, ECS, and Kubernetes in AWS, enabling you to eliminate guesswork in order to allocate costs and provision shared resources with confidence. By leveraging Datadog’s existing observability data, Cloud Cost Management is able to calculate container costs with granular precision—at the pod or task level—and clearly map Kubernetes and ECS costs to your services, products, and teams.

In this post, we’ll show you how Datadog Cloud Cost Management can help you:

Understand the true costs of your containerized applications

The costs of using container orchestration platforms like Kubernetes, EKS, and ECS primarily boil down to the costs of operating each of the nodes that comprise your clusters. Yet, for most users of these systems, what’s key is to understand the true costs of each of their applications and services, and not just the lump-sum costs of their underlying infrastructure. Organizations must be able to allocate costs to specific teams, services, and products in order to determine business margins, enact chargeback and showback policies, and assess the overall health of applications, making it critical to have a clear view of cloud spend.

If you’re monitoring Kubernetes, EKS, or ECS in Datadog, Cloud Cost Management enables you to precisely analyze the costs of your containerized workloads and attribute those costs to specific teams and resources within your organization. This precision is critical for service owners, as well as for the teams relying on these platforms, since it enables them to see precisely how their usage of these platforms impacts costs.

For example, let’s say you’ve provisioned a Kubernetes cluster running on EC2 instances. Ordinarily, many organizations would allocate the cost of operating that entire cluster to an infrastructure or Ops team, despite the fact that many different teams might utilize its resources to varying degrees. With Cloud Cost Management, you can isolate Kubernetes costs in your bill with the is_kubernetes tag. You can then use the aws.cost.amortized.cpu.allocated and aws.cost.amortized.mem.allocated metrics and group them using the team and service tags to see how much individual services and teams contribute to those costs. (Datadog’s automatic ingestion of tags on Kubernetes pods and nodes facilitates this allocation.)

Cloud Cost Management uses metrics collected by the Datadog Agent to derive the cost of each of your workloads by comparing the amount of CPU and memory reserved by each pod with the actual cost of its EC2 instance. It measures these base costs precisely, rather than basing them on generalized instance types, by combining data from your AWS Cost and Usage Reports with the data our agent collects on your containers. And it enables you to break these costs down in order to better understand the costs of your memory and CPU usage via the aws.cost.amortized.cpu.allocated and aws.cost.amortized.mem.allocated metrics, which track the amortized costs of the CPU and memory reserved and used by each of your pods or tasks.

Cloud Cost Management helps you derive the true costs of your services by analyzing not only your container usage but other parts of your bill, as well. For example, service tags enable you to isolate the costs of running individual services in Kubernetes and to identify the costs of their associated S3 buckets.

These granular insights into your organization’s container usage demystify your cloud spend, allowing you to allocate resources and manage costs confidently and precisely.

Optimize your container usage by monitoring idle spend

Cloud Cost Management also helps you analyze and improve the efficiency of your Kubernetes, EKS, and ECS resource usage by enabling you to quickly identify idle costs. For example, it lets you assess unreserved resources in your Kubernetes clusters and their costs by filtering your analytics using the is_cluster_idle tag.

Reserving a certain amount—often around 20 percent—of idle capacity is key for ensuring that your clusters have sufficient resources to accommodate expanding workloads. But if Cloud Cost Management indicates that idle resources account for a higher proportion of your cloud spend than you would expect, you may want to resize your instances accordingly. Filtering Cloud Cost Management analytics using the is_cluster_idle tag allows you to determine how much of your spend is going toward currently unreserved capacity in your Kubernetes clusters. By grouping analytics by the is_cluster_idle tag in tandem with service or workflow tags, you can differentiate between the costs of resources that are being reserved by pods or tasks and those that are unreserved. You can also identify instances that are dedicated to specific services or workflows and incurring costs for idle capacity.

Quickly zero in on the costs of your idle Kubernetes resources using Cloud Cost Management

You can also use Cloud Cost Management to identify waste by comparing the actual usage of clusters with their reserved resources. For example, you can pivot to the Kubernetes view to examine and compare clusters’ CPU and memory usage and their reserved resources. If a cluster is consistently underutilized, you may want to scale it down in order to trim unnecessary costs.

Centralize your cloud monitoring and cost management

With Cloud Cost Management’s container support, Datadog provides a unified platform for monitoring and managing your container infrastructure and its costs. Cloud Cost Management provides granular visibility into your cloud spend on EKS, ECS, and Kubernetes in AWS, allowing you to precisely attribute costs and allocate resources to specific teams, products, and services, optimize your usage of these platforms, and cultivate a culture of cost awareness among your engineering teams.

Check out our documentation to get started with Cloud Cost Management and bring clarity to your organization’s cloud spend today. If you’re new to Datadog, get started with a 14-day .