I use the "@sentry/node" package and I'd like to know if there's some unsent messages inside the library's queue. As I can see, library's captureException
and similar functions are synchronous and therefore messages are queued and sent afterwards. I need a way to wait until all messages are sent before I quit my application.
You can achieve this with await Sentry.flush(timeout)
, or Sentry.close(timeout)
, see: https://docs.sentry.io/platforms/node/guides/connect/configuration/draining/