在 Heat 中支持 aodh 复合告警

https://blueprints.launchpad.net/heat/+spec/add-aodh-composite-alarm

添加 Aodh 复合告警资源插件。

问题描述

由于一些难以解决的问题,aodh 中的组合类型告警已被弃用。我们同步弃用了 OS::Aodh::CombinationAlarm,请参阅

https://blueprints.launchpad.net/heat/+spec/migrate-to-use-aodh-for-alarms

建议使用功能上与组合告警类似的复合规则告警。

提议的变更

在 resources/openstack/aodh/ 下添加以下资源:

  • OS::Aodh::CompositeAlarm

    • description

      告警的描述。 - 可选 - 类型:String - update_allowed

    • severity

      告警的严重程度。 - 可选 - 类型:Integer - update_allowed - 约束:可以是 [‘low’, ‘moderate’, ‘critical’] 中的一个 - 默认值:low

    • enabled

      如果启用告警评估,则为 True。 - 可选 - 类型:Boolean - update_allowed - 默认值:True

    • alarm_actions

      当状态转换为告警时要调用的 URL(webhook)列表。 - 可选 - 类型:List - update_allowed

    • ok_actions

      当状态转换为 ok 时要调用的 URL(webhook)列表。 - 可选 - 类型:List - update_allowed

    • insufficient_data_actions

      当状态转换为 insufficient-data 时要调用的 URL(webhook)列表。 - 可选 - 类型:List - update_allowed

    • repeat_actions

      如果告警保持在目标状态,则是否应重复通知操作。 - 可选 - 类型:Boolean - update_allowed - 默认值:True

    • time_constraints

      描述告警的时间约束。 - 可选 - 类型:List

    • composite_rule

      JSON 格式的复合阈值规则。 - 必需 - 类型:Map - update_allowed - 模式:{‘operator’: ‘or’/’and’, ‘rules’: [rule1, rule2…]}

以下是复合告警的示例

Resources:
  my_composite_alarm:
    type: OS::Aodh::CompositeAlarm
    properties:
      composite_rule:
        operator: or
        rules:
        - type: threshold
          meter_name: cpu_util
          evaluation_periods: 1
          period: 60
          statistic: avg
          threshold: 0.8
          comparison_operator: ge
          exclude_outliers: false
        - and:
          - type: threshold
            meter_name: disk.usage
            evaluation_periods: 1
            period: 60
            statistic: avg
            threshold: 0.8
            comparison_operator: ge
            exclude_outliers: false
          - type: threshold
            meter_name: mem_util
            evaluation_periods: 1
            period: 60
            statistic: avg
            threshold: 0.8
            comparison_operator: ge
            exclude_outliers: false
      description: a composite alarm
      ...... (other properties)

备选方案

实现

负责人

主要负责人

huangtianhua@huawei.com

里程碑

完成目标里程碑

ocata-1

工作项

  • 添加 OS::Aodh::CompositeAlarm 资源

  • 添加相关测试

  • 在 heat-templates 中添加使用 OS::Aodh::CompositeAlarm 的示例模板

依赖项