鄙人就任于某安全公司,团队的定位是研发安全产品云汇聚平台,为用户提供弹性伸缩的云安全能力。前段时间产品组提出了一个监控需求,大体要求:平台对vm实行动态实时监控,输出相应图表界面,并提供警报(资源不足等问题而产生)等功能。前端
通过团队调研,目前业界流行的监控方案大体有这么几种:基于 zabbix 的、基于 prometheus 的、基于 influxdb 等时序数据库的。结合当前咱们的业务场景来说,zabbix对咱们来讲有点重,而 influxdb 方案灵活可是投入的研发时间多是比较多的,prometheus就成了咱们的不二之选择。mysql
Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project and maintained independently of any company.To emphasize this, and to clarify the project's governance structure, Prometheus joined the Cloud Native Computing Foundation in 2016 as the second hosted project,after Kubernetes.nginx
大体就是说 prometheus是一个开源的监控,警报系统,最初呢是构建在SoundCloud之上的。。。而后不少公司组织都在用,活跃的开发者不少,社区也不少,反正很牛逼。。。这样。git
prometheus大体有这么几个组件组成:github
应该不须要怎么介绍了吧,我相信你们均可以看得懂。redis
有了prometheus这个强大的监控开源系统以后,咱们所须要投入的工做就是查询api的封装和配置文件的下发。查询api的封装没什么好说的,无非就是前端调用咱们本身的server,咱们的 server呢经过http协议去调用prometheus的api接口查询到原始数据,而后进行组装,最后返回给前端。 配置文件的话包含三部分吧,警报的定义,alertmanager的配置,以及prometheus的配置,这里也很差展开讲,有兴趣的能够去官网看看,最后给出一张咱们的物理结构示意图,供你们参考。 sql