天天看點

Prometheus監控系統(三)Prometheus與Grafana內建

Grafana是一款采用Go語言編寫的開源應用,主要用于大規模名額資料的可視化展現,是網絡架構和應用分析中最流行的時序資料展示工具。目前已支援絕大部分常用的時序資料庫。

下載下傳位址為:https://grafana.com/grafana/download

安裝Grafana:

啟動:

之後即可登陸:http://10.0.3.197:3000 通路grafana頁面。

通過DataSource建立一個Prometheus的dashboard:

Prometheus監控系統(三)Prometheus與Grafana內建

然後在Dashboard => Panel 中添加 Prometheus的界面,并執行PromQL即可:

Prometheus監控系統(三)Prometheus與Grafana內建

上面的是手動添加Dashboard的方式,比較繁瑣。Grafana社群鼓勵使用者分享Dashboard,通過https://grafana.com/grafana/dashboards 網站,可以找到大量使用的Dashboard模闆。

Grafana中所有的Dashboard通過JSON進行共享,下載下傳并導入這些JSON檔案,即可直接使用這些已經定義好的Dashboard。

在Dashboard官網搜尋Flink:

Prometheus監控系統(三)Prometheus與Grafana內建

例如我們使用這個模闆:

https://grafana.com/grafana/dashboards/11049

直接下載下傳JSON檔案即可。

然後在Grafana中導入JSON檔案:

Prometheus監控系統(三)Prometheus與Grafana內建

效果圖如:

Prometheus監控系統(三)Prometheus與Grafana內建

其他還有很多非常好用的dashboard,例如node exporter,可以繼續試一試。