An alerting policy describes a set of conditions that you want to monitor within your infrastructure. Alerting policies allow you to include granular information about your architecture to help troubleshoot issues, if needed. In this hands-on lab, we will set up an alerting policy with the help of uptime checks on a Compute Engine instance and then simulate instance failure to test that policy and see if it generates the desired notifications via email and SMS.
Successfully complete this lab by achieving the following learning objectives:
- Create an Uptime Check
In the Cloud Monitoring workspace, create an uptime check for your
web-serverinstance. To quickly initialize it, limit uptime checks to the US region.
- Create a Notification Channel
In the Cloud Monitoring workspace, configure an SMS and email notification using your cell phone number and email.
- Create the Alerting Policy
In the Cloud Monitoring workspace, create a notification channel using SMS and email.
- Test the Alerting Policy
Test the alerting policy by stopping your
web-serverinstance. You should automatically receive an email and SMS message that there is an incident. Further, view the incident in the Alerting menu in Cloud Monitoring.