Skip to content

Instantly share code, notes, and snippets.

@juliantellez
Last active November 13, 2019 21:35
Show Gist options
  • Save juliantellez/70af760ca084611698afc06a37e2f126 to your computer and use it in GitHub Desktop.
Save juliantellez/70af760ca084611698afc06a37e2f126 to your computer and use it in GitHub Desktop.
Create Lambcycle Plugin
import * as Sentry from '@sentry/node';
import MyAwesomeIntegration from './MyAwesomeIntegration'
const sentryPlugin = (config) => {
Sentry.init({
dsn: `https://${config.key}@sentry.io/${config.project}`,
integrations: [new MyAwesomeIntegration()]
});
return {
config,
plugin: {
onPreResponse: async (handlerWrapper, config) => {
Sentry.captureMessage('some percentile log perhaps?')
},
onError: async (handlerWrapper, config) => {
Sentry.captureException(handlerWrapper.error);
}
}
}
}
export default sentryPlugin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment