Question

Difficulty: MediumMonitoring and Logging

A DevOps team manages a fleet of Compute Engine Linux virtual machines hosting a critical business application. The team needs to capture guest operating system memory utilization metrics and ingest custom application log files stored at `/var/log/app-service.log` into Google Cloud Observability. Which solution follows Google recommended practices to collect both the memory telemetry and log files?

  1. Install and configure the unified Google Cloud Ops Agent on each virtual machine instance.Answer
  2. B
    Install both the legacy Cloud Monitoring agent and legacy Cloud Logging agent on each virtual machine instance.
  3. C
    Grant the Compute Instance Admin (v1) role to the default Compute Engine service account to enable hypervisor-level memory and file log collection.
  4. D
    Enable the Cloud Logging API in the organization node settings to automatically stream OS-level memory metrics and internal VM file paths.

Answer

Installing and configuring the unified Google Cloud Ops Agent on each Compute Engine virtual machine instance is the Google recommended solution.
The Google Cloud Ops Agent is the primary unified agent for Compute Engine virtual machines. It collects system metrics such as CPU, disk, swap, and memory utilization, alongside system and custom log files. Using the Ops Agent is the Google recommended practice for VM guest telemetry.

Step-by-Step Solution

1
Identify the telemetry requirements for the Compute Engine virtual machines.
The requirements demand collecting guest OS memory metrics (not visible to the hypervisor) and custom file-based log entries.
Hypervisors only observe allocated virtual machine capacity, not detailed internal guest memory usage or local files.
2
Evaluate the Google Cloud agent ecosystem for observability.
The Ops Agent combines metric collection (OpenTelemetry-based) and log ingestion (Fluent Bit-based) into a single agent, replacing legacy agents.
Google Cloud recommends the Ops Agent for all standard Compute Engine telemetry collection tasks.
3
Deploy and configure the Ops Agent on the VM fleet.
Configure `/etc/google-cloud-ops-agent/config.yaml` to parse `/var/log/app-service.log` and collect memory telemetry.
The Ops Agent native configuration file allows defining custom file receivers and pipelines alongside standard system metrics.

Key Concept

Google Cloud Ops Agent Deployment
Estimated Time:1m 30s
Rate this question