CloudWatch Synthetics Canary Overview
CloudWatch Synthetics Canary enables you to monitor your applications by executing scripts that simulate typical user interactions with your APIs, URLs, or web applications. These scripts help in identifying issues before they impact your customers by testing critical user pathways, such as navigating a website, adding items to a cart, and completing a checkout process.
Key Features
- Configurable Scripts: Create scripts in Node.js or Python that mimic customer actions to monitor application performance and user experience.
- Monitoring Capabilities: Test the availability, latency, and performance of your web applications and APIs. You can also capture load time data and screenshots for a more comprehensive analysis.
- Automated Responses: Integrate with CloudWatch alarms to trigger AWS Lambda functions for automated issue resolution, such as updating DNS records in Route 53 for traffic redirection to stable instances.
Example Scenario
- An application deployed in
us-east-1 is monitored by CloudWatch Synthetics Canary.
- If the canary script detects a failure, a CloudWatch alarm triggers a Lambda function.
- The Lambda function updates Route 53 DNS records to redirect traffic to a functioning instance in
us-west-2.
Scripting and Execution
- Languages: Scripts can be written in Node.js or Python.
- Execution Environment: Includes access to a headless Google Chrome browser for realistic simulation of user interactions.
- Scheduling: Scripts can be executed on-demand or on a regular schedule, depending on the need for continuous monitoring.
Tools and Blueprints
- Heartbeat Monitor: Checks the loading of URLs, captures screenshots, and ensures operational integrity.
- API Canary: Tests basic operations of REST APIs, including read and write functions.
- Broken Link Checker: Verifies the validity of all links on a page, ensuring none lead to broken URLs.
- Visual Monitoring: Compares current screenshots with baseline images to detect visual changes or errors.
- Canary Recorder: Records browser actions to automatically generate executable scripts for repetitive testing.