I have multiple GKE clusters with logically separated K8s objects using namespaces, each namespace has GCS bucket attached to it (Statefulset) I wanted to know billing information about each namespace and what each namespace costs for resources usage. I found very useful feature called "GKE Metering" and yea it showed up some useful information about CPU and Memory billing info for each namespace by gathering billing information and import it into BigQuery, then I can visualize the results using Google Data Studio for example.
The Question Is:
Any help will be appreciated 🙌🏻 Thank you
For that, you need to add a label on your GCS bucket
Then to export the billing to BigQuery
And to get the data like that in BigQuery
SELECT *
FROM `project.dataset.exportBillingTable`
WHERE "<Your Label Key>" IN UNNEST(labels.key)
You can perform "group by", "sum", filter on the label key or the label value,...