Skip to content

Instantly share code, notes, and snippets.

@coreylight
Last active August 10, 2017 17:08
Show Gist options
  • Save coreylight/1fd05d66abb768e9eac412d439c4c97d to your computer and use it in GitHub Desktop.
Save coreylight/1fd05d66abb768e9eac412d439c4c97d to your computer and use it in GitHub Desktop.
const iopipeLib = require('iopipe');
const tracePlugin = require('iopipe-plugin-trace');
const iopipe = iopipeLib({
plugins: [tracePlugin()]
});
// wrap your lambda handler
exports.handler = iopipe((event, context) => {
const mark = context.iopipe.mark;
mark.start('database');
// after database call is finished
mark.end('database');
mark.start('analytics');
// after analytics call is finished
mark.end('analytics');
context.succeed('Wow!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment