https://github.com/softonic/hapi-newrelic
Hapi plugin that allows to define custom transaction names for routes in New Relic.
https://github.com/softonic/hapi-newrelic
Last synced: about 1 year ago
JSON representation
Hapi plugin that allows to define custom transaction names for routes in New Relic.
- Host: GitHub
- URL: https://github.com/softonic/hapi-newrelic
- Owner: softonic
- License: other
- Created: 2016-11-13T12:04:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T13:31:28.000Z (over 6 years ago)
- Last Synced: 2025-03-14T18:02:56.106Z (about 1 year ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 22
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# hapi-newrelic
Hapi plugin that allows to define custom transaction names for routes in New Relic.
## Installation
```bash
npm install hapi-newrelic
```
## Usage
```javascript
// 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:
```bash
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`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D