Jump to Content
Developers & Practitioners

Understanding and analyzing your Google Cloud costs

June 23, 2022
Mark Mirchandani

Google Cloud Developer Advocate

Understanding and analyzing your Google Cloud costs

TL;DR - There's a few different ways to understand your cloud costs with different interfaces. There's also an interactive tour of all the different billing reports to help you get a quick overview!

https://storage.googleapis.com/gweb-cloudblog-publish/images/1_-_debi_confused_math.max-800x800.png

Calculating your cloud costs can be confusing at times!

Working in the cloud comes with opportunities to use new technologies, rapidly create and test infrastructure, and collaborate across teams. All of that general awesomeness can also come with the additional overhead of trying to figure out how much you're spending and where that spending is going. So, let's break down some of the ways to track costs and go over a few tips!

Easy visualization

The quickest way to see where your costs are going is to use the built-in reporting tools, starting with the aptly-named billing reports. This is the first place to go to get more information, and gives quite a bit of flexibility to break down and track your costs!

Billing Reports
So many filters, so little time... (click to enlarge)

Tip: Start by changing the "group by" option to "Service" to see which Google Cloud services have been accruing costs. Larger teams and organizations will likely have hundreds (or more) projects that have specific purposes, but a lot of people can find the information they're looking for just by viewing service-specific costs.

These filters are easy and powerful ways to view past costs, as well as cost trends and predicted future costs, so you can make sure things are on track or investigate any unwelcome surprises.

Tip: Check out saved cost views to quickly switch between your most common sets of filters or reports that you view on the regular.

One of the things that makes this report so easy to use is the visualization. But, if you like things a bit more tabular, the cost table report is probably the right report for you!

Tables on tables

The cost table report is a fairly recent report that focuses on the costs that make up your invoice. Investigating invoices may not sound like the most fun way to spend your time, but this table makes it so much easier to see the line items that resulted in what you paid.

Billing Reports
Similar filtering, with configurable line item grouping (click to enlarge)

The default settings give you the project, services, and SKU breakdown for all the costs in the most recent invoice. Just like the billing reports, you can filter into specifics such as project or SKU, but you can also change the way the report is grouped. This grouping lets you see the table in a flat view, with each cost or credit taking up a line, or even customize how you want things grouped, including using a label! On top of that, you can choose which columns you want to view in the report.

Tip: Selecting a subset of line items or groups will pop up a summary bar that can give you the ability to quickly calculate across whatever dimension you're thinking of.

While the web interface for the cost table is pretty snazzy, sometimes you need to process the data with another tool. That's where downloading the cost table as a CSV really comes in handy. A quick download gives you all this information in a parsable file, which opens up all kinds of possibilities using other analysis tools!

Tip: Downloading the cost table as a CSV will remember your filters and columns, so it's very easy to get the exact data you're looking for in a processable format. However, the CSV will be a flat table, rather than using the same grouping you might have been using in the console.

I think the cost table is one of the best ways to see accurate invoice breakdowns, and makes the data easy to work with thanks to the CSV download. But if you need the most detailed information possible, then the next place to go is BigQuery!

Taking the closest look

Previously, there was an option to export cost details directly to a file in a Cloud Storage bucket, which is currently deprecated. While this export was helpful, it quickly became unwieldy and difficult to work with, which is where the BigQuery export comes in to save the day. Not only is BigQuery built to handle big data (it is in the name after all!), it also lets you run queries right on your data to give you the best combination of power and flexibility.

Report view

Now that's a lot of data!

Once the export is enabled, your billing specifics will be automatically and regularly exported to BigQuery, ready for analysis. Beyond being able to run queries against your data, BigQuery is also an ideal place to hold this data as part of any advanced architecture ideas you might have, such as custom visualization or API integration with any business intelligence tools.

Tip: Check out the documentation for a whole slew of example queries to get started. Using labels can really help get the granularity of filtering you need.

The amount of detail in this export is immense, so it's suitable for the most advanced needs you have. Starting with the standard export will give you all your billing data for a billing account, but there's also options for additional exports.

The detailed usage includes costs down to the specific resource, such as the actual VM or SSD responsible for the costs. Currently, the detailed usage export only covers Compute Engine resources.

Additionally, the pricing data export lets you analyze your billing account pricing information for all services. Pricing data that's specific to your billing account can help you accurately price out and estimate costs, as well as open that data up for analysis.

Tip: We also put together a guide on using your BigQuery data with Looker!

Take action!

These are some of the best ways to get a grasp on your cloud costs and help prepare your cost data for more complicated automation. There's a lot you can do right in the console, so we've also put together a detailed tour of the available reports to go over how they all work and get started with them!


Posted in