Skip to main content
Boost your DevOps efficiency! Dive into our latest white paper.Read Now

How to enable cost explorer

Kapstan currently supports AWS and GCP for cloud cost observability. For each of them, the cost explorer enablement process is slightly different.

AWS Cost Explorer

Kapstan uses AWS cost APIs behind the scenes to compute the aggregated data corresponding to infrastructure resources provisioned through Kapstan. To achieve this we need certain permissions.

Pre-requisites:
User should have an AWS account and have following permission

Enable AWS cost explorer

This is a mandatory step as it tells AWS to start computing cost for your AWS account. If you have created a new AWS account, you'll need to do this step manually. For old accounts, this might already be enabled.

  1. Open the AWS Cost Management console: Navigate to https://console.aws.amazon.com/cost-management/home in your web browser.

  2. Choose Cost Explorer: Click on "Cost Explorer" in the navigation pane.

  3. Launch Cost Explorer: On the "Welcome to Cost Explorer" page, click "Launch Cost Explorer."

  4. Wait for data processing: Cost Explorer will begin processing your cost data. This may take a few minutes to several hours, depending on the amount of data.


Enable Kapstan cost allocation tags

info

If the role used to create AWS cloud connection with Kapstan has necessary permissions, Kapstan can enable these tags automatically

Kapstan adds specific AWS tags to all resources it provisions, allowing you to track associated costs effectively. For example, when provisioning a Kubernetes cluster, Kapstan creates several background AWS resources like EKS, EC2 instances, EBS volumes etc. To provide a consolidated cost view of each cluster we tag all the resources linked to a cluster with kapstan:resource_id tag.
For enabling cost observability of infrastructure provisioned with Kapstan in your AWS account we need to activate cost monitoring on certain tags.

  1. Open the AWS Cost Management console: Navigate to https://console.aws.amazon.com/cost-management/home in your web browser.

  2. Choose Cost Allocation Tags: Click on "Cost Allocation Tags" in the navigation pane.

  3. Choose User-defined cost allocation tags: Click on "User-defined cost allocation tags", enter kapstan:workspace_id & kapstan:resource_id tags in search and activate the Kapstan tags as shown below

Activating Cost Allocation Tags

  1. Confirm the status becomes active: The status column in the table should turn active.

That's it, we are good to go.

GCP cost explorer

GCP Cost Explorer for Kapstan provisioned resources works in a slightly different manner. The user needs to perform certain operations before we can enable the cost explorer -

Pre-requisites:
User should have a GCP account with billing enabled and have the following permissions:

info

Kapstan does not support the cost tracking for Firestore database yet.

Enable cloud billing export to the BigQuery dataset

To enable your Cloud Billing usage cost or pricing data to be exported to BigQuery, do the following:

  1. In the Google Cloud console, go to the Billing export page.

  2. At the prompt, choose the Cloud Billing account for which you'd like to export billing data. The Billing export page opens for the selected billing account.

  3. On the BigQuery export tab, click Edit settings for Standard usage cost data.

  4. From the Projects list, select your project, it will be used to store the exported Cloud Billing data in the BigQuery dataset.

  5. From the Dataset ID field, select the dataset - kapstan_cost_usage_data that was set up to contain your exported Cloud Billing data. For all types of Cloud Billing data exported to BigQuery, the following applies: The BigQuery API is required to export data to BigQuery. Kapstan enables the BigQuery API as part of the set up step. In case it is not, you are prompted to enable it. Click Enable BigQuery API to enable the API. Kapstan creates a BigQuery dataset named kapstan_cost_usage_data during setup. In case it is not present, you are prompted to create one. If necessary, follow these steps to create a new dataset.

Enabling cloud billing export

  1. Click Save.

Cloud billing export enabled

That's it, we are good to go.

info

When you first enable the pricing export to BigQuery, it might take up to 48 hours to start seeing your Google Cloud pricing data.


Can't find what you need?