I’m running NodeJS application in container environment and also using Pm2 for the processes. I want to know is there any way I can monitor the Pm2 instances health ? like if they are stale, running or restarting ? in Grafana.?
I think your best option is to use the
pm2-metrics package in npm:
It gets 12k downloads a week and will expose pm2 metrics on an endpoint for prometheus to scrape. See the npm page for installation and configuration details.
Once it’s configured and added to your
prometheus.yaml file, you can check out this related pm2 dashboard.