Visualize GCP Billing using Looker

Avani Vyas
Google Cloud - Community
6 min readFeb 27, 2023

Written in collaboration with Karthik Venkatesh, Evelyn (Evy) Shen, Megha Manglani and Bhabani Ranjan Mahapatra

Google Cloud Platform (GCP) is one of the most popular cloud platforms used by businesses globally, but keeping track of GCP billing can be challenging. Fortunately, Looker provides a powerful solution to monitor and optimise GCP billing, allowing businesses to save money and improve efficiency.

In particular, businesses with complex cloud infrastructure or those that want to analyze their costs at a granular level can benefit the most. For example, businesses with multiple teams or departments using different cloud resources can use Looker to analyze each team’s cloud usage and spending. This can help them to identify opportunities to optimize costs and improve efficiency.

Similarly, businesses with variable workloads or those that use a wide range of GCP services can benefit from Looker’s forecasting feature to predict future costs and plan their budgets accordingly.

You can visualize Cloud billing data with Looker to stay up to date on your Google Cloud costs. You can use the dashboard to answer questions about your Google Cloud spend, such as How much am I spending on Compute Engine resources?

With billing export enabled to BigQuery (Export Cloud Billing data to BigQuery), you can build reports on Looker. The standard billing export includes both a cost table, where you can see cost and usage across services, and a pricing table, that can be used to analyze prices, discounts and services. Besides the standard billing export, you can also use the Export recommendations to BigQuery. Recommender is a service that provides per-product or per-service recommendations, and are generated based on heuristic methods, machine learning, and current resource usage.

Let’s Begin the journey of building the Billing Dashboards!

KPIs Used -

Total Cost = Total Usage Cost before any credits

Total Net Cost = Total Cost after deducting credit or discount amount

To start, make use of brief and informative overviews to quickly assess the overall status of the system. To achieve this, present an up-to-date summary of the system at the beginning of a report that will pave the way for a more detailed examination. For the main landing dashboard of the billing dashboards, provide answers to frequently inquired queries such as the cost incurred for the current and previous month.

Here the Current Month and Last Month tiles are routing towards the detailed dashboard. To link tiles with another dashboard, make use of Linking to content in Looker.

Additionally, include a breakdown of daily and monthly spending for each service to identify any potential issues regarding unexpected spending levels. Along with that present overall YTD results.

Cost Prediction

You now have the ability to track your spending across different products and resources, and specifically monitor your expenses. This feature is incredibly useful on its own, but wouldn’t it be even better if you could also predict your future spending on Google Cloud based on your current spending patterns?

You can showcase forecasted cost, using Forecasting in visualizations with Looker. Notice here we are using regular cost type excluding adjustments and other costs.

Moving ahead, you can add a breakdown of monthly costs by services for the last one year from the current date. This is a crisp view of the detailed “Cost History” dashboard that we are going to cover below.

There is one more section, Resource Metrics. This will give you count of running VMs, Disks, Snapshots, Images and VCPUs. Dataset for the same is not exactly part of billing exports, to obtain data for the same refer, Resource Metrics Collection using GCP Compute Engine API.

Moving to our detailed dashboard — Cost History

This will give you a more dynamic breakdown of costs (users can switch between Total Cost or Total Net Cost) by using X-axis and Category parameters. Monthly views can be further drilled down to weekly and daily level using Interval parameter.

To implement this dashboard, we have made use of Liquid with parameters. Looker automatically provides users with the ability to manipulate their queries by creating filters, which are based on dimensions and measures.

This dashboard includes both graphical and tabular presentation of data. Notice this is a pivoted view, to optimize loading time you can use Datagroup to assign caching policy.

This dashboard provides a detailed view of the costs incurred, with the ability to apply more filters to understand how the costs are distributed across different working units such as environments and workloads.

To incorporate this we can join billing data with business specific mappings. This feature is particularly valuable for large enterprise organizations as it provides analysts with greater insight and ease of use when examining GCP billing data.

Exploring Recommendations Export

You can leverage this dataset to provide businesses with valuable insights that can be used to improve their products and services, increase customer engagement and revenue, and gain a competitive edge in the market.

You can create dashboards specific to services, considering Compute Engine for the time being.

Display estimated savings as per recommendations, along with the count of idle resources and projects with major impact.

Moving to our detailed Recommendations dashboard

This will give you a detailed view of a resource within a region and project with change description and estimated cost savings. Users have the ability to customize the data displayed based on their specific requirements by applying filters.

Here we Conclude!

If you’re looking to improve your organization’s billing inquiries, we highly recommend giving Looker a try. With Looker, you can access up-to-date data and insights in real-time, giving you a better understanding of your Cloud costs and allowing you to make more informed decisions.

Looker allows you to create customized dashboards that can be tailored to your specific needs and requirements. You can choose from a range of visualization options and design your dashboards to suit your preferences.

Looker provides granular insights into your Cloud costs, allowing you to drill down into the details and identify any potential issues regarding unexpected spending levels. Looker’s data exploration tools enable you to dig deeper into your billing data and uncover valuable insights that can help you to optimize your costs and improve your business performance.

Overall, Looker provides a powerful and flexible solution for visualizing GCP billing data, helping you to gain deeper insights into your costs and make data-driven decisions with confidence.

--

--