Soru

Zorluk: ZorConfiguring Cloud Logging, Monitoring, and Operational Alerting

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?

  1. 1Construct and test a filter query in Cloud Logging Log Explorer to isolate log entries with HTTP status code 500.
  2. 2Create a user-defined log-based counter metric in Cloud Logging using the validated filter query.
  3. 3Configure an operational Webhook notification channel in Cloud Monitoring and verify recipient connectivity.
  4. 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.

Cevap

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.

Adım Adım Çözüm

1
Filter log payload
Validated Cloud Logging query specifying severity and resource payload attributes for HTTP 500 errors.
Before creating a metric, the exact filter criteria must be verified to prevent capturing unwanted log events or missing target errors.
2
Generate custom metric stream
User-defined counter metric registered in Cloud Logging.
Cloud Monitoring cannot monitor log entries directly; log entries must first be mapped into custom time-series metric data by Cloud Logging.
3
Establish notification endpoints
Active, verified Webhook notification channel registered in Cloud Monitoring settings.
Alerting policies require a target notification channel during or after creation to deliver incident notifications upon breach.
4
Configure alert policy and attach channels
Enabled Cloud Monitoring alerting policy monitoring the log-based metric threshold and pointing to the notification channel.
The alerting policy synthesizes the metric threshold condition and notification delivery target into a functional alerting rule.

Anahtar Kavram

Configuring custom log-based metrics and operational alert policies in GCP Cloud Operations suite
Tahmini Süre:2m 0s
Bu soruyu puanla