3
votes

Google Compute Engine allows for a daily export of a project's itemized bill to a storage bucket (.csv or .json). In the daily file I can see X-number of seconds of N1-Highmem-8 VM usage. Is there a mechanism for further identifying costs, such as per tag or instance group, when a project has many of the same resource type deployed for different functional operations?

As an example, Qty:10 N1-Highmem-8 VM's are deployed to a region in a project. In the daily bill they just display as X-seconds of N1-Highmem-8.

Functionally:

  • 2 VM's might run a database 24x7
  • 3 VM's might run batch analytics operation averaging 2-5 hrs each night
  • 5 VM's might perform a batch operation which runs in sporadic 10 minute intervals through the day
  • final operation writes data to a specific GS Buckets, other operations read/write to different buckets.

How might costs be broken out across these four operations each day?

2
Are you aware of any improvement in this area? Google tells me that tagged billing is still not available but maybe you have found some other solution?KobeJohn
Sadly no, not at this time. One "hybrid" solution is to move functional areas into their own projects, then billing (and security) is automatically segmented. We have done that for larger areas.TimK

2 Answers

2
votes

The Usage Logs do not provide 'per-tag' granularity at this time and it can be a little tricky to work with the usage logs but here is what I recommend.

To further break down the usage logs and get better information out of em, I'd recommend trying to work like this:

Your usage logs provide the following fields:

  • Report Date
  • MeasurementId
  • Quantity
  • Unit
  • Resource URI
  • ResourceId
  • Location

If you look at the MeasurementID, you can choose to filter by the type of image you want to verify. For example VmimageN1Standard_1 is used to represent an n1-standard-1 machine type.

You can then use the MeasurementID in combination with the Resource URI to find out what your usage is on a more granular (per instance) scale. For example, the Resource URI for my test machine would be:

https://www.googleapis.com/compute/v1/projects/MY_PROJECT/zones/ZONE/instances/boyan-test-instance

*Note: I've replaced the "MY_PROJECT" and "ZONE" here, so that's that would be specific to your output along with the name of the instance.

If you look at the end of the URI, you can clearly see which instance that is for. You could then use this to look for a specific instance you're checking.

If you are better skilled with Excel or other spreadsheet/analysis software, you may be able to do even better as this is just an idea on how you could use the logs. At that point it becomes somewhat a question of creativity. I am sure you could find good ways to work with the data you gain from an export.

0
votes

9/2017 update.

It is now possible to add user defined labels, then track usage and billing by these labels for Compute and GCS.

Additionally, by enabling the billing export to Big Query, it is then possible to create custom views or hit Big Query in a tool more friendly to finance people such as Google Docs, Data Studio, or anything which can connect to Big Query. Here is a great example of labels across multiple projects to split costs into something friendlier to organizations, in this case a Data Studio report.