You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently serverless deployments of @sentry/node are suffering from common issue of requests terminating before error is fully sent to Sentry. There has been some solutions proposed as using custom transport or overwriting captureException, but non of them will really work because captureException is almost always called without await, also in native Sentry integrations like Sentry.Handlers.errorHandler(). It means that in such cases lambda request will end without waiting for Sentry to report the error.
The only real solution to this problem is to create afterware that flushes sentry before sending each request (after request ends any remaining asynchronous code is terminated). I'd like to propose @sentry/node integration to add auto-flushing feature to Sentry.Handlers.requestHandler() (optionally Sentry.Handlers.requestHandler({ wait: true })) with code similar to following:
Currently serverless deployments of
@sentry/node
are suffering from common issue of requests terminating before error is fully sent to Sentry. There has been some solutions proposed as using custom transport or overwriting captureException, but non of them will really work because captureException is almost always called without await, also in native Sentry integrations like Sentry.Handlers.errorHandler(). It means that in such cases lambda request will end without waiting for Sentry to report the error.The only real solution to this problem is to create afterware that flushes sentry before sending each request (after request ends any remaining asynchronous code is terminated). I'd like to propose
@sentry/node
integration to add auto-flushing feature toSentry.Handlers.requestHandler()
(optionallySentry.Handlers.requestHandler({ wait: true })
) with code similar to following:It will force server to wait for any errors to be reported before sending finalizing request.
Please note that it won't fully work until #2000 is fixed because currently
_end.call
is called before transport has chance to fully deliver event.The text was updated successfully, but these errors were encountered: