@wheatstalk/cdk-crashy-task-metrics
TypeScript icon, indicating that this package has built-in type declarations

0.0.107 • Public • Published

CDK Crashy Task Metrics

Use this CDK construct to detect and alarm when ECS tasks crash more than they should.

Example

// Create CrashyTaskMetrics for an ECS service
const crashyTaskMetrics = new CrashyTaskMetrics(this, 'CrashyTaskMetrics', {
  service,
});

// Create alarm for more than two crashes in five minutes.
const crashAlarm = crashyTaskMetrics
  .metricTaskCrashes({ period: cdk.Duration.minutes(5) })
  .createAlarm(this, 'CrashAlarm', {
    comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
    evaluationPeriods: 1,
    threshold: 2,
  });

Package Sidebar

Install

npm i @wheatstalk/cdk-crashy-task-metrics

Weekly Downloads

5

Version

0.0.107

License

Apache-2.0

Unpacked Size

89.8 kB

Total Files

13

Last publish

Collaborators

  • misterjoshua