An operations team has created a log-based metric in Google Cloud Logging to measure HTTP 5xx response counts for an application deployed on Cloud Run. The team needs to ensure on-call engineers receive immediate automated alerts via a webhook when the rate of 5xx errors breaches a specific operational threshold. Which action should the cloud engineer take to complete this configuration?
- Create an alerting policy in Cloud Monitoring conditioned on the log-based metric and attach a webhook notification channel to it.Answer
- BInstall the legacy Stackdriver Logging agent onto the Cloud Run container instances to stream metric data directly to the webhook endpoint.
- CGrant the primitive Owner role to the default Cloud Monitoring service account to allow external webhook notifications to execute.
- DEnable the Cloud Monitoring API at the parent organization node level rather than inside the Cloud Run application project.
Answer
Create an alerting policy in Cloud Monitoring conditioned on the log-based metric and attach a webhook notification channel to it.
To send real-time alerts based on a log-based metric, you must define an alerting policy in Cloud Monitoring that monitors the metric condition and routes notifications to a configured webhook channel.
Step-by-Step Solution
Key Concept
Cloud Monitoring Alerting Policies and Log-Based Metrics Integration
Estimated Time:1m 30s