Node.js › Deployment & Process Managers (PM2)

What does PM2's built-in monitoring dashboard (pm2 monit, or PM2 Plus) show, and what metrics are most useful for production operations?

Advanced

Answer

'pm2 monit' provides a real-time terminal dashboard showing each managed process's CPU usage, memory usage, and a live tail of recent log output; PM2 Plus (a paid hosted service) extends this with a web-based dashboard, historical metrics, custom application-level metrics, exception tracking, and alerting -- for production operations, the most actionable metrics are typically memory trend (to catch leaks before they cause a crash), restart count (frequent unexpected restarts signal an underlying problem), and CPU usage relative to the number of cluster instances running.
pm2 monit  # real-time terminal dashboard

# Programmatic access to the same metrics
pm2 jlist  # JSON output of all process metrics, useful for scripting alerts
Real-world example An operations team notices via 'pm2 monit' that one specific cluster worker's memory usage climbs steadily every few hours while its siblings remain stable, pointing them toward a memory leak that's somehow specific to whichever requests happen to land on that particular worker rather than an application-wide issue.

Common follow-ups: How would you pipe PM2's metrics into an external monitoring system like Prometheus or Datadog for longer-term historical analysis and alerting?;What does a consistently high restart count for a specific process typically indicate that CPU or memory metrics alone might not reveal?