Question

Difficulty: MediumMonitoring and Logging

A DevOps team manages a fleet of Compute Engine Linux virtual machines running a custom application. They need to collect both guest operating system metrics (such as memory usage) and custom application log files located at `/var/log/app/*.log`, sending all telemetry to Google Cloud Observability. Which procedure is the Google-recommended approach to satisfy these operational requirements?

  1. Install the Google Cloud Ops Agent on the virtual machines, and configure a custom log receiver in the agent's configuration file to track the application log path.Answer
  2. B
    Install the legacy Stackdriver Logging Agent (`google-fluentd`) alongside the standalone Stackdriver Monitoring Agent on each VM instance.
  3. C
    Assign the primitive Owner role to the Compute Engine default service account so Google Cloud automatically streams guest OS files without agent software.
  4. D
    Enable the Cloud Logging API locally within the Linux operating system kernel settings on each virtual machine.

Answer

Install the Google Cloud Ops Agent on the virtual machines, and configure a custom log receiver in the agent's configuration file to track the application log path.
The Google Cloud Ops Agent is the recommended unified telemetry collection agent for Compute Engine virtual machines. It collects both system metrics (such as memory and disk usage) and logs. Custom log paths can be ingested by adding a file receiver to the agent configuration file.

Step-by-Step Solution

1
Identify telemetry collection capabilities
Recognize that guest OS metrics (memory, disk swap) and custom file-based application logs are not available by default to Cloud Monitoring/Logging without guest telemetry software.
Compute Engine hypervisors only capture external VM metrics like CPU utilization and network throughput.
2
Select the correct agent
Choose the Google Cloud Ops Agent as the current unified agent for Compute Engine instances.
The Ops Agent combines logging and metric collection into a single agent, replacing legacy Stackdriver agents.
3
Configure custom log pipeline
Define a log receiver of type `files` in `/etc/google-cloud-ops-agent/config.yaml` specifying `/var/log/app/*.log`.
The Ops Agent requires explicit file path configurations to ingest non-standard application logs.

Key Concept

Google Cloud Ops Agent configuration for Compute Engine telemetry collection
Rate this question