Detailed batch job pricing on google cloud

52 Views Asked by At

We're building simulation pipelines on top of Google Batch coming from AWS Batch, and one of the things we'd like to get is detailed per-job pricing information. AWS provides the cost directly in logs that can be queried, but I can't find anything similar. Are there recommended ways of getting per-batch-job pricing information? Even something that let me trace specific instances back to jobs and get their price would be helpful. I'd like to do this programmatically too, in close-to-real time.

2

There are 2 best solutions below

0
Ray John Navarro On

One approach that you can use resource labels for your Compute Engine instances initiated by Cloud Batch. By doing so, it makes it easier to correlate costs as these labels appear in your billing data. Each job can have a unique label or ID that can be queried in operations log and the billing details. Attached are some good reads on labeling that you may find useful.[1][2]

[1] https://cloud.google.com/resource-manager/docs/creating-managing-labels [2] https://cloud.google.com/compute/docs/labeling-resources

0
soj1906 On

Batch allows for resource labels to be applied to a job's resources [1] and these labels can be filtered in the Cloud Billing report [2].

[1] https://cloud.google.com/batch/docs/organize-resources-using-labels#define-custom-labels

[2] https://cloud.google.com/batch/pricing#view-billing-reports