如何监控GCE上运行的容器虚拟机的内存使用情况

5 monitoring memory-management google-compute-engine google-cloud-platform google-container-optimized-os

我已经使用 docker 容器创建了新的虚拟机。该虚拟机使用 Google 容器优化操作系统。如何监控该实例的内存使用情况?

可观察性中没有内存使用: 在此输入图像描述

我在监控中看到以下消息: 监控

Joh*_*ley 2

您可以在创建实例时启用监控:

gcloud compute instances create instance-name \
    --image-family cos-stable \
    --image-project cos-cloud \
    --metadata=google-monitoring-enabled=true
Run Code Online (Sandbox Code Playgroud)

您还可以启用对现有实例的监控:

gcloud compute instances add-metadata instance-name \
    --metadata=google-monitoring-enabled=true
Run Code Online (Sandbox Code Playgroud)