On the quotas page, there are a few things listed for different Quotas.
I am focusing on CPU’s Quota. I can get the Dimensions and the Effective Limit via GO API. But could not find anything in the API for getting ‘Current usage percentage’.
Basically, I need to know what is my current VCPU’s usage for a specific region.
According to this document, it seems it is possible to (programatically) fetch quota metrics. It might be through the “service usage API”. You have mentioned that you are using the Go API, is it possible to point us to the document that you are following so we can verify on our end? Please clarify if you meant using the Go client library Is it also possible to provide an example?
For working in workspaces, look into https://cloud.google.com/apis/docs/monitoring. Maybe this will help you find examples of setting up your access to the quota metrics search content?
I used ‘’“/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus”’ to get the limit. But can’t find the right endpoint to get the current count . i.e - 280 vCPU’s are used right now in the region by all instances.
Endpoints generate a Developer Portal for your APIs, giving you and your customers access to APIs documentation. Access your Developer Portal through the URL shown below. Endpoints also allow you to add a custom domain if you own one.
It only returns a number when I increase the time value (from 60s to 24000s), and the result is not accurate. What should I change in the query in order to get the current usage of vCPUS? i.e- right now all my instances are using 392 vCPUs.
Thanks!