Closed
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
"@sentry/node": "^5.27.4",
"@sentry/serverless": "^5.27.4",
Description
I've noticed that the response time of my functions is slow, added tracing, and noticed that at the end of every invocation my lambda sends POST request to sentry. Here you can see a trace:
It's okay to increase response time for requests with error, but if there is no error, I expect that response would be sent immediately. There is minimal code that I've tested:
import * as Sentry from '@sentry/serverless';
Sentry.AWSLambda.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1.0
});
export const handler = Sentry.AWSLambda.wrapHandler(
(event, context, callback) => {
context.callbackWaitsForEmptyEventLoop = false;
callback(null, { statusCode: 200 });
},
{ callbackWaitsForEmptyEventLoop: false, flushTimeout: 2000 }
);