如果 prometheus 在 mac 上作为服务运行,如何更新 prometheus.yml 文件? 请分享在 mac 上更新 prometheus prometheus.yml 文件的命令。
如果您使用brew安装了prometheus,并使用
brew services start prometheus
运行
你可以编辑/usr/local/etc/prometheus.yml
中的配置文件,然后你可以使用命令brew services restart prometheus
重新启动prometheus
我的配置文件位于不同的目录中:
/opt/homebrew/etc/prometheus.yml
安装后有一些帮助文本,参数在此处设置
/opt/homebrew/etc/prometheus.args
。
args 有一个配置文件所在位置的键:
--config.file /opt/homebrew/etc/prometheus.yml
--web.listen-address=127.0.0.1:9090
--storage.tsdb.path /opt/homebrew/var/prometheus