UNPKG

cdk-monitoring-constructs

Version:

[![NPM version](https://badge.fury.io/js/cdk-monitoring-constructs.svg)](https://badge.fury.io/js/cdk-monitoring-constructs) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.cdklabs/cdkmonitoringconstructs/badge.svg)](https://m

52 lines (51 loc) 2.23 kB
import { AlarmCloneFunction } from "../.."; /** * Properties for configuring a function that clones alarms to be scaled by multiplication factors. */ export interface ScaleAlarmsProps { /** * The disambiguator to assign to the alarms cloned by the function. */ readonly disambiguator: string; /** * A multiplication factor to apply to the threshold of the cloned alarms. * * Threshold scaling does not apply to thresholds on anomaly detection alarms. * * @default - 1.0 */ readonly thresholdMultiplier?: number; /** * A multiplication factor to apply to the datapointsToAlarm property of the cloned alarms. * * When configured with a value less that 1.0, the cloned alarm *may* use a metric with a more * granular period so that the result will use a reasonable number of datapoints. In this case, * the `datapointsToAlarm` and `evaluationPeriods` are increased by the same factor that the * period is decreased. It will also scale `threshold` for metrics using the SUM or SAMPLE_COUNT * stats. * * @default - 1.0 */ readonly datapointsToAlarmMultiplier?: number; /** * A multiplication factor to apply to the `evaluationPeriods` property of the cloned alarms. * @default - Same as datapointsToAlarmMultiplier. */ readonly evaluationPeriodsMultiplier?: number; } /** * Creates a function that clones alarms to be more scaled using the multiplication factors * provided. This function can be provided to the `cloneAlarms` method of * {@link MonitoringFacade}. * * This can be used with scaling factors less than 1.0 to create more aggressive alarms, which * can be useful to provide early detection and trigger change rollbacks. * * If the datapoints to alarm would be scaled to such a small number that it can't effectively be * alarmed, the metric period will be reduced to the next smallest duration and the required * datapoint count will scale up accordingly. * * @param props The properties for configuring the function. * @returns A function that clones alarms and applies scaling factors. */ export declare function ScaleAlarms(props: ScaleAlarmsProps): AlarmCloneFunction;