hapi-newrelic
v1.1.0
Published
Hapi plugin to configure transaction names for routes
Downloads
7
Readme
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
- Fork it:
git clone https://github.com/softonic/hapi-newrelic.git
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some feature'
- Check the build:
npm run build
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D