Is there any way to break down my Google Cloud Functions spending into each one of my functions?

Viewed 522

I want to know how much is each one of my cloud functions spending (break up the total costs on Google Cloud Functions that is shown in my Billing Console). I know I may be able to estimate it probably looking at the metrics and configuration of each function but it would be a hassle to do it one by one (I have a lot of functions).

I couldn't find any way of doing it using the Billing Console alone, it only shows the total cost.

If there was a tool/script it would also be appreciated.

2 Answers

I am unaware of any tool in Billing that would help with what you are after. And I don't think that Google's infrastructure is set up for what you are after.

The Cloud Function Pricing document details how pricing is broken down.

But understand that your Cloud Functions are actually deployed inside of a single (kubernetes) container and run inside of GCP. The GCP infrastructure is able to monitor that container's CPU use, and monitor individual calls to your Cloud Functions, but I strongly doubt that it is monitoring the CPU use of each and every invocation of a function (consider how complex that would be in a project where there is high load/concurrency...how would that even work?)

Your question is specific to a particular approach to solving a problem. I suggest you detail what the underlying problem is to see if there might be a different solution than "Google Billing breaking up Cloud Function costs".

Related