Soru

Zorluk: OrtaMonitoring and Logging

An operations team needs to track the frequency of specific application error messages captured in Google Cloud Logging from Compute Engine instances and receive email notifications whenever the error rate exceeds a defined threshold. Which TWO actions must be performed to fulfill these requirements?

  1. Create a custom counter log-based metric in Cloud Logging filtered by the specific application error log text.Cevap
  2. Create an alerting policy in Cloud Monitoring conditioned on the log-based metric and attach an email notification channel.Cevap
  3. C
    Assign the primitive Editor role to the Compute Engine default service account to authorize Cloud Logging metric creation.
  4. D
    Enable the Cloud Monitoring API within the Organization Policy constraints editor at the root folder level.

Cevap

To track log frequencies and trigger alerts based on log content, you must create a custom counter log-based metric in Cloud Logging matching the log pattern, and then configure an alerting policy in Cloud Monitoring using that metric with an attached email notification channel.
To alert on specific log events in Google Cloud, log entries must first be converted into a metric using Cloud Logging counter log-based metrics. Once the metric exists, Cloud Monitoring can evaluate its values against threshold conditions and send alerts to designated notification channels like email.

Adım Adım Çözüm

1
Define a counter log-based metric in Cloud Logging
Cloud Logging converts log entry counts matching the filter into a time-series metric accessible by Cloud Monitoring.
Log entries themselves cannot directly trigger metric threshold alerts until converted into a log-based metric.
2
Configure a Cloud Monitoring alerting policy
An alerting policy monitors the newly created log-based metric and notifies administrators via email when the threshold is breached.
Cloud Monitoring handles threshold detection, condition evaluation, and notification delivery.

Anahtar Kavram

Log-based metrics and alerting policy integration in Google Cloud Observability
Bu soruyu puanla