Unable to collect vCPUs usage from metric query language MQL - GCP

79 views Asked by At

I'm trying to get vCPUs usage (how many vCPUs are used right now) by the following query:

vCPUUsageMonitoringQuery = "fetch consumer_quota\n| metric 'serviceruntime.googleapis.com/quota/allocation/usage' | filter (resource.service == 'compute.googleapis.com') && (metric.quota_metric == 'compute.googleapis.com/cpus')| group_by 10000s, [value_usage : max(value.usage)]  | every 5m | within d'2022/04/13-08:40:00', d'2022/04/13-08:50:00'"

if I decrease the value for the 'group_by' field, I do not get back the vCPU's num. What is the right query to get the current vCPUs number that are being used right now?

0

There are 0 answers