in src/lambda.ts [110:121]
private createThrottlesMonitor(throttlesPerMinuteThreshold = 0) {
const fn = this.fn;
const throttlesMetric = this.metrics.metricThrottles(fn.functionName);
const throttlesAlarm = throttlesMetric.createAlarm(this, 'ThrottlesAlarm', {
alarmDescription: `Over ${throttlesPerMinuteThreshold} throttles per minute`,
threshold: throttlesPerMinuteThreshold,
comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
evaluationPeriods: 3,
});
this.watchful.addAlarm(throttlesAlarm);
return { throttlesMetric, throttlesAlarm };
}