Analyze Cost Across Clusters

Updated 3 weeks ago by Archana Singh

Harness Continuous Efficiency (CE) allows you to view your cluster costs at a glance, understand what is costing the most, and analyze cost trends. CE displays the data for all your clusters and also helps you get answers for:

  • How is your cloud cost spend trending?
  • Which cluster cost the most last month or week?
  • What is the idle cost across clusters?
  • What is your primary cost contributor, for example, Kubernetes or ECS cluster, namespace, node/instances, workload/task, or label?
  • What are the forecasted future costs based on historical trends?
  • What was the cost of resources by label?
  • How much are you spending by region?

View the cost trends by selecting a date rangeGroup by, and Filter by options. Based on your selection, the table displays information of the Cluster, Region, Total costCost trend, Idle cost, and Unallocated cost and the chart displays the data based on the Group by selection. Hover over the chart to see the details. You can Group by:

  • Clusters: Total cost, Cost trend, Idle cost, and Unallocated cost for each cluster. A cluster refers to a collection of nodes that run workloads as containers in any cloud provider. Non-cluster refers to all other cloud-based services and products, such as storage, data transfer, network, and so on. The actual total cloud cost is the sum of the actual cluster and non-cluster costs. 
  • No Grouping: The cost totals for all clusters.

To get further granular details of the Cluster, click on the Cluster and select Group by:

  • Namespace: The cost of each Kubernetes namespace in the cluster. This does not apply to ECS clusters.
  • Workload: The cost of each Kubernetes workload or ECS service. You can see the workload type also. Workloads identified by Pod as Kubernetes pods or ECS tasks.
  • Label: Cost organized by the Kubernetes labels used in the workload manifests. This does not apply to ECS clusters.
  • Node: The cost of each Kubernetes node or ECS instance.
  • None: The total cost of all clusters.

  • To get details of the unallocated cost, select the checkbox Unallocated cost.
  • The cluster dashboard can list data for up to 100 resources. If there are more than 100 resources in your environment for which you want to get the details, select the checkbox Include Others. The details of these resources are clubbed and displayed as one single entity. These clusters are generally very small that it would not be visually discernible.

In this topic:

Before You Begin

The ECS clusters that you want to monitor must have a Harness Delegate associated with it. But, with AWS accounts you can get the comprehensive view of the ECS clusters without having Harness Delegate associated.

Blog Post

The following blog post walks you through optimizing Kubernetes cluster costs:

Optimizing Kubernetes Cluster Costs

Review: Cloud Cost Calculation

Cluster Cloud Cost

  • The cluster cloud cost is calculated based on the price list of the resources. For information on pricing, see the GCP price list and AWS pricing.
  • Currently, CPU and memory utilization are included in your cloud cost calculation. Storage and networking costs are not part of your cloud cost.

AWS and GCP Cloud Cost

Option 1: Analyze Cost Breakdown: Total, Idle, Utilized, and Unallocated Cost

The cost breakdown provides deep insights into your total, idle, utilized, and unallocated cloud costs. It helps you to understand your primary cost contributors. You can use this data to manage and optimize your cost and resources.

  1. In Continuous Efficiency, click Explorer and click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. Select Total cost or Idle cost from the Show data filter.
  4. In this example, the Idle cost data is displayed for the selected cluster.
  5. In addition to the Show data view, you can further customize your views using the Group by and Filter by settings to get more granular details.
  6. When you Group by a specific label, some workloads without the selected label will not be included. The cost of these workloads is listed as Label not present in the table. Select Include Label not present checkbox to show the cost of these resources in the graph.

Option 2: Analyze Forecasted Cost

Forecasted costs are predictions based on your historical cost data. The forecasted date is applicable only where historical data exists. If there is insufficient data to compute the forecast, the value is not displayed. The forecasted cost is predicted for the same future time period as your selected date range. For more information, see Forecasted Cost.

  1. In Continuous Efficiency, click Explorer and click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. Select Cluster or None from the Group by drop-down list. You can further customize your selection by using Filter by option to get more granular details. Based on your selection, Total cost and Forecasted cost is calculated and displayed.

A cost trend indicates the direction of your cloud cost is trending. The cost trend is calculated based on previous spending. It can be calculated only if the previous data is available. 

  1. In Continuous Efficiency, click Explorer and click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. Select Cluster or None from the Group by drop-down list. You can further customize your selection by using Filter by option to get more granular details. Based on your selection, Cost trend is calculated and displayed.

Option 4: Analyze Cost Event Correlation for Workloads

Cost event correlation identifies the events that caused costs to change (increase or decrease). For example, new service deployments, autoscaling, etc. CE timestamps events and shows their corresponding YAML. You can even drill down to all the events on a day to exactly what caused costs to change.

To analyze the cost event correlation, perform the following steps:

  1. In Continuous Efficiency, click Explorer and then click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. In Group by, select Clusters to list all the clusters.
  4. Click on the cluster for which you want to analyze the cost and then select Group by Workload.
  5. Click on the workload for which you want to analyze the cost event correlation.

  1. The detailed information for the selected workload is displayed under Resources and Events tabs.
  2. In Resources, the following information is displayed:
  • Details of the pods associated with the workload.
  • CPU and memory utilization of the workload.

  1. In Events, the cost and events details of the workload for a particular day are displayed.
  2. To get further granular details of the cost and event correlation, click on the Event. It lists the events with the following details:
  • Time: Timestamp of the event.
  • Cost Impact: Percentage of the cost change because of the event. It also shows the trend of cost change.
  • Source: Source of the event.
  • Type: Type of the event.
  • Details: Details of the event.
    When you notice a surge in the price, click on the associated event for that day. It will list all the events that occurred on that day. The events are listed as Notable and All.
  1. Notable lists the events that have an impact on the cost.
    1. Click the arrow. The YAML file is displayed.
    2. View the YAML file to understand the exact differences that led to a change in the cost.
  2. All lists all the events that occurred on the selected workload.
    1. Click the arrow. The YAML file is displayed.
    2. View the YAML file to understand the differences that caused the event.

You can use this data to analyze your cloud cost.

Option 5: Analyze Cost Details for Nodes

The cost details of a node provide:

  • Deep insights into the total, idle, utilized, unallocated, and system costs of a node
  • CPU and memory utilization for nodes and pods
  • CPU and memory allocatable data
  • Pod counts

You can use this data to manage and optimize your cost and resources. To analyze and understand the cost details of a node, perform the following steps:

  1. In Continuous Efficiency, click Explorer and then click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. In Group by, select Clusters to list all the clusters.
  4. Click on the cluster for which you want to analyze the cost and then select Group by Node.
  5. Click on the node for which you want to the analyze the cost. The detailed information for the selected node is displayed.
    • Overview: Provides the cluster and node details.
      • Allocatable: On a Kubernetes node it is defined as the amount of compute resources that are available for pods. For more information, see Node Allocatable.
      • Preemptible/Spot: For details, see GKS, AKS, and EKS.
    • Cost Details: Displays the cost details. For more information on the costs, see Key Cost Concepts.
    • Aggregation: Displays the details of daily and hourly CPU usage, memory usage, and pod counts. You can toggle between the maximum and average utilization views.
    • Table: Displays the details of the associated pods with the node.
    • Chart: Displays CPU, memory, and pods count details.

Next Steps


How did we do?