DEV Community

jsrios
jsrios

Posted on

☁️ Using BigQuery Billing Export to Manage your Invoice ☁️

Welcome 😄

I'll be walking you through how to set up Google Cloud Platform Billing Export with BigQuery to help you manage and have more insight into your cloud invoice.

Why do I need this?

It depends.

If you manage Billing at your company or have different side projects you definitely want to be able to manage, analyze, and optimize your cloud costs to fit your company/personal budget. If you're just experimenting with GCP, then it's just something to learn!

Set up a BigQuery Dataset

Navigate to BigQuery

Searching for 'BigQuery' in the GCP console search bar

Create a new Dataset

This is the Dataset that the Billing data will be streamed into

BigQuery UI with Create Dataset button selected

Create Dataset form fields including dataset id, data location, table expiration, and encryption method

  • Dataset ID: Can be whatever - 'Billing' works
  • Data Location: Default is fine
  • Table Expiration: For this walkthrough 2 days is fine, you probably wouldn't want it ever expiring though
  • Encryption: Google-managed key is fine

Click 'Create Dataset'

You now have a Dataset set up for your Billing data to be streamed into!

Activate the Billing Export Feature

Navigate to Billing

GCP Console Left Menu with selection around Billing

Navigate to Billing Export

GCP Billing View with selection around Billing Export

Click 'Edit Settings' Button

Billing Export UI with selection around 'Edit Settings'

Note: If you don't see text that says 'Disabled' then you already have the Billing Export feature activated. So you just need to know the Dataset that it's streaming into and check it out.

Select your Project & Billing Dataset

Billing BigQuery Export Settings Form with fields for project and billing dataset

Click Save

And that's it!

Google mentions that it might take a few hours before the data starts streaming into the table, but there's nothing else to do from your end other than wait.

What you can do with this Dataset

The Dataset that Google creates and streams for you is really detailed and they're constantly making updates so that you can gain more insight into your costs and a breakdown of those costs down to the penny. This Dataset can be drilled down and analyzed by project or service and can even show you how much of your costs are in taxes. All you need to do is be creative with your queries.

Extra Resources

Analyzing Google cloud Billing Data with BigQuery

Reconcile your Monthly GCP Invoice with BigQuery Billing Export

Follow Me 😄

Twitter - @jsrioss
Github - @juanri0s

Top comments (0)