An enterprise organization is deploying a fleet of Compute Engine instances running custom Linux images. The SRE team requires collection of system memory metrics, disk space utilization, and custom application log files stored at `/var/log/app/*.log`. Following Google Cloud recommended practices and the principle of least privilege, which TWO operational actions must be performed to enable telemetry ingestion and authorization?
- Install the unified Google Cloud Ops Agent on the Compute Engine instances and define a custom log receiver pipeline pointing to `/var/log/app/*.log` inside the agent configuration file (`config.yaml`).Answer
- Attach a dedicated service account to the Compute Engine instances that has been granted the `roles/logging.logWriter` and `roles/monitoring.metricWriter` IAM roles.Answer
- CInstall the legacy Stackdriver Monitoring Agent alongside the legacy Stackdriver Logging Agent and grant the service account the `roles/editor` primitive role.
- DEnable the Cloud Logging and Monitoring APIs at the Google Cloud Organization resource level and download JSON service account keys to embed inside each VM instance.
Answer
Telemetry collection for Compute Engine system metrics (including memory and disk) and custom log files requires installing the unified Google Cloud Ops Agent configured with custom log receiver pipelines, along with attaching a service account to the VMs possessing the predefined `roles/logging.logWriter` and `roles/monitoring.metricWriter` IAM roles.
To collect OS-level telemetry like RAM utilization and custom file logs from Compute Engine, the Google Cloud Ops Agent must be installed and configured with a custom pipeline in `config.yaml`. Furthermore, for the VM instances to securely send telemetry to Cloud Operations under least privilege principles, the attached service account requires the predefined roles `roles/logging.logWriter` and `roles/monitoring.metricWriter`.
Step-by-Step Solution
Key Concept
Google Cloud Ops Agent Configuration & Least Privilege IAM Authorization
Estimated Time:3m 0s