导语:为了排查wsl 异常退出的原因打算在windows和wsl中都装一个promehtues+grafana监控
下载安装promehtues
https://prometheus.io/download/
下载安装windows_exporter 双击ms文件i运行
https://github.com/prometheus-community/windows_exporter/releases
查看http://172.16.20.176:9182/metrics 是否可以显示windows信息
在promehtues.yml的scrape_configs:下添加
- job_name: "windows"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["172.16.20.176:9182"]
修改完成之后双击运行prometheus.exe
查看http://172.16.20.176:9090/targets?search= 上是否有对应的windows exporter信息
下载安装grafana 双击运行
https://grafana.com/grafana/download?platform=windows
访问http://172.16.20.176:3000 默认账号密码 admin/admin
导入数据源为prometheus 并导入grafana的win10 模版
grafana win10 监控模版
https://grafana.com/api/dashboards/12566/revisions/1/download
效果展示如下

参考
https://blog.csdn.net/florachy/article/details/124142696
http://t.zoukankan.com/guoxiangyue-p-11777227.html
https://www.jianshu.com/p/733acba6fbd5
https://www.shangyouw.cn/win7/arc224289.html