安装Prometheus
brew install prometheus
查看安装路径
brew list prometheus
查找prometheus.yml,通过上面查看安装路径复制前缀查询
(mac不同系统版本有差异,所以要搜索出来)
find /opt -name prometheus.yml
默认prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
修改prometheus.yml新增个任务
global:
scrape_interval: 5s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "pulsar"
static_configs:
- targets: ["localhost:8080"]
启动prometheus
prometheus --config.file=你执行上面命令查询出的prometheus.yml绝对路径
安装Grafana
brew install grafana
启动Grafana
brew services start grafana
默认密码 admin/admin