0

I am running a third-party NodeJS application, and I would like to get some, any sort of performance metrics out of it. Request times, memory usage, CPU usage, anything would be better than the nothing I'm currently getting.

This application uses PM2, and is the only application running in this NodeJs server (other than the pm2-logrotate module). I found the pm2-metrics NodeJs module (https://github.com/saikatharryc/pm2-prometheus-exporter) but it doesn't seem to export metrics for the other application running in PM2 (or I'm installing it incorrectly; I am not at all familiar with NodeJs).

How can I unintrusively add Prometheus metrics exporting to an existing NodeJs application?

Mark
  • 11,257
  • 11
  • 61
  • 97
  • This module seems to export only metrics related to the management of the instances (cpu, memory, uptime ...). If you want additional metrics, you need to instrument your application. See https://github.com/siimon/prom-client – Michael Doubez May 11 '19 at 22:06
  • @MichaelDoubez but this isn't my application; I can't instrument it. – Mark May 13 '19 at 15:11
  • If the application doesn't expose metrics or doesn't use components that do, you are back to blackbox monitoring. Don't you have even logs ? – Michael Doubez May 14 '19 at 19:07
  • If you don't have anything, from the answer to https://stackoverflow.com/questions/29905547/standard-node-js-metrics, you may use appmetrics module. – Michael Doubez May 14 '19 at 19:20

0 Answers0