架构图

Winchester 来蒸馏notification,变成event,再利用Streams 转换成新的event或者notification。

类似于Ceilometer event处理,由event handler把notification转换成Ceilometer event并存储起来。

最后Notabene 可以把Winchester出来的notification重新发布到message bus上做进一步的处理,这个过程可以反复。

这个对应到Ceilometer上就是把event transformer出来的event转换成notification在重新发布到message bus上,可以进一步,比如把它处理成meter,

Ceilometer正在实现这个功能,BP在这儿:event to sample publisher https://review.openstack.org/#/c/223926/

Yagi配置:

[global]
verbose = False
debug = True
update_timer = 10 [event_worker]
event_driver = yagi.broker.rabbit.Broker [rabbit_broker]
host = localhost
user = guest
password = guest
port = 5672
vhost = /
poll_delay = 0.5 [consumers]
queues = monitor.info [consumer:monitor.info]
apps = winchester.yagi_handler.WinchesterHandler, yagi.handler.shoebox_handler.ShoeboxHandler
exchange = monitor
exchange_type = topic
routing_key = monitor.info
durable = True
max_messages = 100

从Notifications 到 Events的提取,由winchester.yagi_handler:WinchesterHandler来做这部分工作。

把Notifications中有用的field提取为event的 Traits。在配置文件中定义。

例子:

- event_type: compute.instance.*
traits:
tenant_id:
fields:
- payload.tenant_id
- _context_project_id
user_id:
fields: payload.user_id
request_id:
fields: _context_request_id
instance_id:
fields:
- payload.instance_uuid
- payload.instance_id
- exception.kwargs.uuid
- instance.uuid

这点和ceilometer很类似,ceilometer的配置文件event_definitions中定义了每个event需要提前哪些traits。

接下来就是在streams中处理event,streams就是事件分发到的bucket(Streams are buckets that collect events)。

采用类似于ceilometer中的event pipeline机制。把event分发到pipeline,pipeline中最后部分是handler,

Winchester 配置文件:

---
database:
url: mysql://winchester:testpasswd@localhost/winchester distiller_config: event_definitions.yaml
trigger_definitions: triggers.yaml
pipeline_config: pipelines.yaml pipeline_handlers:
logger: winchester.pipeline_handler:LoggingHandler
usage: winchester.pipeline_handler:UsageHandler
notabene: winchester.pipeline_handler:NotabeneHandler

其中:

trigger_definitions: triggers.yaml 中决定

  • into which streams to place incoming events
  • which events to accept into a stream
  • when a stream is ready for processing
  • when a stream expires
  • how to process ready streams
  • how to process expired streams
- name: my_trigger
distinguished_by:
- request_id
expiration: "$last + 1h"
fire_pipeline: "my_fire_pipeline"
expire_pipeline: "my_expire_pipeline"
match_criteria:
- event_type:
- compute.instance.*
fire_criteria:
- event_type: compute.instance.*.end

上面 distinguished_by:request_id,也就是不同的request发到不同的stream bucket中。

match_criteria定义这个pipelinez需要处理的事件,类似ceilometer event_pipeline,yaml中的source - events配置。

fire_criteria: 定义了何时触发stream bucket中的event的处理。比如最后一次收到事件之后的2小时,或者基于特定事件如收到compute.instance.*.end。

最后如何处理stream bucket中的event定义在fire_pipeline: "my_fire_pipeline"中。可以有多个pipeline handlers, 类似于ceilometer event_pipeline,yaml中

的sinks中的publisher。

fire_pipeline的配置:

---
my_fire_pipeline:
- logger
- usage
- name: notabene
params:
host: localhost
user: guest
password: guest
exchange_type: topic
queue_name: monitor.info
env_keys:
- usage_notifications my_expire_pipeline:
- logger
- usage

再来看看pipeline中的handler:

UsageHandler is a pipeline handler for determining the daily usage of every instance with an OpenStack Nova deployment

NotabeneHandler will take any new notifications (not events)publish them to the RabbitMQ exchange specified.

总结与Ceilometer的区别:

stacktach只用来处理notification

ceilometer可以处理notification和meter还有alarm

都可以把notification转换成event来保存和处理,stacktach的处理更丰富和到位

ceilometer主要还是生成数据和meter

stacktach中的pipeline不能单个或者2个event做transformer。

stacktach有处理触发机制,一次对bucket event处理,效率更高。

https://github.com/openstack/stacktach

http://stacktach.readthedocs.org/

http://stacktach.com/about.html

https://www.openstack.org/summit/openstack-summit-hong-kong-2013/session-videos/presentation/stacktach-ceilometer-integration

最新文章

  1. 新手 gulp+ seajs 小demo
  2. 解决iis7只能上传30M文件的限制
  3. js实现点击增加文本输入框
  4. IE禁用Cookie后的session处理
  5. Web前端小白入门指迷
  6. PHP中PDO的配置与说明
  7. You must install 'hg' on your build machine
  8. android 反编译 逆向工具整理
  9. [Bootstrap]组件(二)
  10. 李洪强漫谈iOS开发[C语言-011] - C语言标示符
  11. SQL2008-删除时间字段重复的方法
  12. Android 获取天气预报
  13. linux教程之四
  14. Java JDBC连接SQL Server2005错误:通过port 1433 连接到主机 localhost 的 TCP/IP 连接失败
  15. UDK——入门开发流程
  16. php处理金额显示的一些笔记
  17. iOS开发者需要的5款排版工具
  18. 关于Java常见的误解
  19. macOS上的ODBC-利用unixODBC连接PostgreSQL与SQLite并进行数据迁移
  20. MySql基础总结

热门文章

  1. CSS如何清除浮动流的多种方案
  2. mixin 在传参中可以出现 参数 在类内部可以定义 作用域
  3. 全面Python小抄(转)
  4. 洗牌算法Fisher-Yates以及C语言随机数的产生
  5. c# HttpClient获取网页源码
  6. SpringBoot入门1—简介及helloworld
  7. 3.1 使用STC89C52控制MC20拨打电话
  8. 剑指offer 面试15题
  9. 曾经跳过的坑----js截取字符串substr与substring 和 trim
  10. idea java web 使用说明