Search code examples
monitoringgoogle-kubernetes-enginestackdrivergoogle-cloud-stackdrivergoogle-cloud-monitoring

Monitor percentage of CPU and memory in GKE nodes


I would like to use Stackdriver monitoring to watch for my GKE nodes' CPU/mem % usage.

However, when going through the Stackdriver Monitoring UI, there does not seem to be any such option available (meaning in terms of percentage).

On the other hand there seem to be for example 2 extremely similar metrics (their description is identical) for (what appears to be) absolute mem usage. (screenshots attached).

Is anyone aware how one can provide for percentage of memory and CPU used on GKE nodes? (not containers)

enter image description here

enter image description here


Solution

  • per https://cloud.google.com/monitoring/api/metrics_kubernetes :

    node/memory/allocatable_utilization and node/cpu/allocatable_utilization seem to be doing what you want:

    • node/memory/allocatable_utilization - [BETA] Memory allocatable utilization

      • Description: The fraction of the allocatable memory that is currently in use on the instance. This value cannot exceed 1 as usage cannot exceed allocatable memory bytes. Sampled every 60 seconds. After sampling, data is not visible for up to 120 seconds.
      • Kind: GAUGE, Type: DOUBLE, Unit: 1
      • Monitored resource: k8s_node
      • Labels:
        • memory_type: Either evictable or non-evictable. Evictable memory is memory that can be easily reclaimed by the kernel, while non-evictable memory cannot.
        • component: Name of the respective system daemon.
    • node/cpu/allocatable_utilization - [BETA] CPU allocatable utilization.

      • Description: The fraction of the allocatable CPU that is currently in use on the instance. Sampled every 60 seconds. After sampling, data is not visible for up to 240 seconds.
      • Kind: GAUGE, Type: DOUBLE, Unit: 1
      • Monitored resource: k8s_node

    Both metrics are marked as BETA, though.


    original answer mentioned: container/cpu/limit_utilization and container/memory/limit_utilization