How do I monitor the performance of my website using CloudWatch Synthetics?
3 minute read
I want to monitor the performance of my website and check the customer experience. How can I use Amazon CloudWatch Synthetics to monitor my website?
You can use CloudWatch Synthetics to create a canary for your website. Canaries are configurable scripts that run on a schedule to monitor your endpoints and APIs. You can configure canaries to perform the same actions that your customers do on your website. This means that you can monitor your customer experience, and proactively find issues before your customer does.
Canaries have several uses. You can check the availability and latency of your endpoints, load time data, and you can take screenshots of your user interface. You can also use canaries to publish metrics for failures and for 2XX, 4XX and 5XX errors, and to enable continuous monitoring.
Some common uses for Synthetics canaries include:
Monitor for page load errors
Provide load latency for application UI
Check out flows in your webpages
Check for broken or dead links
Monitor the health of your application of website using Synthetics
Use these steps to create a canary using the CloudWatch Synthetics console:
In the navigation pane, choose Synthetic Canaries.
Choose Create Canary, and then choose Use Blueprint. Blueprints allow you to create canaries for common tasks, such as loading a webpage.
To monitor the availability of your website, choose Heartbeat Monitoring Blueprint. This blueprint periodically loads a single URL to check the availability and latency of your website. It also captures a screenshot of the UI.
Enter a name for your canary.
Enter the application endpoint URL. This can be an HTTPS or HTTP endpoint. Be sure that you own or have permission to monitor the website, because that website might experience increased traffic.
Choose the Run frequency and Retention settings based on your use case.
Choose CloudWatch alarm, and set notifications for your canary. You can choose to be notified if there are any availability issues in your endpoint. You can also configure the canary to monitor resources inside a Virtual Private Cloud (VPC) by launching it in a VPC. For more information, see Running a canary in a VPC.
After you have configured the canary settings, choose Create canary. This also creates the IAM roles, S3 buckets, CloudWatch alarms, the canary's AWS Lambda function, and CloudWatch log groups.
After your canary is created, navigate to the Canary detail page to view the canary run results, logs, screenshots, and the HAR generated for the run.