newrelic-lambda-apm-wrapper
v0.2.0
Published
AWS Lambda handler wrapper for Newrelic APM
Downloads
1
Readme
Newrelic Lambda APM Wrapper
Currently, only wraps a background transaction.
Example
handler.js in lambda
const nr = require('newrelic');
const createBackgroundTransaction = require('newrelic-lambda-apm-wrapper').createBackgroundTransaction.bind(null, nr);
exports.someFunction = createBackgroundTransaction('SomeFunction', (event, context) => {
// figure out some stuff
return someWork(event)
.then(result => {
statusCode: 200,
body: JSON.stringify(result)
});
});