一、安装Prometheus
1、下载安装
brew install prometheus
2、安装路径
/opt/homebrew/Cellar/prometheus/3.1.0
3、修改配置文件
默认配置文件路径:/opt/homebrew/etc/prometheus.yml
global:scrape_interval: 15sscrape_configs:- job_name: "prometheus"static_configs:- targets: ["localhost:9090"]
3、启动方式
(1)后台运行(推荐)
cd /opt/homebrew/Cellar/prometheus/3.1.0/bin
prometheus --config.file=/opt/homebrew/etc/prometheus.yml &
(2)立即启动,并登录时启动
brew services start prometheus
(3)临时启动
/opt/homebrew/opt/prometheus/bin/prometheus_brew_services