Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

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?

  1. 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.Cevap
  2. B
    Install the legacy standalone Stackdriver Monitoring Agent and Stackdriver Logging Agent on the instance, attaching a service account with the Editor primitive role.
  3. C
    Attach the Compute Engine default service account with Project Owner permissions and enable hypervisor monitoring without installing an in-guest agent.
  4. D
    Configure the VM instance provisioning request with a Spot VM availability policy to enable automatic memory metric streaming to Cloud Observability.

Cevap

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.

Adım Adım Çözüm

1
Identify the required telemetry metrics and logs
Realize that hypervisor metrics (CPU utilization, network traffic, disk I/O) are collected automatically, but guest OS metrics (memory usage) and log file parsing require an in-guest agent.
Compute Engine hypervisors cannot read internal guest OS memory state or local application files directly.
2
Select the correct telemetry agent
Choose the Google Cloud Ops Agent over legacy Stackdriver agents.
The Google Cloud Ops Agent is the current unified solution for logging and metrics on Compute Engine instances.
3
Apply least-privilege security permissions
Attach a custom service account with 'roles/monitoring.metricWriter' and 'roles/logging.logWriter'.
Predefined roles limit permissions to necessary operations without granting unnecessary administrative access.

Anahtar Kavram

Compute Engine Telemetry & Ops Agent Deployment
Tahmini Süre:1m 30s
Bu soruyu puanla