Connecting GCP Cloud Billing
Step-by-step guide on how to export GCP Cloud Billing data
Use the guide below to easily configure GCP Cloud Billing integration.
GCP Setup
Prerequisites
GCP project with billing export enabled. Follow the official documentation to set up Cloud Billing data export to BigQuery
BigQuery dataset with billing export data
Service account with the relevant permissions
Service Account Required permissions
BigQuery Data Viewer on the billing export dataset
BigQuery Job User permission
Service Account Token Creator (for impersonation)
Variables
Configuring GCP access
Follow these steps to grant PerfectScale the required permissions.
Create Service Account
Assign the roles required to enable BigQuery access:
BigQuery Data ViewerBigQuery Job User
On the tab Principals with access, grant permissions to the principal
perfectscale-gcp-cur-accessor@psc-dev-1-000001.iam.gserviceaccount.comwith the roleService Account Token Creator.

Configuring GCP Billing Export integration with GCP profile
Once everything above is in place, the next step is to create a GCP Billing profile and connect it to the cluster(s) you need.
🛠️ How to create GCP Billing profile
There are two options for creating a Profile: from the Settings tab or directly from the Overview.

Go to the Settings tab on the left panel -> select Pricing -> click the +Add Profile button -> select GCP Billing -> name the profile and put the needed values in the relevant fields -> click Save button.
From the Overview tab
Go to the Overview tab on the left panel -> find the cluster to which you want to apply the Azure Profile and click gear button -> go to Customizations -> click on Add New Profile in the Pricing Profile drop-down list -> select GCP Billing type -> name and configure your profile -> click the Save And Apply button -> click the Save Changes button.

GCP Billing profile configuration

gcp_project_id: The unique identifier for your GCP project used to interact with it across services and APIs.
gcp_billing_account: The unique identifier for your GCP billing account to manage billing across projects.
gcp_service_account:The service account key used to authenticate and securely interact with Google Cloud APIs on your behalf.
gcp_dataset_id:The unique identifier assigned to a BigQuery dataset within a specific Google Cloud project.
Global discount for on-demand nodes
If you have a global discount for on-demand nodes (from a cloud provider or cloud reseller) that isn’t included in your custom cloud billing, you can apply it in addition to your GCP Cloud Billing integration.
Add the following parameters to your GCP Billing profile to enable applying the globalDiscount on top of your cloud billing integration:
global_discount (optional block):
percentage- the percentage (0–100, floats supported) of the discount to apply on top of standard on-demand node pricing. This field is required whenglobal_discountexists.start_date(optional) - the effective start date for applying theglobal_discount. If this field is empty, it defaults to today.
The complete configuration might look like the following example:
Profile configuration verification
To verify if the profile is configured properly, click the Test Integration button.
🟢 When the configuration is correct, you will see the message GCP Billing configured correctly.
🔴 In case of GCP Billing configured wrongly response, check the Show integration failure details dropdown and fix the displayed issue(s).
🛠️ How to apply GCP Billing profile
Apply to a single cluster
To apply GCP Billing profile to the cluster, go to the Overview tab on the left-hand panel -> find the cluster to which you want to apply the GCP Billing Profile and click gear dots button -> go to Customizations -> select the needed profile in the Pricing Profile drop-down list.

Apply to multiple clusters
To apply the profile to multiple clusters from a single view, use the Manage Assignments feature.
Go to the Settings tab on the left-hand panel -> select the Pricing -> click the Manage Assignments button -> apply the profile for the needed clusters -> click the Save Changes button.

Configuring GCP pricing integration with CRD
To configure GCP pricing using a Custom Resource Definition (CRD), you’ll need to define and apply a Custom Resource (CR) that specifies your unique billing conditions. This approach allows you to manage accurate pricing directly through Kubernetes manifests.
The Custom Resource (CR) must be created in the perfectscale namespace.
Setup instructions
Enable BigQuery billing export in your GCP project
Create a service account with BigQuery Data Viewer permissions
Generate a JSON key for the service account
Copy the service account details and billing configuration to the CR.
CR configuration
⚙️ CR parameters:
global_discount (optional block)
The discount to apply on top of standard on-demand node pricing.
percentage - the percentage (0–100, floats supported) of the discount. This field is required when global_discount exists.
start_date (optional) - the effective start date for applying the global_discount.
gcp_billing_account
The unique identifier for your GCP billing account to manage billing across projects.
gcp_dataset_id
The unique identifier assigned to a BigQuery dataset within a specific Google Cloud project.
gcp_project_id
The unique identifier for your GCP project used to interact with it across services and APIs.
gcp_service_account
The service account key used to authenticate and securely interact with Google Cloud APIs on your behalf.
If a global_discount percentage is provided without a start_date in the CRD profile, we won’t default to today’s date as we do for profiles configured in the UI, and the discount will not be applied. The pricing profile appears broken in the UI.
Last updated
Was this helpful?