Prometheus run on macOS
On macOS, you can run a Prometheus server by running the binary that is compatible with Apple silicon. If you are looking for information about what to do with Prometheus, check out a previous post to get an overview.
Install
If you are using a Mac, I recommend using homebrew to install Prometheus along with many other applications.
brew install prometheus
Configure prometheus
You can configure this Prometheus server by creating/updating the file /opt/homebrew/etc/prometheus.yml
Run prometheus in the background
You can run Prometheus with homebrew services or by running the installed binary.
/opt/homebrew/opt/prometheus/bin/prometheus_brew_services > ~/.prometheus.log 2>&1 &
This command will run prometheus and log the output to the file .prometheus.log
in your home directory.
When run from brew services
, prometheus
is run from
prometheus_brew_services
and uses the flags in:
$HOMEBREW_PREFIX/etc/prometheus.args
When Prometheus is running, an API is available on your local system http://localhost:9090
Using prometheus
You can use prometheus to collect many different types of metrics. Check out a previous post about prometheus and how to create graphs based on metrics collected using Grafana.