支持 Ceilometer 告警 Gnocchi 规则

https://blueprints.launchpad.net/heat/+spec/ceilometer-gnocchi-alarm

Gnocchi 提供了两种新型的 Ceilometer 告警规则,允许查询 Gnocchi API 而不是 Ceilometer API 来检索关于 Ceilometer 监控指标的统计信息。

此蓝图建议添加相应的 heat 资源

  • OS::Ceilometer::GnocchiResourcesAlarm

  • OS::Ceilometer::GnocchiMetricsAlarm

问题描述

现在可以将 Ceilometer 样本发送到 Gnocchi,除了传统的数据库之外,还可以创建查询 Gnocchi API 而不是 Ceilometer API 来检索统计信息的告警。但目前我们无法使用 heat 创建这种告警,此 BP 将解决此问题。

提议的变更

像这样添加 OS::Ceilometer::GnocchiResourcesAlarm

resources:
  type: OS::Ceilometer::GnocchiResourcesAlarm
  properties:
    description: Scale-down if the average CPU < 15% for 1 minutes
    metric: cpu_util
    aggregation_method: mean
    granularity: 300
    evaluation_periods: 1
    threshold: 1
    comparison_operator: lt
    alarm_actions:
      - {get_attr: [web_server_scaledown_policy, alarm_url]}
    resource_type: instance
    resource_constraint:
      str_replace:
        template: 'server_group=stack_id'
        params:
          stack_id: {get_param: "OS::stack_id"}

像这样添加 OS::Ceilometer::GnocchiMetricsAlarm

resources:
  type: OS::Ceilometer::GnocchiMetricsAlarm
  properties:
    description: Scale-down if the average CPU < 15% for 1 minutes
    metrics: ["09ff6ad8-1704-4f18-8989-6559307dfe79",
              "dea49e52-be42-4c71-bd77-fe265b1b6dbb"]
    aggregation_method: mean
    granularity: 300
    evaluation_periods: 1
    threshold: 1
    comparison_operator: lt
    alarm_actions:
      - {get_attr: [web_server_scaledown_policy, alarm_url]}

这些资源将开始存在于 /contrib 中,并在 gnocchi 移动到 openstack 命名空间后 k-3 之后移动到受支持的资源中。

备选方案

使用场景

我想创建一个在 Gnocchi 计算的一组 vm 的 cpu_util 统计信息达到某个阈值时进行缩减的自动伸缩组

resources:
  type: OS::Ceilometer::GnocchiResourcesAlarm
  properties:
    description: Scale-down if the average CPU < 15% for 1 minutes
    metric: cpu_util
    aggregation_method: mean
    granularity: 300
    evaluation_periods: 1
    threshold: 1
    comparison_operator: lt
    alarm_actions:
      - {get_attr: [web_server_scaledown_policy, alarm_url]}
    resource_type: instance
    resource_constraint:
      str_replace:
        template: 'server_group=stack_id'
        params:
          stack_id: {get_param: "OS::stack_id"}

实现

负责人

主要负责人

Mehdi Abaakouk <sileht@redhat.com>

里程碑

完成目标里程碑

Kilo-3

工作项

  • 添加新的 Ceilometer 告警资源

依赖项

参考资料