鄙人就任於某安全公司,團隊的定位是研發安全產品雲匯聚平臺,爲用戶提供彈性伸縮的雲安全能力。前段時間產品組提出了一個監控需求,大體要求:平臺對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