How do I get Google Cloud costs for this month pro

2019-09-11 08:15发布

问题:

My current Google Cloud billing dashboard shows me the charges for this month, for all my Google Services: Storage, BigQuery, etc.

How do I get this information programmatically? The Cloud Billing API only gives me billing details, but that is not what I want.

I also tried looking into Google Storage for the billing file they periodically update, but it contains information for 2 days ago only.

What should I do?

回答1:

If you enable 'Billing Export' in the 'Billing' tab, a new JSON or CSV file will be exported everyday into Google Cloud Storage. It will have that days' usage and cost information. I have files there since the beginning of my project.