'Getting current GCP vCPUs usage with MQL

I'm using the following monitoring query to get the current maximum vCPUs utilization (how many are used).

fetch consumer_quota
| metric 'serviceruntime.googleapis.com/quota/allocation/usage'
| filter
(resource.service == 'compute.googleapis.com') &&
(metric.quota_metric == 'compute.googleapis.com/cpus') 
|group_by 60s, [value_usage : max(value.usage)]

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!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source