Skip to content

Design : Watcher : Alarm

Jon Seed edited this page Aug 26, 2016 · 4 revisions

The watcher alarm component helps with monitoring the status of each replication. It is responsible for creating and deleting CloudWatch alarms as replications are added and deleted.

It consists of two lambda functions, each with their own CloudWatch event rule.

Diagram

Watcher Alarm Diagram

Alarms

A new CloudWatch alarm is created for each replicated table. This alarm monitors the MinutesBehindRecord custom metric posted by the replicator for each table. The state changes to alarm if the the maximum value remains over a configurable threshold for 5 periods of 60 seconds.

Note: CloudWatch alarms trigger if each period is breaching, or if at least one period is breaching and the rest are missing. This means that it may generate a false positive when initially enabling replication on tables that have not been written to in the last 5 minutes.

Functions

Create     -     [src]

The create function is triggered by a CloudWatch event rule whenever a new event source mapping is added to the replicator function. It posts a fake data point to the custom metric prior to creating the alarm. This is in case the custom metrics have yet to be posted by the replicator for this table, as CloudWatch alarms can only be created for metrics that exist.

Delete     -     [src]

The delete function is triggered by a CloudWatch event rule whenever an event source is deleted from the replicator function. It deletes the CloudWatch alarm for the event source, if one exists.

Clone this wiki locally