Hey there,
I’ve got a Gatsby + Netlify site and would like to integrate Sentry to monitor lambda functions. I’m a little confused because I’ve seen a tutorial here and there where they use @sentry/node
, but there’s also @sentry/serverless
for AWS Lambda functions.
I know Netlify uses AWS under the hood for functions, so my assumption was to follow Sentry’s AWS Lambda integration docs.
However, when I follow their guide, no errors are being reported. I’m basically doing this
const Sentry = require("@sentry/serverless");
const {
SENTRY_DSN
} = require('./config')
Sentry.AWSLambda.init({
dsn: SENTRY_DSN,
tracesSampleRate: 1.0,
});
exports.handler = Sentry.AWSLambda.wrapHandler(async (event, context) => {
// ... some code here
let someVariable
try {
someVariable = await someFetchRequest()
throw new Error('this is a Sentry test error')
} catch (err) {
return statusReturn(500, { error: err.message })
}
});
Yet, no issues are coming in. The docs say that this is all you need to start capturing error events within the handler.
Am I taking the wrong approach?
Thanks in advance