pm2 install pm2-metrics $ git clone https://github.com/saikatharryc/pm2-prometheus-exporter.git
$ npm install
$ pm2 start exporter.js --name pm2-metricshttp://<HOST>:9209/metricsin prometheus.yaml
inside scrape_configs add this block:
- job_name: pm2-metrics
scrape_interval: 10s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9209