interface PromQLAlarmProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudWatch.PromQLAlarmProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#PromQLAlarmProps |
Java | software.amazon.awscdk.services.cloudwatch.PromQLAlarmProps |
Python | aws_cdk.aws_cloudwatch.PromQLAlarmProps |
TypeScript (source) | aws-cdk-lib » aws_cloudwatch » PromQLAlarmProps |
Properties for creating a PromQL Alarm.
Example
new cloudwatch.PromQLAlarm(this, 'HighLatencyAlarm', {
alarmDescription: 'P99 latency exceeds 500ms for 5 minutes',
query: 'histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m])) > 0.5',
evaluationInterval: Duration.seconds(60),
pendingPeriod: Duration.seconds(300),
recoveryPeriod: Duration.seconds(600),
});
Properties
| Name | Type | Description |
|---|---|---|
| evaluation | Duration | The frequency at which the alarm is evaluated. |
| query | string | The PromQL query that the alarm evaluates. |
| actions | boolean | Whether the actions for this alarm are enabled. |
| alarm | string | Description for the alarm. |
| alarm | string | Name of the alarm. |
| pending | Duration | The duration that a contributor must continuously breach before the contributor transitions to ALARM state. |
| recovery | Duration | The duration that a contributor must continuously not be breaching before it transitions back to the OK state. |
evaluationInterval
Type:
Duration
The frequency at which the alarm is evaluated.
Must be between 10 seconds and 3600 seconds.
query
Type:
string
The PromQL query that the alarm evaluates.
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.
pendingPeriod?
Type:
Duration
(optional, default: No pending period)
The duration that a contributor must continuously breach before the contributor transitions to ALARM state.
recoveryPeriod?
Type:
Duration
(optional, default: No recovery period)
The duration that a contributor must continuously not be breaching before it transitions back to the OK state.

.NET
Go
Java
Python
TypeScript (