A cloud administrator is tasked with setting up system memory and disk utilization telemetry for a newly deployed fleet of Linux Compute Engine virtual machines. Upon viewing the Cloud Monitoring dashboard, the administrator notices that memory utilization metrics are absent. The administrator must collect these operating system level metrics and send them to Cloud Monitoring while strictly adhering to Google-recommended practices and the principle of least privilege. Which approach should the administrator take?
- Install the Google Cloud Ops Agent on each Compute Engine instance and ensure the attached service account is granted the Monitoring Metric Writer role (roles/monitoring.metricWriter).Answer
- BInstall the legacy Stackdriver Monitoring agent on each Compute Engine instance and grant the attached service account the Monitoring Editor role (roles/monitoring.editor).
- CInstall the Google Cloud Ops Agent on each Compute Engine instance and assign the Compute Engine default service account the Owner primitive role (roles/owner).
- DEnable the Cloud Monitoring API at the organization level and grant the Monitoring Metric Writer role (roles/monitoring.metricWriter) at the organization node while revoking all permissions on individual Compute Engine instances.
Answer
Install the Google Cloud Ops Agent on each Compute Engine instance and ensure the attached service account is granted the Monitoring Metric Writer role (roles/monitoring.metricWriter).
To collect operating system metrics such as memory utilization, virtual machines require the Google Cloud Ops Agent. The agent runs inside the OS and transmits time-series data using the VM's service account. Providing the service account with the predefined Monitoring Metric Writer role (roles/monitoring.metricWriter) adheres to least privilege by allowing only metric writes without granting broader administrative capabilities.
Step-by-Step Solution
Key Concept
Compute Engine OS Telemetry Collection and IAM Least Privilege
Estimated Time:2m 0s