learn CloudWatch Synthetics
You can use Amazon CloudWatch Synthetics to create canaries, configurable scripts that run on a schedule, to monitor your endpoints and APIs. Canaries follow the same routes and perform the same actions as a customer, which makes it possible for you to continually verify your customer experience even when you don't have any customer traffic on your applications.
-
supports monitoring your REST APIs, URLs, and website content every minute, 24x7, and alerts you when your application endpoints don’t behave as expected.
-
Node.js or python based. bundles in Puppeteer + Chromium to the runtime
-
trigger types - cron (1 min smallest freq), run once
-
can also used in any workloads requiring general browser automation
-
creates several CloudWatch metrics in
CloudWatchSynthetics
namespace -
EventBridge support. See monitoring canary events with Amazon EventBridge
-
CloudFormation support via
AWS::Synthetics::Canary
-
if your handler has an error (e.g.
throws Error(..)
) that is not caught it counts as a failed canary
- CloudWatch Synthetics
- CloudWatch metrics published by canaries
- AWS::Synthetics::Canary
- aws-reinvent-trivia-game/canaries
- https://github.com/awslabs/aws-well-architected-labs/blob/main/static/Reliability/300_Fault_Isolation_with_Shuffle_Sharding/Code/regular.yaml#L575 - example cloudformation template