Skip to content

Instantly share code, notes, and snippets.

@coreylight
Last active February 14, 2018 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreylight/b2e62e8da79e9cf554f1ed404047c037 to your computer and use it in GitHub Desktop.
Save coreylight/b2e62e8da79e9cf554f1ed404047c037 to your computer and use it in GitHub Desktop.
IOpipe with plugins for webpack
const iopipe = require('@iopipe/core');
const eventInfoPlugin = require('@iopipe/event-info');
const tracePlugin = require('@iopipe/trace');
module.exports = iopipe({
plugins: [
tracePlugin(),
eventInfoPlugin()
]
});
const iopipeWrapper = require('./iopipeWrapper');
module.exports = iopipeWrapper((event, context) => {
// insert lambda business logic here
context.iopipe.mark.start('sample-trace');
// do some work you want to trace
context.iopipe.mark.end('sample-trace');
context.iopipe.log('custom-metric', 100);
context.succeed();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment