1.安装Prometheus
(mac)
brew install prometheus
2.启动Prometheus
nohup prometheus --web.enable-lifecycle --config.file=/Users/admin/Downloads/study/prometheus-study/src/main/resources/prometheus.yml &
tips:关闭Prometheus
curl -X POST http://localhost:9090/-/quit
3.安装Grafana
brew install grafana
4.启动Grafana
brew services start grafana
关闭Grafana
brew services stop grafana
5.登录http://127.0.0.1:3000
,用户名/密码:admin/admin
6.在Grafana
上新增Prometheus
的数据源,配置的url为http://127.0.0.1:9090
7.创建查询面板,填写查询语句prometheus_demo_gauge{application="prometheus-study"}
8.保存查询面板,完工