Google Professional Cloud DevOps Engineer Question 117
Select 3Google Cloud PlatformYour organization has set up a Google Kubernetes Engine (GKE) cluster to run a mission-critical application. The SRE team wants to ensure that logs are collected, stored, and analyzed efficiently for troubleshooting and monitoring purposes. Which of the following actions should you take to properly manage logs for this application?
- A
Enable Cloud Logging for the GKE cluster to automatically collect logs from all workloads and system components.
- B
Set up log-based metrics in Cloud Logging to alert on specific error patterns or trends.
- C
Configure GKE to write logs directly to a local storage disk to minimize latency.
- D
Create a sink in Cloud Logging to export logs to a Cloud Storage bucket for long-term archival.
- E
Manually SSH into each node in the GKE cluster to retrieve application logs.
Show answer and explanation
Correct answers: A, B, D
Explanation
Efficient log management in Google Cloud involves enabling Cloud Logging to collect logs, creating log-based metrics for monitoring, and using export sinks for long-term archival. These practices ensure that logs are centrally managed, easily accessible, and available for analysis, troubleshooting, and compliance. Local storage and manual log retrieval are not scalable or recommended approaches in a cloud-native environment.
- A. Correct.
This is correct. Enabling Cloud Logging for the GKE cluster ensures that logs from workloads and system components are automatically collected and made available for analysis, which is critical for operational visibility.
- B. Correct.
This is correct. Log-based metrics allow you to define alerts for specific patterns or trends in your log data, which is essential for proactive monitoring and troubleshooting.
- C. Incorrect.
This is incorrect. Writing logs to local storage is not a best practice as it does not provide centralized log management, risks data loss, and makes analysis difficult.
- D. Correct.
This is correct. Exporting logs to a Cloud Storage bucket via a sink is a recommended approach for long-term log storage and compliance requirements.
- E. Incorrect.
This is incorrect. Manually retrieving logs from each node is inefficient, error-prone, and does not scale well for production environments.