Google Professional Cloud Database Engineer Question 136
Select 4Google Cloud PlatformYou are managing a Cloud SQL instance hosting a production database with critical workloads. To ensure you are promptly notified of performance issues and errors, you want to set up alerts using Google Cloud's monitoring tools. Which steps should you take to configure alerts for CPU utilization exceeding 80% and for database connection errors?
- A
Create a Cloud Monitoring Workspace and add the Cloud SQL instance as a monitored resource.
- B
Define an alerting policy in Cloud Monitoring with a condition to monitor CPU utilization and set the threshold to 80%.
- C
Create a Cloud Function triggered by a Pub/Sub topic to send notifications when database connection errors occur.
- D
Set up a logs-based metric in Cloud Logging to detect database connection errors and use it in an alerting policy.
- E
Enable the 'High Availability' option for the Cloud SQL instance to automatically mitigate connection errors.
- F
Configure notification channels, such as email or SMS, in the alerting policy to receive alerts.
Show answer and explanation
Correct answers: A, B, D, F
Explanation
To set up alerts for CPU utilization and database connection errors, you must first configure Cloud Monitoring by creating a workspace and adding your Cloud SQL instance. Then, you need to define alerting policies for conditions like CPU usage exceeding 80% and use logs-based metrics to track specific errors such as connection issues. Notification channels ensure you receive alerts promptly. High Availability and Cloud Functions are not required for this specific task.
- A. Correct.
Correct. Creating a Cloud Monitoring Workspace is the first step to monitor your Cloud SQL instance and set up alerts.
- B. Correct.
Correct. An alerting policy with a condition for CPU utilization exceeding 80% is required to monitor and notify about high CPU usage.
- C. Incorrect.
Incorrect. While Cloud Functions can be used for automated responses, it is unnecessary for simply setting up alerts for connection errors.
- D. Correct.
Correct. A logs-based metric in Cloud Logging can track specific errors, like database connection errors, which can then be used in alerting policies.
- E. Incorrect.
Incorrect. Enabling High Availability improves resilience but does not directly address setting up alerts for connection errors.
- F. Correct.
Correct. Notification channels are necessary to receive alerts when the conditions of the alerting policies are met.