一、安裝
windows-exporter源碼
下載對應(yīng)版本
在windows中使用二進(jìn)制方式部署
安裝好之后,打開 http://127.0.0.1:9182/metrics
二、接入prometheus
1、通過靜態(tài)文件配置加入
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["127.0.0.1:9182"]
三、圖表
1、grafana
https://grafana.com/grafana/dashboards/
搜索:windows
https://grafana.com/grafana/dashboards/14694-windows-exporter-dashboard/
之后下載,導(dǎo)入到grafana里
2、夜鶯
夜鶯內(nèi)置了一些常用exporter采集圖表
我用的是社區(qū)版:v7.0.0,從儀表盤 -> 內(nèi)置儀表盤 -> 搜索windows -> 點(diǎn)擊搜索到的,選擇帶有 Node Exporter的圖表

Pasted image 20240708124220.png
四、監(jiān)控
一般需要對這些比較核心的指標(biāo)進(jìn)行配置告警
夜鶯里面也有內(nèi)置一些常用的監(jiān)控策略,從告警管理 -> 內(nèi)置規(guī)則 -> windows,選擇 windows_by_exporter

Pasted image 20240708124344.png