Go to the BigQuery page in the Google Cloud console and verify the data is visible in the _AllMetrics table and the detailed export billing table. For the following steps, we will use GKE as an example and show you how to associate the billing data with the metric data.
First, create a gke_metric_billing
dataset in your project and ensure the region matches the billing export dataset region. Then, run some queries In the query editor to create a few views as the data sources.
-
Use the query in gke_billing_view.sql to create a clean GKE billing view. Please replace the
project id
anddataset
accordingly. -
Use the query in gke_container_view.sql to create an interim view for GKE containers.
-
Use the query in gke_node_view.sql to create an interim view for GKE nodes.
-
Use the query in gke_cpu_view.sql to create the view for GKE CPU metrics.
-
Use the query in gke_cpu_core_cost.sql to create a view to estimate the waste and used cost based on CPU usage.
Looker Studio is a free, self-service business intelligence platform that lets you build and consume data visualizations, dashboards, and reports. With Looker Studio, you can connect to your data, create visualizations, and share your insights with others. Use Looker Studio to visualize data in the BigQuery:
- Open the Metric and pricing dashboard template.
- Click Use my own data.
- Select your project.
- For Dataset, select
gke_metric_billing
. - For Table, select
gke_cpu_view
. - Click Add.
- Click Add to Report.
- Repeat the steps above to add
gke_cpu_core_cost
.