in src/constructs/cloudwatch/lambda-alarms.ts [78:95]
constructor(scope: GuStack, id: string, props: GuLambdaThrottlingAlarmProps) {
super(scope, id, {
...props,
app: props.lambda.app,
alarmName:
props.alarmName ?? `Lambda throttling alarm for ${props.lambda.functionName} lambda in ${scope.stage}.`,
alarmDescription:
props.alarmDescription ?? "Alarm when lambda is throttled (which causes requests to fail with a 429).",
threshold: props.toleratedThrottlingCount ?? 0,
evaluationPeriods: props.numberOfMinutesAboveThresholdBeforeAlarm ?? 1,
metric: props.lambda.metricThrottles({
period: Duration.seconds(60),
statistic: "sum",
}),
treatMissingData: TreatMissingData.NOT_BREACHING,
comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,
});
}