Google Cloud
Optimisation: idle resources, rightsizing, schedules, commitments, storage, BigQuery and network
- Turn on Cloud Billing export to BigQuery (detailed usage cost) if it is not on already.
- In BigQuery, run the query below for the last 30 days and save the results as CSV.
- Upload the CSV here.
Columns read
usage_start_time, service.description, sku.description, project.id, location.region, resource.name, cost, credits
Also read if present: cost_type, usage_amount, labels
BigQuery query for the last 30 days
SELECT
DATE(usage_start_time) AS usage_start_time,
service.description AS `service.description`,
sku.description AS `sku.description`,
project.id AS `project.id`,
location.region AS `location.region`,
resource.name AS `resource.name`,
SUM(cost) AS cost,
cost_type,
TO_JSON_STRING(ARRAY_AGG(c IGNORE NULLS)) AS credits
FROM `YOUR_PROJECT.YOUR_DATASET.gcp_billing_export_resource_v1_XXXXXX_XXXXXX_XXXXXX`
LEFT JOIN UNNEST(credits) AS c
WHERE usage_start_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
GROUP BY 1, 2, 3, 4, 5, 6, 8