pm2plugin

2.2.1 • Public • Published

pm2plugin

This plugin will pull data from PM2 and publish to New Relic as a plugin

Fork of https://github.com/kenahrens/newrelic-pm2-plugin. Allows plugin to be required as a node module and the poller triggered programatically.

Installation instructions

  • Install the dependency npm install pm2plugin or yarn add pm2plugin
  • In your app's startup script, after you start your app in PM2, require the plugin and pass your New Relic license key to start the listener.
if (process.env.NEW_RELIC_LICENSE_KEY) {
    require('pm2plugin')(process.env.NEW_RELIC_LICENSE_KEY, true);
}

Parameters

pm2plugin(license, debug, hostname, guid, version, url)
Param Type Default Description
license String Required New Relic License Key
[debug] Boolean false Output debug info to the console?
[hostname] String os.hostname() Component name to be shown in NR
[guid] String com.newrelic.pm2plugin NR plugin Guid
[version] String version from package.json The version of the plugin
[url] String https://platform-api.newrelic.com/platform/v1/metrics The new relic url to post to

PM2 Dashboard

History

  • 2.2.0 - Add hostname parameter
  • 2.0.0 - Convert for use as node module
  • 1.1.0 - Metrics for each PM2 process and added restarts per interval
  • 1.0.4 - Close the connection to PM2 on each poll cycle
  • 1.0.3 - Fix for when errors are not properly handled from Plugin API
  • 1.0.2 - Support for multiple PM2 Servers (run on each PM2 instance)
  • 1.0.1 - Support for single PM2 Server only, separate config file
  • 1.0.0 - Initial prototype

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.1
    13
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.2.1
    13
  • 2.2.0
    1
  • 2.1.0
    1
  • 2.0.0
    1

Package Sidebar

Install

npm i pm2plugin

Weekly Downloads

16

Version

2.2.1

License

MIT

Unpacked Size

134 kB

Total Files

10

Last publish

Collaborators

  • webdevian