I think I resolved it and I figured I’d post here my solution:
function createSentry(app) {
Sentry.init({
environment: process.env.NODE_ENV,
dsn: config.sentryDsn,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({ app }),
],
tracesSampler: (samplingContext) => {
if (samplingContext?.transactionContext?.name === 'GET /healthcheck') {
return false
}
return true
},
})
return Sentry
}