Last active
November 13, 2019 21:35
-
-
Save juliantellez/70af760ca084611698afc06a37e2f126 to your computer and use it in GitHub Desktop.
Create Lambcycle Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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