Google Cloud Professional Cloud Developer — Question 242
You are supporting a business-critical application in production deployed on Cloud Run. The application is reporting HTTP 500 errors that are affecting the usability of the application. You want to be alerted when the number of errors exceeds 15% of the requests within a specific time window. What should you do?
Answer options
- A. Create a Cloud Function that consumes the Cloud Monitoring API. Use Cloud Scheduler to trigger the Cloud Function daily and alert you if the number of errors is above the defined threshold.
- B. Navigate to the Cloud Run page in the Google Cloud console, and select the service from the services list. Use the Metrics tab to visualize the number of errors for that revision, and refresh the page daily.
- C. Create an alerting policy in Cloud Monitoring that alerts you if the number of errors is above the defined threshold.
- D. Create a Cloud Function that consumes the Cloud Monitoring API. Use Cloud Composer to trigger the Cloud Function daily and alert you if the number of errors is above the defined threshold.
Correct answer: C
Explanation
The correct answer is C because creating an alerting policy in Cloud Monitoring directly addresses the need to be notified when the error rate exceeds 15%. Options A and D involve unnecessary complexity with Cloud Functions and scheduling, while option B does not provide proactive alerting and merely involves manual checking of metrics.