pre-loading
backtotop
Cloud Cost Optimization
Cloud Cost Optimization

Stay on Top of Your Costs with Detailed Tracking from Looker Studio at No Cost

September 27, 2024

In today’s fast-paced business environment, understanding and managing your cloud spend is crucial. Google Cloud’s cost management features, such as Cloud Billing data export to BigQuery combined with Looker Studio, offer powerful tools for tracking and visualizing costs in detailed.

Additionally, the integration of Gemini in Looker enhances your ability to interact with data through advanced AI features such as conversational analytics. This blog will guide you through setting up a comprehensive billing usage and cost insights dashboard, ensuring you can effectively monitor and control your Google Cloud expenses.

Importance of Understanding and Managing Google Cloud Spend

Cloud costs can quickly escalate if not properly managed. Detailed tracking and visualization of your cloud spend can help your business stay agile and efficient. With Looker Studio, you can gain deep insights into your Google Cloud costs, identify spending patterns, and make informed financial decisions

Introduction to the Billing Usage and Cost Insights Dashboard

The Billing Usage and Cost Insights Dashboard offered by Looker Studio provides a detailed view of your Google Cloud costs. This dashboard allows you to:

·       Analyze spending patterns.

·       Forecast future expenses.

·       Gain detailed insights into cost distribution.

This dashboard is an essential tool for any organization that relies on Google Cloud services.

Setting Up the Dashboard

Prerequisites:

  1. Required IAM Roles

Ensure the following IAM roles are assigned for setting up and accessing the Billing usage and cost insights dashboard:

·       Billing Account Roles: Billing Account Administrator or Billing Account Costs Manager

·       Project Roles: Project Creator (Organization level)

·       Service Account Role: Service account user

·       BigQuery Roles: BigQuery Admin or BigQuery Data Editor

  1. APIs: some text
       
    • Enable BigQuery API, BigQuery Data Transfer API and Cloud billing API to facilitate data export and analysis

Step 1: Enable Data Export to BigQuery

To analyze your Google Cloud costs effectively, enable Cloud Billing data export to BigQuery. This feature automatically exports detailed billing data, including usage, cost estimates, and pricing information, into a specified BigQuery dataset for in-depth analysis.

Ensure both Standard and Detailed Cloud Billing usage data exports are enabled for comprehensive insights. To activate this, navigate to Billing > Billing Export in your Google Cloud Console and create a BigQuery dataset to store the data.

Note: Data export starts from the date of enabling and may take some time before billing data is fully reflected in the dataset.

Step 2: Verify BigQuery Dataset and Tables

After enabling export, verify that billing data is being loaded into the specified BigQuery dataset and tables. This step ensures that the data is ready for validation and further analysis.

Step 3: Execute Sample Queries in BigQuery

To get a preliminary understanding of your billing data, execute sample queries in BigQuery. This will help you familiarize yourself with the data set and the type of insights it can provide.

Step 4: Gather Required Information for Dashboard Setup

Before moving forward, gather the necessary details about your Google Cloud environment:

  • Project ID: The ID of the project where your Cloud Billing BigQuery dataset is hosted.
  • Dataset Names: Names of the datasets for Standard and Detailed cost data exports.

Typically, the exports are found within the same dataset.

Step 5: Setting Up Your Dashboard

Setting Up Your Dashboard via Looker Studio

Open Looker Studio and start with a blank report.

1. Select Data Source: some text

     
  • Choose BigQuery as your data source.
  •  
     
  • Select the appropriate project, dataset, and      table where your billing data has been exported.

2. Create Your Visualizations: some text

     
  • Utilize Looker Studio features to add tables, charts, bars, and other visuals as per your analysis requirements. Tailor the dashboard to represent the specific billing insights needed for your organization.
  •  

Creating Your Own Copy of the Dashboard Using Python

To create your own copy of the dashboard using Python, follow these steps. This process involves cloning a GitHub repository and using Cloud Shell, an interactive shell environment for Google Cloud accessible from your browser.

High-Level Overview of the Setup Script

The setup script in the repository performs these tasks:

  1. Creates a new BigQuery view in the dataset that contains your Standard cost data export.
  2. Copies the dashboard template and links it to the BigQuery view of your data.
  3. Provides you with a Looker Studio link to your newly created copy, which you can then save to your Looker Studio     dashboards.

Step 1: Cloning the Repository in Cloud Shell

Open Cloud Shell and clone the repository by running the following command:

