安装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
本文详细介绍了如何在Mac上使用Homebrew安装Prometheus,配置新的scrape任务,以及启动并同步Grafana。重点在于如何修改prometheus.yml以添加新监控目标,并展示了默认密码。
578

被折叠的 条评论
为什么被折叠?



