Solution 1:

In this case, I suggest you go to "Monitoring" -> "Metrics explorer" and create two metrics:

  • "VM Instances" and "agent.googleapis.com/cpu/utilization"
  • "VM Instances" and "compute.googleapis.com/instance/cpu/utilization"

so you can analyze CPU utilization from the host and container point of views.

From Google Cloud docs:

Metric: agent.googleapis.com/cpu/utilization

Description: CPU Usage (percent). This value is reported from inside the VM and can differ from compute.googleapis.com/instance/cpu/utilization, which is reported by the hypervisor for the VM.

Solution 2:

The CPU usage shown in Google Cloud Console is not that of the instance, but the CPU usage of the hypervisor managing the instance. This hypervisor is in charge of providing the virtualization services to the instance and collecting all the metrics used for load balancing, auto-scaling, cloud monitoring, etc. As such, high numbers of I/O or network operations will cause the CPU utilization shown in Cloud Console to spike.