-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SentrySDK.flush() #1013
Comments
The reason we didn't have |
+1 for this. In some weird cases, our app would crash on launch without allowing time for the Sentry SDK to report the bug. When the user restarts, then same behavior would happen again thus accumulating crash logs locally. Having a Any timeline for the availability of this: Thanks |
Hey, @martindufort. We don't have plans to add flush soon. What you described should be solved with #316. So ideally, our SDK would handle everything, and you don't need to call flush manually. |
Hey @philipphofmann, You are totally right. After investigation on our side, we found the boot crash was occuring before the Sentry SDK was initialized. 😵💫. We changed our initialization sequence tp ensure Sentry is initialized before the boot crash. |
Thanks for the update, @martindufort. |
Do you plan to make I read somewhere that events are "send and forget" by design, which is understandable. I still think it would be nice to know once all events have ben sent via that method. The particular use cases I can think of for having a completion acknowledgement mechanism of sort are:
Thanks! |
Add blocking flush to send out all envelope items. Fixes GH-1013
@mokagio, yes, the call will be blocking with a timeout parameter. Similar to |
Thanks! As a consumer, I would really love a completion handler. I'm guessing the choice of making it blocking with a timeout is to cope with the possibility of having a long stash of events to send and not being able to guarantee they'll all be sent in a reasonable time? |
Yes, indeed. We don't have a completion handler in any of our SDKs. It's not part of our unified API, see https://develop.sentry.dev/sdk/unified-api/#client. Still, you could build your own completion handler with something like SentrySDK.capture(message: "Your message")
let queue = DispatchQueue(label: "YourQueue")
queue.async {
SentrySDK.flush(timeout: 1000000)
// call your completion handler
} |
Add blocking flush to send out all envelope items. Fixes GH-1013
The unified API states that the SDK should offer
flush
to flush all queued events; see https://develop.sentry.dev/sdk/unified-api/#client. Checkout the implementation, for example, of .NET as a reference.Please upvote if this is a feature you want.
The text was updated successfully, but these errors were encountered: