interface CreateAlarmOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudWatch.CreateAlarmOptions |
Java | software.amazon.awscdk.services.cloudwatch.CreateAlarmOptions |
Python | aws_cdk.aws_cloudwatch.CreateAlarmOptions |
TypeScript (source) | @aws-cdk/aws-cloudwatch » CreateAlarmOptions |
Properties needed to make an alarm from a metric.
Example
declare const fn: lambda.Function;
fn.metricErrors().createAlarm(this, 'Alarm', {
threshold: 100,
evaluationPeriods: 2,
});
Properties
Name | Type | Description |
---|---|---|
evaluation | number | The number of periods over which data is compared to the specified threshold. |
threshold | number | The value against which the specified statistic is compared. |
actions | boolean | Whether the actions for this alarm are enabled. |
alarm | string | Description for the alarm. |
alarm | string | Name of the alarm. |
comparison | Comparison | Comparison to use to check if metric is breaching. |
datapoints | number | The number of datapoints that must be breaching to trigger the alarm. |
evaluate | string | Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant. |
period? | Duration | The period over which the specified statistic is applied. |
statistic? | string | What function to use for aggregating. |
treat | Treat | Sets how this alarm is to handle missing data points. |
evaluationPeriods
Type:
number
The number of periods over which data is compared to the specified threshold.
threshold
Type:
number
The value against which the specified statistic is compared.
actionsEnabled?
Type:
boolean
(optional, default: true)
Whether the actions for this alarm are enabled.
alarmDescription?
Type:
string
(optional, default: No description)
Description for the alarm.
alarmName?
Type:
string
(optional, default: Automatically generated name)
Name of the alarm.
comparisonOperator?
Type:
Comparison
(optional, default: GreaterThanOrEqualToThreshold)
Comparison to use to check if metric is breaching.
datapointsToAlarm?
Type:
number
(optional, default: evaluationPeriods
)
The number of datapoints that must be breaching to trigger the alarm.
This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
evaluateLowSampleCountPercentile?
Type:
string
(optional, default: Not configured.)
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
Used only for alarms that are based on percentiles.
period?
⚠️ Deprecated: Use metric.with({ period: ... })
to encode the period into the Metric object
Type:
Duration
(optional, default: The period from the metric)
The period over which the specified statistic is applied.
Cannot be used with MathExpression
objects.
statistic?
⚠️ Deprecated: Use metric.with({ statistic: ... })
to encode the period into the Metric object
Type:
string
(optional, default: The statistic from the metric)
What function to use for aggregating.
Can be one of the following:
- "Minimum" | "min"
- "Maximum" | "max"
- "Average" | "avg"
- "Sum" | "sum"
- "SampleCount | "n"
- "pNN.NN"
Cannot be used with MathExpression
objects.
treatMissingData?
Type:
Treat
(optional, default: TreatMissingData.Missing)
Sets how this alarm is to handle missing data points.