PromQLAlarmProps

class aws_cdk.aws_cloudwatch.PromQLAlarmProps(*, evaluation_interval, query, actions_enabled=None, alarm_description=None, alarm_name=None, pending_period=None, recovery_period=None)

Bases: object

Properties for creating a PromQL Alarm.

Parameters:
  • evaluation_interval (Duration) – The frequency at which the alarm is evaluated. Must be between 10 seconds and 3600 seconds.

  • query (str) – The PromQL query that the alarm evaluates.

  • actions_enabled (Optional[bool]) – Whether the actions for this alarm are enabled. Default: true

  • alarm_description (Optional[str]) – Description for the alarm. Default: - No description

  • alarm_name (Optional[str]) – Name of the alarm. Default: - Automatically generated name

  • pending_period (Optional[Duration]) – The duration that a contributor must continuously breach before the contributor transitions to ALARM state. Default: - No pending period

  • recovery_period (Optional[Duration]) – The duration that a contributor must continuously not be breaching before it transitions back to the OK state. Default: - No recovery period

ExampleMetadata:

infused

Example:

cloudwatch.PromQLAlarm(self, "HighLatencyAlarm",
    alarm_description="P99 latency exceeds 500ms for 5 minutes",
    query="histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m])) > 0.5",
    evaluation_interval=Duration.seconds(60),
    pending_period=Duration.seconds(300),
    recovery_period=Duration.seconds(600)
)

Attributes

actions_enabled

Whether the actions for this alarm are enabled.

Default:

true

alarm_description

Description for the alarm.

Default:
  • No description

alarm_name

Name of the alarm.

Default:
  • Automatically generated name

evaluation_interval

The frequency at which the alarm is evaluated.

Must be between 10 seconds and 3600 seconds.

pending_period

The duration that a contributor must continuously breach before the contributor transitions to ALARM state.

Default:
  • No pending period

query

The PromQL query that the alarm evaluates.

recovery_period

The duration that a contributor must continuously not be breaching before it transitions back to the OK state.

Default:
  • No recovery period