日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

Prometheus和NodeExporter安裝監控數據說明_其它綜合

作者:LiberHome ? 更新時間: 2022-09-08 編程語言

在mac下載安裝prometheus

  • 在https://prometheus.io/download/下載prometheus放到自定義的位置。
  • 解壓壓縮包
  • 創建data文件夾mkdir -p data

mac下安裝Node Exporter

(NodeExporter是Prometheus提供的一個可以采集到主機信息的應用程序,它能采集到機器的 CPU、內存、磁盤等信息)

cd到目標目錄,然后用命令下載二進制包

curl -OL https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.darwin-amd64.tar.gz

解壓這個二進制包

tar -xzf node_exporter-1.3.1.darwin-amd64.tar.gz

進入&運行node exporter

cd node_exporter-1.3.1.darwin-amd64
cd ..
cp node_exporter-1.3.1.darwin-amd64/node_exporter /usr/local/bin/node_exporter

運行

cd ...
cd /usr/local/bin
./node_exporter

訪問http://localhost:9100/看到

點擊http://localhost:9100/metrics進去可以看到

# HELP node_cpu Seconds the cpus spent in each mode.
# TYPE node_cpu counter
node_cpu{cpu="cpu0",mode="idle"} 362812.7890625
# HELP node_load1 1m load average.
# TYPE node_load1 gauge
node_load1 3.0703125

數據說明

  • HELP 解釋當前指標的含義
  • TYPE 說明當前指標的數據類型
  • node_cpu的注釋表明當前指標是cpu0上idle進程占用CPU的總時間
  • CPU占用時間是一個只增不減的度量指標,從類型中也可以看出node_cpu的數據類型是計數器(counter)
  • node_load1 該指標反映了當前主機在最近一分鐘以內的負載情況 指標類型為儀表盤(gauge)

參考文檔?https://yunlzheng.gitbook.io/prometheus-book/

原文鏈接:https://segmentfault.com/a/1190000042115225

欄目分類
最近更新