Google Cloud offers additional possibilities for those whose existing billing and cloud usage reporting isn’t enough. Billing exports allow customers to export billing data into the Google Cloud data warehouse called BigQuery.
We will learn about BigQuery in upcoming chapters, but in the context of billing exports, BigQuery can be used to export all billing data automatically. It can be helpful if an organization uses external tools to analyze or visualize data. The following documentation explains how to configure billing exports to BigQuery: https://cloud.google.com/billing/docs/how-to/export-data-bigquery-setup.
We configured a billing export into BigQuery for one of our projects.
Figure 3.27 – Billing account configured to export all billing data into BigQuery
It may take up to 24 hours to see the data from the billing account in BigQuery. Once the data is in the BigQuery dataset, we can query it.
Figure 3.28 – Sample query in BigQuery with billing data
Looker Studio is a free product offered to Google Cloud users. We can store up to 10 GiB of data with the Free Tier and query up to 1TiB data.
Once the export is finished, we can work with the data. For example, we can visualize it in Google Cloud Data Studio, as shown in the following figure (image from https://lookerstudio.google.com/u/0/reporting/64387229-05e0-4951-aa3f-e7349bbafc07/page/p_l3qef1s8rc):
Figure 3.29 – Sample publicly available on GCP Advanced Billing dashboard created in Looker Studio
Billing exports allow users to analyze their cloud expenditure further and visualize it in Looker Studio.
We can drag and drop dimensions from the available fields in the following screenshot:
Figure 3.30 – Data Studio sample billing data
We can add charts to visualize our data better as well:
Figure 3.31 – Cloud Billing data exported into BigQuery and visualized in Data Studio
Visualization is quite a straightforward process and we can configure charts to our liking or business requirements.
All Google Cloud services can be used only if the correlated API has been enabled. API enablement occurs at the project level. For example: if you used GCE and GCS in your existing project and created a brand-new task, you will need to enable both APIs.
There are three options for us to enable an API in the Google Cloud project:
- Ask a security admin to create an API key for you.
- Ask a security admin to grant you access to the project so that you can create an API key in the same project that the API is associated with
- Ask a security admin to grant you access to enable the API in your own Google Cloud project so that you can create an API key
In the next section, we will learn how to enable a Google Cloud API.