cloudshell_open --repo_url"https://github.com/GoogleCloudPlatform/professional-services/"--page "editor" --force_new_clone

Step 2: Navigate to the Billboard Directory

Move to the billboard directory with this command:

cd examples/billboard

Step 3: Set Up the Python Environment

Set up the Python environment for the script by running these commands:

rm -rf bill-env

pip install virtualenv

virtualenv bill-env

source bill-env/bin/activate

pip install -r requirements.txt

Step 4: Run the Script to Create Your Dashboard

To execute the script, replace the placeholder variables and run the following command:

python billboard.py \

-pr 'PROJECT_ID' \

-se 'STANDARD_BILLING_EXPORT_DATASET' \

-bb 'BILLBOARD_DATASET'

Replace the variables as follows:

  • PROJECT_ID:     The project ID that hosts your Cloud Billing datasets.
  • STANDARD_BILLING_EXPORT_DATASET: The BigQuery dataset containing your Standard     usage cost data export.
  • BILLBOARD_DATASET: The name of the BigQuery dataset where the view     for the dashboard is created, e.g., gcp-billing-spend. If this     dataset doesn't already exist, the script creates it.

Once initiated, a URL will be generated to launch the Data Studio report.

Step 6: Access and Save Your Dashboard

Upon script completion, you will be provided with a Looker Studio link to your dashboard. Click the Looker Studio link to open the dashboard. In Looker Studio. In Looker Studio, click Edit and share to initiate the save process.

When prompted, click Acknowledge and save to include necessary data sources in your report for optimal visualization. Once saved, you can now access your Google Cloud Billing Dashboard from your Looker Studio home page at any time.

Gemini in Looker

Gemini in Looker offers advanced AI assistance to enhance your data interaction in Looker Studio Pro and Google Slides. Here’s how it can help:

• Conversational Analytics: Ask questions using natural language, and Gemini will present relevant Looker Studio charts or data tables.

• Integrate with Google Slides: Import Looker Studio report components into Slides, with Gemini generating and inserting summaries for each chart.

Accessing Gemini in Looker:

  • Looker Studio Left Navigation: Use Conversational Analytics and select the Sandbox project for queries.

  • Gemini Panel: Open a Looker Studio report and select Generate Slides for presentation creation.

Conclusion

Visualizing and managing your Google Cloud costs is essential for maintaining financial control over your cloud resources. By following this blog, you can set up a robust billing dashboard with Looker Studio for deeper insights and informed financial decisions.

With Gemini in Looker, enhance your data interaction through conversational analytics and seamless integration with Google Slides. Leverage these advanced features to optimize cloud usage and maintain financial agility in today's dynamic business environment.

FAQs

How often is Cloud Billing data updated in BigQuery?

• Billing data is updated daily.

Can I use this dashboard with multiple Google Cloud projects?

• Yes, you can customize the dashboard to handle multiple projects.

Is there a cost associated with exporting Cloud Billing data to BigQuery?

• Yes, storing and querying data in BigQuery incurs costs. Use the Google Cloud Pricing Calculator to estimate these costs.

Can the dashboard handle billing data in different currencies?

• Yes, the dashboard can be modified to support multiple currencies.

What additional benefits does Gemini in Looker offer?

• Gemini in Looker enhances your data interaction with features like conversational analytics and seamless integration with Google Slides, making it easier to visualize and manage your cloud costs intelligently.

More Blogs

Before Disaster Strikes: Why Dockerizing Your Legacy App in GCP is a Must
Before Disaster Strikes: Why Dockerizing Your Legacy App in GCP is a Must
Tue, May 25th 2021 8:04 AM

Legacy applications are the silent killers of business efficiency. They’re monolithic, slow, and nearly impossible to scale. Every code update feels like a risk, with downtime looming like a dark cloud over your operations.

Read more 
External link
From Pixel to Insight in Just Minutes!
From Pixel to Insight in Just Minutes!
Tue, May 25th 2021 8:04 AM

Boost your media application with Amazon Rekognition's deep learning-based image and video analysis. Learn its benefits, and use cases, and get started with Amazon Rekognition today.

Read more 
External link
The Predictive Tool That’s Changing Ecommerce Forever
The Predictive Tool That’s Changing Ecommerce Forever
Tue, May 25th 2021 8:04 AM

Discover how Amazon Forecast can revolutionize your business with accurate time-series predictions. Learn about its features, use cases, pricing, and integration with other Amazon services.

Read more 
External link
Go back