aws-cdk-lib.aws_cloudwatch.TreatMissingData

enum TreatMissingData

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.TreatMissingData
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#TreatMissingData
Javasoftware.amazon.awscdk.services.cloudwatch.TreatMissingData
Pythonaws_cdk.aws_cloudwatch.TreatMissingData
TypeScript (source)aws-cdk-lib » aws_cloudwatch » TreatMissingData

Specify how missing data points are treated during alarm evaluation.

Example

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_18_X,
   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

NameDescription
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.

BREACHING

Missing data points are treated as breaching the threshold.


NOT_BREACHING

Missing data points are treated as being within the threshold.


IGNORE

The current alarm state is maintained.


MISSING

The alarm does not consider missing data points when evaluating whether to change state.