1.1.0 • Published 6 years ago

hapi-newrelic v1.1.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

hapi-newrelic

Hapi plugin that allows to define custom transaction names for routes in New Relic.

Installation

npm install hapi-newrelic

Usage

// CommonJS
// const HapiNewRelic = require('hapi-newrelic');

// ES6
import HapiNewRelic from 'hapi-newrelic';
import newrelic from 'newrelic';

// Registration
server.register({
  register: HapiNewRelic,
  options: { newrelic }
}, err => {});

// Route
server.route({
  method: 'GET',
  path: '/',
  handler: function() {},
  config: {
    plugins: {
      'hapi-newrelic': {
        transactionName: 'root_page'
      }
    }
  }
});

Testing

Clone the repository and execute:

npm test

Contribute

  1. Fork it: git clone https://github.com/softonic/hapi-newrelic.git
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Added some feature'
  4. Check the build: npm run build
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D