Synthetic Monitoring
Amazon CloudWatch Synthetics enables you to create canaries to monitor your endpoints and APIs. Canaries are configurable scripts that follow the same routes and perform the same actions as a customer. This enables the outside-in view of your customers’ experiences, and your service’s availability from their point of view.
-
We will setup a simple canary that will input some text into a form field, and validate text is present about submitting that form.
- In your AWS Console, navigate back to CloudWatch
- Locate Synthetics Canaries under the Application Monitoring section on the left
- Click the orange button to Create canary
- Leave the selector for Use a blueprint selected, select the blueprint type of GUI workflow builder
- In the Canary builder section, enter a name such as my-sample-canary
- Input your lab URL into the Application or endpoint URL field
- Add the following 3 actions to the Workflow builtder section
- Action = Input text; Selector = [id=hcheck]; Text = Are you up?
- Action = Click; Selector = [id=submit_hc]
- Action = Verify text; Selector = body; Text = The site is UP!
Your screen should look similar to below

- Select Runtime version on syn-nodejs-puppeteer-3.3
- In the Schedule section, choose to Run continuously at a Frequency of every 1 minute
- Leave all other fields as defaults, click Create canary
Note: This operation may take a few minutes.

-
Explore Results
- Under the list of Canaries, click the one you just create to display the details
- On the Availability tab, browse the different features to get familiar with how canaries work
- Your screen should look similar to the below image:

- Click on the Screenshots tab and view the screenshot of a canary run
- Click on the Logs tab and view the logs of a canary run
- Click on the HAR File tab and view the HAR File of a canary run
-
Create an Alarm
- Select the Monitoring Tab for the Canary
- You will see the various metrics available. Locate the metric named Success percent. Click the 3 dot “Widget action” icon in the top right, then click View in metrics
- You will be redirected to the CloudWatch metric for this Canary. Click on the alarm icon under actions
- Change the Period dropdown to 5 minutes
- Change the condition to Lower and enter 80 in the threshold value field. Click Next
- Configure the alarm to send a notification to the SNS topic you created previously. Click Next
- Give the Alarm a name such as Canary_Health_Check and optionally add a description. Click Next
- Click Create alarm
You have used CloudWatch Synthetics to detect customer experience issues in your application workflow.