0.2.1 • Published 2 years ago

@navigraph/cdk-alarms v0.2.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

CDK Alarms

Set up Cloud watch alarms and send notifications on the specified topic.

Setup

$ npm i @navigraph/cdk-alarms
import { NavigraphAlarm, NavigraphElbAlarm, NavigraphRdsAlarm } from '@navigraph/cdk-alarms';
// ...
const topic = new Topic(this, 'ErrorNotificationTopic');

NavigraphAlarm

Base alarm used for standard metrics or complex ones including mathExpression.

Example

new NavigraphAlarm(this, 'ErrorLogAlarm', {
      alarmName: 'error-log-rate',
      topic,
      metricName: 'ERROR_LOG_METRIC',
      namespace: 'production-application-X',
    });

NavigraphElbAlarm

Helper for ELB alarms.

Example

new NavigraphElbAlarm(this, 'Http500ElbAlarm', {
  alarmName: 'elb-http-500',
  topic,
  metricName: 'HTTPCode_Backend_5XX',
  loadbalancerName: 'theLoadBalancerName',
  threshold: 1,
  statistic: 'max', 
  treatMissingData: TreatMissingData.NOT_BREACHING,
  reportOk: false,
});

NavigraphAlbAlarm

Helper for ALB alarms.

Example

new NavigraphAlbAlarm(this, 'Http500AlbAlarm', {
  alarmName: 'elb-http-500',
  topic,
  metricName: 'HTTPCode_Target_5XX_Count',
  loadbalancerName: 'theLoadBalancerName',
  targetgroupName: 'theTargetGroupName',
  threshold: 10,
  evaluationPeriod: 5,
  statistic: 'sum',
  treatMissingData: TreatMissingData.NOT_BREACHING,
});

NavigraphRdsAlarm

Helper for RDS alarms.

Example

new NavigraphRdsAlarm(this, 'CommitLatencyAlarm', {
  alarmName: 'postgres-commit-latency',
  topic,
  dbClusterName: 'theDbClusterName',
  metricName: 'CommitLatency',
  threshold: 1, // ms
});

NavigraphEcsServiceAlarm

Helper for ECS service alarms.

new NavigraphEcsServiceAlarm(this, 'CPUUtilizationAlarm', {
  alarmName: 'cpu-utilization-alarm',
  topic,
  serviceName: 'theFargateEcsService',
  metricName: 'CPUUtilization',
  threshold: 60
});
0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.20

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago