
Answer-first summary for fast verification
Answer: Create an alerting policy in Cloud Monitoring that alerts you if the number of errors is above the defined threshold.
The correct approach is to use Cloud Monitoring's built-in alerting policies. Option C directly addresses the requirement by allowing the creation of an alerting policy that monitors the error rate (e.g., 500 errors) as a ratio of total requests and triggers an alert when it exceeds 15% within a specified time window. Cloud Monitoring natively integrates with Cloud Run metrics, enabling real-time and automated alerts without manual intervention. Options A and D involve unnecessary complexity by using Cloud Functions with scheduled triggers (Cloud Scheduler/Composer) to check metrics daily. This approach is inefficient and not timely, as the problem requires alerts based on a dynamic threshold within a specific time window, not daily checks. Option B relies on manual monitoring via the console, which does not provide automated alerts.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you set up an alert in Google Cloud when your Cloud Run application's HTTP 500 errors exceed 15% of total requests within a given time window?
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.
No comments yet.