import * as lambda from 'aws-cdk-lib/aws-lambda'; import { Construct } from 'constructs'; import { IWatchful } from './watchful'; /** * Options for defining alarms. */ export interface WatchLambdaFunctionOptions { /** * Number of allowed errors per minute. If there are more errors than that, an alarm will trigger. * * @defaultValue 0 */ readonly errorsPerMinuteThreshold?: number; /** * Number of allowed throttles per minute. * * @defaultValue 0 */ readonly throttlesPerMinuteThreshold?: number; /** * Threshold for the duration alarm as percentage of the function's timeout * value. * * If this is set to 50%, the alarm will be set when p99 latency of the * function exceeds 50% of the function's timeout setting. * * @defaultValue 80 */ readonly durationThresholdPercent?: number; } /** * Properties for defining a WatchLambdaFunction */ export interface WatchLambdaFunctionProps extends WatchLambdaFunctionOptions { /** * The reference to IWatchful class. Used internally. */ readonly watchful: IWatchful; /** * The lambda function that should be watched. * [disable-awslint:ref-via-interface] */ readonly fn: lambda.Function; } /** * A Construct which creates the following alarms for lambda functions: * * - errors * - throttles * - duration */ export declare class WatchLambdaFunction extends Construct { private readonly watchful; private readonly fn; constructor(scope: Construct, id: string, props: WatchLambdaFunctionProps); private createLogErrorMonitor; private createErrorsMonitor; private createThrottlesMonitor; private createDurationMonitor; }