Question

Difficulty: MediumConfiguring Cloud Logging, Monitoring, and Operational Alerting

An operations engineering team needs to configure automated incident notifications based on specific error logs emitted by a workload running on Google Cloud. Order the steps required to establish a complete log-based alerting pipeline following Google Cloud observability best practices, starting from raw log evaluation to operational notification.

  1. 1Construct a precise filter expression in Cloud Logging to isolate the specific error log entries emitted by the workload.
  2. 2Define a custom log-based metric from the filtered log entries to count the matching log occurrences over time.
  3. 3Configure an alerting policy in Cloud Monitoring with a threshold condition that monitors the rate of the custom log-based metric.
  4. 4Attach notification channels to the alerting policy to dispatch notifications when the threshold condition is breached.

Answer

The correct operational sequence is: 1) Construct a precise filter expression in Cloud Logging, 2) Define a custom log-based metric, 3) Configure an alerting policy in Cloud Monitoring using the custom metric, and 4) Attach notification channels to the alerting policy.
To create operational alerts driven by specific log occurrences, you must first define a filter expression in Cloud Logging to pinpoint the error logs. Next, transform those log events into numeric metric data by creating a custom log-based metric. Once the metric is ingested by Cloud Monitoring, construct an alerting policy that evaluates the metric against operational thresholds. Finally, associate notification channels with the alerting policy so that responders receive notifications when an incident is opened.

Step-by-Step Solution

1
Filter target logs in Cloud Logging
Relevant log entries matching the application failure criteria are isolated.
Cloud Logging requires a scope-limiting filter query to extract relevant log events from incoming log streams.
2
Create a log-based metric
Log occurrences are published as a time-series metric stream into Cloud Monitoring.
Cloud Monitoring alerting policies operate on numeric time-series metrics, not directly on text log records.
3
Create an alerting policy in Cloud Monitoring
An operational policy continuously checks the metric rate against defined thresholds.
Alerting policies evaluate conditions over specified time windows to detect incidents.
4
Associate notification channels
Operational alerts are automatically routed to team notification endpoints upon incident trigger.
Notification channels define target destinations (such as Slack, Email, or PagerDuty) for alert delivery.

Key Concept

Configuring Cloud Logging log-based metrics and Cloud Monitoring alerting workflows
Rate this question