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
I have been working with the Go SDK for a while now and it's very pleasant to use and even includes a Sync transport.
I am now working in a Javascript project that uses a framework which unfortunately calls process.exit quite often. As a result, Sentry errors never make it to our dashboard, since Sentry doesn't have time to flush the buffer. I thought I could just set some option and force Sentry to wait for every single captureException call
Solution Brainstorm
One potential workaround would be to overwrite process.exit and call Sentry.close() in there.
I thought that I could also provide a sync transport (there appears to be none) so I tried something very simple:
constmakeTransport=(options: NodeTransportOptions): Transport=>{return{send: (e: Envelope): Promise<TransportMakeRequestResponse>=>{
console.log("send",e)// <-- console.log that transport is workingreturnPromise.resolve({statusCode: 200,headers: {"x-sentry-rate-limits": null,"retry-after": null,},});},flush: (timeout?: number): Promise<boolean>=>{
console.log("flush");returnPromise.resolve(true);},};};
Later in this file I am doing the following to trigger the custom transport:
I'd expect to see something in my console that indicates that send was called, but I don't. Is there some buffering going on before my custom transport is called?
It seems that there is currently no way to force Sentry to wait until every single captureException call has finished.
The text was updated successfully, but these errors were encountered:
Problem Statement
I have been working with the Go SDK for a while now and it's very pleasant to use and even includes a Sync transport.
I am now working in a Javascript project that uses a framework which unfortunately calls
process.exit
quite often. As a result, Sentry errors never make it to our dashboard, since Sentry doesn't have time to flush the buffer. I thought I could just set some option and force Sentry to wait for every singlecaptureException
callSolution Brainstorm
One potential workaround would be to overwrite
process.exit
and callSentry.close()
in there.I thought that I could also provide a sync transport (there appears to be none) so I tried something very simple:
Later in this file I am doing the following to trigger the custom transport:
I'd expect to see something in my console that indicates that
send
was called, but I don't. Is there some buffering going on before my custom transport is called?It seems that there is currently no way to force Sentry to wait until every single
captureException
call has finished.The text was updated successfully, but these errors were encountered: