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?
- 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
- BInstall the legacy Stackdriver Logging Agent (`google-fluentd`) alongside the standalone Stackdriver Monitoring Agent on each VM instance.
- CAssign the primitive Owner role to the Compute Engine default service account so Google Cloud automatically streams guest OS files without agent software.
- DEnable 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
Key Concept
Google Cloud Ops Agent configuration for Compute Engine telemetry collection