Question

Difficulty: HardMonitoring and Logging

An e-commerce platform runs its order-processing microservices across a fleet of Compute Engine virtual machines. The operations lead notices that standard Compute Engine CPU metrics do not provide visibility into OS-level memory utilization or custom file-based application logs. The team must configure telemetry collection and ensure the instances have appropriate access permissions. Which configuration steps should the operations team perform?

  1. Install the unified Google Cloud Ops Agent on the Compute Engine instances and attach a service account granted the Monitoring Metric Writer and Logs Writer roles.Answer
  2. B
    Install the legacy Stackdriver Monitoring and Logging agents separately on the instances and assign the Editor primitive role to the default Compute Engine service account.
  3. C
    Install the unified Google Cloud Ops Agent on the instances and assign the Project Owner primitive role to the service account attached to the virtual machines.
  4. D
    Install the unified Google Cloud Ops Agent on the Compute Engine instances, but enable the Stackdriver Monitoring API at the Organization level instead of the host project.

Answer

Install the unified Google Cloud Ops Agent on the Compute Engine instances and attach a service account granted the Monitoring Metric Writer and Logs Writer roles.
The correct answer specifies installing the unified Google Cloud Ops Agent, which is Google's standard agent for gathering memory, swap, and disk metrics alongside log files from virtual machines. Additionally, attaching a service account with predefined roles (Monitoring Metric Writer and Logs Writer) enforces the security principle of least privilege.

Step-by-Step Solution

1
Identify the telemetry requirement
Recognize that OS-level memory metrics and custom log files require agent-based telemetry collection beyond standard hypervisor metrics.
Default Compute Engine metrics only cover hypervisor-visible statistics like CPU utilization and disk I/O.
2
Select the correct agent
Choose the Google Cloud Ops Agent over legacy Stackdriver agents.
The Ops Agent is Google's recommended unified solution for collecting system metrics and logging on Compute Engine.
3
Determine IAM permissions according to least privilege
Grant roles/monitoring.metricWriter and roles/logging.logWriter to the VM service account.
Predefined roles provide the exact permissions necessary to write telemetry data without granting unnecessary project administration rights.

Key Concept

Unified Ops Agent Telemetry and Least Privilege IAM Roles
Rate this question