An site reliability engineering (SRE) team needs to create an operational alert system for a mission-critical web application on Google Cloud. The alert must fire whenever HTTP 500 status codes exceed a rate of 50 occurrences within a 5-minute window. The team must construct a log-based metric from application logs and link it to an alerting policy that sends alerts via an external Webhook notification channel. In what sequence should the SRE team perform the following tasks to establish this monitoring pipeline?
- 1Construct and test a filter query in Cloud Logging Log Explorer to isolate log entries with HTTP status code 500.
- 2Create a user-defined log-based counter metric in Cloud Logging using the validated filter query.
- 3Configure an operational Webhook notification channel in Cloud Monitoring and verify recipient connectivity.
- 4Create a Cloud Monitoring alerting policy specifying the log-based metric, setting a threshold of 50 counts over 5 minutes, and attaching the Webhook notification channel.
Answer
The correct operational sequence is: 1) Construct and test the log filter query in Log Explorer, 2) Create the user-defined log-based metric using the query, 3) Configure and verify the Webhook notification channel, and 4) Build the alerting policy using the log-based metric, threshold conditions, and notification channel.
The workflow follows a strict dependency chain: First, the log entry criteria must be tested in Log Explorer. Second, a custom log-based metric must be defined from that query so Cloud Monitoring can generate time-series data points. Third, the Webhook notification channel must be provisioned so alerting destinations exist. Finally, the Cloud Monitoring alerting policy is created, selecting the metric stream, configuring threshold evaluation, and linking the notification channel.
Step-by-Step Solution
Key Concept
Configuring custom log-based metrics and operational alert policies in GCP Cloud Operations suite
Estimated Time:2m 0s