A DevOps engineering team is operating a microservices application deployed on Cloud Run. During peak usage, transient database connectivity issues generate log entries containing the structured field payload status: CRITICAL_DATABASE_TIMEOUT. The team needs to configure automated alerting to notify on-call engineers via an existing Cloud Monitoring notification channel whenever this log entry appears more than 10 times within any 5-minute rolling window. Which configuration should the team implement?
- Create a counter log-based metric in Cloud Logging filtered for the database timeout log payload, and configure a Cloud Monitoring alerting policy based on this metric using a 5-minute rolling alignment window.Cevap
- BConfigure an exclusion filter in Cloud Logging for the timeout log payload, and attach the PagerDuty notification channel directly to the exclusion filter definition.
- CAssign the primitive Owner role (roles/owner) to the application service account so Cloud Logging automatically elevates matching log entries to high-priority operational incidents.
- DSubmit a regional quota increase request for Cloud Logging log ingestion capacity before creating log routing pipelines.
Cevap
Create a counter log-based metric in Cloud Logging filtered for the database timeout log payload, and configure a Cloud Monitoring alerting policy based on this metric using a 5-minute rolling alignment window.
Creating a counter log-based metric allows Cloud Logging to count occurrence instances of specific log entries matching a filter. Cloud Monitoring reads this metric and evaluates threshold conditions over specified time windows (such as 5 minutes) to trigger alerting policies and push notifications to operational channels.
Adım Adım Çözüm
Anahtar Kavram
Log-based Metrics and Cloud Monitoring Alert Policies
Tahmini Süre:1m 30s