'GCP Cost billing data

I am new to GCP and its cloud services offered. For a real-time cost analysis project, what is the best approach to get day-to-day billing reports just like Azure [ Cost Management report ], and AWS [ billing report ]. I have researched few methods using BigQuery however, that seem to be feasible given the administrative constraints regarding the client policy to share account details.

Please should an alternative approach to extract cost reports ? I'm open to explore APIs is available.

Thanks!



Solution 1:[1]

There is no Python package published by Google to display billing data. Google Cloud does not provide APIs that directly access billing details.

Google Cloud's method of accessing billing data is to export the billing data to BigQuery and then query BigQuery for billing details. Billing data is then available after the export is enabled. Previous billing data is not available.

Python Client for Google BigQuery

Export Cloud Billing data to BigQuery

To generate your own reports programmatically requires interfacing with BigQuery to query your billing data. Your software then tabulates the data for display.

Solution 2:[2]

Got the solution by undergoing documents and retrieving data to the Google Cloud Storage.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Hanley
Solution 2 starlord