I would like to call GCP API
call to get vCPU's
total count. If all my instances use 280 vCPUs
, I want to get 280 in the response.
I can get the vCPU
limit via the API metrics using "/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus"
, but not the current vCPU
count.
Is there a monitoring API for that purpose?
Help is appreciated. Thanks.
As
@guillaume blaquiere
currently there is no way to countvCPU
using GCP API. You can createFeature Request
via Google Issue Tracker if you think it could be beneficial feature.As a workaround, you can use
Cloud Monitoring
and use Chart a single metric type.In
Metrics Explorer
you would need to choose:Resource type:
VM InstanceMetric:
Reserved vCPUsAggregator:
sumIt would look like below: