Skip to navigation

GCP Cost Tracking Setup

Connect your Google Cloud Platform account to track infrastructure costs automatically. Follow these steps to configure billing data access.

What You’ll Need: GCP project with billing enabled, ability to create service accounts, and BigQuery API access.


Step 1 — Enable BigQuery Export

Configure GCP to export billing data to BigQuery.

  1. Go to GCP Console → Billing → Billing export

  2. You’ll see Detailed usage cost export (it will be disabled initially). Click Edit settings

    GCP Billing Export - Edit Settings

  3. Select the project you want to track costs for, then create a new BigQuery dataset or use an existing one.

    Note the dataset name and table name created:

    • Dataset: billing_export
    • Table: gcp_billing_export_v1_XXXXX

    GCP Billing Export - Select Project and Dataset


Step 2 — Create Service Account

Create a service account with permissions to read billing data from BigQuery.

  1. Go to IAM & Admin → Service Accounts
  2. Click Create Service Account
  3. Grant the following roles:
    • BigQuery Data Viewer
    • BigQuery Job User
    • BigQuery Read Session User
  4. Complete the service account creation
  5. Click on the service account → Keys → Add Key → Create new key

Select JSON format and download the key file. Keep it secure!


Step 3 — Upload Credentials to Paygent

In the Paygent dashboard, navigate to Infra Cost and select the GCP tab.

  1. Click Choose File and select the JSON key file downloaded in Step 2
  2. Enter the Billing Dataset name from Step 1
    • Example: billing_export
  3. Enter the Billing Table name from Step 1
    • Example: gcp_billing_export_v1_XXXXX_XXXXX_XXXXX
  4. Click Upload Credentials

Setup Complete! Cost data will be available within 24-48 hours. Paygent will automatically sync your GCP billing data daily.


Troubleshooting

Ensure you downloaded the service account key in JSON format (not P12). The file should start with {.

Verify the service account has all three required BigQuery roles. Check that the billing export is in the same project as the service account.

Double-check the dataset and table names match exactly (case-sensitive). Ensure BigQuery export is enabled and has generated at least one export.

GCP billing exports are generated daily. Wait 24-48 hours after setup. Ensure your GCP project has actual usage to report.