An alerting policy describes a set of conditions that you want to monitor within your infrastructure. Alerting policies provide granular information about your architecture that can help you 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 simulate instance failure to test it.
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-server instance. To quickly initialize it, limit uptime checks to the US region.
- Create a Notification Channel
In the Alerting menu in your Cloud Monitoring workspace, configure either an SMS or email notification (your choice) using your cell phone number or email.
- Create the Alerting Policy
In the Alerting menu inside the Cloud Monitoring workspace, create a notification channel of your preferred method (email, SMS).
- Test the Alerting Policy
Test the alerting policy by stopping your
web-serverinstance. You should automatically receive an email or SMS message that there is an incident. Further, view the incident in the Alerting menu in Cloud Monitoring.
After observing the alerts, resolve the alert by starting the instance and observe how the incident resolves itself.