Skip to content
v2.273.0

TreatMissingData Enum ​

Specify how missing data points are treated during alarm evaluation.

Example ​

ts
import * as cdk from 'aws-cdk-lib';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';

const fn = new lambda.Function(this, 'MyFunction', {
   runtime: lambda.Runtime.NODEJS_LATEST,
   handler: 'index.handler',
   code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
   timeout: Duration.minutes(5),
});

if (fn.timeout) {
   new cloudwatch.Alarm(this, `MyAlarm`, {
      metric: fn.metricDuration().with({
         statistic: 'Maximum',
      }),
      evaluationPeriods: 1,
      datapointsToAlarm: 1,
      threshold: fn.timeout.toMilliseconds(),
      treatMissingData: cloudwatch.TreatMissingData.IGNORE,
      alarmName: 'My Lambda Timeout',
   });
}

Members ​

MemberDescription
BREACHINGMissing data points are treated as breaching the threshold.
NOT_BREACHINGMissing data points are treated as being within the threshold.
IGNOREThe current alarm state is maintained.
MISSINGThe alarm does not consider missing data points when evaluating whether to change state.

Referenced by ​