import { Duration } from "aws-cdk-lib";
import { ITopic } from "aws-cdk-lib/aws-sns";
import { Alarm, IAlarmAction } from "aws-cdk-lib/aws-cloudwatch";
import { IDashboardFactory, MonitoringFacade } from "cdk-monitoring-constructs";
import { IFunction } from "aws-cdk-lib/aws-lambda";
import { ILogGroup } from "aws-cdk-lib/aws-logs";
import { Construct } from "constructs";
/**
 * Category options for CloudWatch alarms for Lambda Functions.
 */
export interface FunctionAlarmsCategoryOptions {
    /**
     * Maximum 50th percentile latency
     */
    readonly p50Latency?: Duration;
    /**
     * Maximum 90th percentile latency
     */
    readonly p90Latency?: Duration;
    /**
     * Maximum 99th percentile latency
     */
    readonly p99Latency?: Duration;
    /**
     * Maximum number of faults
     *
     * @default 0
     */
    readonly maxFaults?: number;
    /**
     * Average number of faults
     */
    readonly avgFaults?: number;
    /**
     * Minimum transactions
     */
    readonly minTps?: number;
    /**
     * Maximum transactions
     */
    readonly maxTps?: number;
    /**
     * Maximum number of throttles
     *
     * @default 0
     */
    readonly maxThrottles?: number;
    /**
     * Average number of throttles
     */
    readonly avgThrottles?: number;
    /**
     * Maximum concurrent executions
     */
    readonly maxConcurrentExecutions?: number;
    /**
     * Amount of time data waits before being processed by the function.
     * See https://aws.amazon.com/premiumsupport/knowledge-center/lambda-iterator-age/
     */
    readonly maxIteratorAge?: number;
    /**
     * Maximum amount of CPU time
     */
    readonly maxCpuTime?: Duration;
    /**
     * 90th percentile CPU time
     */
    readonly p90CpuTime?: Duration;
    /**
     * Average CPU time
     */
    readonly avgCpuTime?: Duration;
    /**
     * Maximum amount of memory
     */
    readonly maxMemory?: number;
    /**
     * 90th percentile memory
     */
    readonly p90Memory?: number;
    /**
     * Average memory
     */
    readonly avgMemory?: number;
    /**
     * Log pattern to match for metrics.
     *
     * @default '\\\[ERROR\\\]'
     */
    readonly metricLogPattern?: string;
    /**
     * Maximum number of log events matching the metricLogPattern.
     *
     * @default 0 for Critical Alarm
     */
    readonly maxLogCount?: number;
    /**
     * Number of evaluation periods over which data is compared for log events.
     *
     * @default 2
     */
    readonly logEvaluationPeriods?: number;
    /**
     * Number of data points that must be breaching to trigger the alarm for log events.
     *
     * @default 1
     */
    readonly logDataPointsToAlarm?: number;
    /**
     * Log pattern to match for the dashboard
     *
     * @default '"[ERROR]"'
     */
    readonly dashboardLogPattern?: string;
    /**
     * Topics to send alarm notifications
     */
    readonly notifyTopics?: ITopic[];
    /**
     * Actions to send alarm notifications
     */
    readonly notifyActions?: IAlarmAction[];
}
/**
 * Options for CloudWatch alarms for Lambda Functions
 */
export interface FunctionAlarmsOptions {
    /**
     * Alarm thresholds for critical alarms.
     *
     * If no properties are provided, a set of default alarms are created.
     */
    readonly criticalAlarmOptions?: FunctionAlarmsCategoryOptions;
    /**
     * Alarm threshold for warning alarms.
     *
     * If no properties are provided, a set of default alarms are created.
     */
    readonly warningAlarmOptions?: FunctionAlarmsCategoryOptions;
    /**
     * Main entry point for monitoring.
     *
     * If no value is provided, a default facade will be created.
     */
    readonly monitoringFacade?: MonitoringFacade;
    /**
     * The DashboardFactory to use when generating CloudWatch dashboards.
     *
     * If not defined, dashboards are not generated.
     */
    readonly dashboardFactory?: IDashboardFactory;
    /**
     * Generate dashboard charts for Lambda insights metrics.
     *
     * @default true
     */
    readonly lambdaInsightsEnabled?: boolean;
    /**
     * Add widgets to alarm dashboard.
     *
     * @default true
     */
    readonly addToAlarmDashboard?: boolean;
    /**
     * Add widgets to detailed dashboard.
     *
     * @default true
     */
    readonly addToDetailDashboard?: boolean;
    /**
     * Add widgets to summary dashboard.
     *
     * @default true
     */
    readonly addToSummaryDashboard?: boolean;
    /**
     * Prefix for generated alarms.
     *
     * @default Stack.of(this).stackName
     */
    readonly alarmNamePrefix?: string;
}
/**
 * Used to disambiguate warning and critical alarms.
 */
export declare enum FunctionAlarmCategory {
    Critical = "Critical",
    Warning = "Warning"
}
/**
 * Properties for FunctionAlarms
 */
export interface FunctionAlarmsProps extends FunctionAlarmsOptions {
    /**
     * The function to observe.
     */
    readonly function: IFunction;
    /**
     * The log group attached to the function to be observed.
     */
    readonly logGroup: ILogGroup;
}
/**
 * Creates CloudWatch alarms for a Lambda Function.
 */
export declare class FunctionAlarms extends Construct {
    /**
     * Default pattern used for the critical log metric.
     */
    static readonly DEFAULT_CRITICAL_LOG_METRIC_PATTERN = "\"[ERROR]\"";
    /**
     * Default pattern used for the warning log metric.
     */
    static readonly DEFAULT_WARNING_LOG_METRIC_PATTERN = "\"[WARNING]\"";
    /**
     * Default pattern used to show logs on the CloudWatch dashboard.
     */
    static readonly DEFAULT_LOG_INSIGHTS_PATTERN = "\\[ERROR\\]|\\[WARNING\\]";
    /**
     * The MonitoringFacade instance either passed in or generated.
     */
    readonly monitoringFacade: MonitoringFacade;
    /**
     * Generated critical alarms.
     */
    readonly criticalAlarms: Alarm[];
    /**
     * Generated warning alarms.
     */
    readonly warningAlarms: Alarm[];
    private readonly props;
    private addRecordValue;
    private toRecord;
    private addAlarm;
    private addFunctionMonitoring;
    private addLogMonitoringToDashboard;
    private addLogAlarm;
    constructor(scope: Construct, id: string, props: FunctionAlarmsProps);
}
