问题
Cloud Platform - GCP Compute Engine
OS - Ubuntu, 16.04 LTS
I want to see memory utilization graph just like CPU utilization (compute.googleapis.com/instance/cpu/utilization).
I could not find any way to monitor my Compute Engine memory utilization even if Stack-driver is enabled.
I checked https://cloud.google.com/monitoring/api/metrics_gcp#gcp-compute and there is no endpoint for memory utilization monitoring.
I tried stackdriver agent monitoring endpoints also but it is not working ( agent.googleapis.com/memory/percent_used
)
https://cloud.google.com/monitoring/api/metrics_agent#agent-memory.
Does anyone know how can I see memory utilization graph in GCP compute engine instance monitoring or via Stack Driver Monitoring
回答1:
You missed something in the installation of the stackdriver agent. I just tested and it works like a charm on ubuntu 16.04 (Standard Google Image)!
Then go to stackdriver
Resources -> Instances: You should see your VM instance
Click on your instance -> click on Agent -> Scroll down and you see your memory and your swap usage
回答2:
EDITED
On Stackdriver Monitoring: (You will have to install the agent on your VM Instance)
- Install the Stackdriver Monitoring Agent following this guide.
- Open stackdriver monitoring API by clicking Navigation Menu -> Stackdriver -> Monitoring
- Once you are there on the left side you will click on "Resources" -> Metric explorer.
- On resource type: GCE VM Instance / Metrics: "Memory usage" and/or "Memory utilization".
- On filter, select Name, Value: (Name of your instance) You should see now the graphic metrics of the Memory utilization.
来源:https://stackoverflow.com/questions/58067042/memory-usage-monitoring-in-gcp-compute-engine-with-or-without-stack-driver