A cloud engineer is deploying a Linux Compute Engine instance to host an internal application. The engineer needs to collect operating system-level metrics—specifically detailed RAM/memory usage—and application log files, streaming both to Google Cloud Observability. Which solution aligns with Google Cloud recommended practices for VM telemetry collection and access control?
- Install the Google Cloud Ops Agent on the instance and attach a custom service account with the Monitoring Metric Writer and Logs Writer predefined IAM roles.Answer
- BInstall the legacy standalone Stackdriver Monitoring Agent and Stackdriver Logging Agent on the instance, attaching a service account with the Editor primitive role.
- CAttach the Compute Engine default service account with Project Owner permissions and enable hypervisor monitoring without installing an in-guest agent.
- DConfigure the VM instance provisioning request with a Spot VM availability policy to enable automatic memory metric streaming to Cloud Observability.
Answer
Install the Google Cloud Ops Agent on the instance and attach a custom service account with the Monitoring Metric Writer and Logs Writer predefined IAM roles.
The Google Cloud Ops Agent combines logging and metrics collection into a single high-performance package. Gathering guest operating system telemetry—such as detailed memory utilization—requires installing an in-guest agent. Configuring the VM with a service account possessing the predefined roles Monitoring Metric Writer (roles/monitoring.metricWriter) and Logs Writer (roles/logging.logWriter) grants the exact minimal permissions required for telemetry ingestion.
Step-by-Step Solution
Key Concept
Compute Engine Telemetry & Ops Agent Deployment
Estimated Time:1m 30s