Code Monkey home page Code Monkey logo

pm2-notifier's Introduction

#pm2-newrelic-notifier Send PM2 error notifications to newrelic. Both errors and notifications are configurable.

To get it setup:

  1. Generate config.json
  2. Add your newrelic configuration in newrelic.js
  3. Run it

Generate config.json

Generate a config.json file in the main project directory, containing the PM2 events and the error message that's being sent to NewRelic.

Example:

"events": {
  "process:exit:overlimit": "[PM2] Exit Overlimit",
  "process:exception": "[PM2] Exception received"
}

A list of PM2 events:

  • process:online when a process is started / restarted
  • process:exit when a process is exited
  • process:exit:overlimit when a process was restarted and exited the maximum allowed amount of times (15 by default)
  • process:exception when a process has received an UncaughtException

A full list of PM2 events can be found at the (PM2 interface repository page)[https://github.com/Unitech/pm2-interface#notifications].

Add your NewRelic configuration in newrelic.js

In order for NewRelic to work, it needs a configuration which requires at least an app_name and a license_key. Additional configuration options can be given here as well. NewRelic requires you to add this configuration in a newrelic.js file that has to exist in your main directory.

Full documentation of the NewRelic can be found at the (NodeJS NewRelic repository page)[https://github.com/newrelic/node-newrelic].

Run it

Run your app

pm2-notifier's People

Stargazers

Nerijus avatar

Watchers

James Cloos avatar Christiaan van Bemmel avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.