-
Notifications
You must be signed in to change notification settings - Fork 220
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
Improve documentation of sentry.Flush #106
Comments
Tracking issue to help users understand better how to use the SDK and avoid cases like #103 (comment)
|
Thanks @rhcarvalho I think this line in the example code is where I derived the confusion in semantics.
In conjunction to the exert... "By default, Sentry Go SDK uses an asynchronous transport, which in the code example below requires an explicit awaiting for event delivery to be finished using the sentry.Flush method. " Looking more closely this is followed by... "It would not be required inside a running goroutine or if you would use HTTPSyncTransport, which you can read about in the Transports section." So yes this could be considered correctly documented where each of my I can appreciate there's not an awful lot you can do to catch this without ramming a mutex in there. |
I randomly run into this code looking at Reddit r/golang today: gist-cleaner/backend/main.go#L312-L317 The usage of I plan to solve this in the coming weeks by implementing |
@mmacheerpuppy @BonnieMilian I acknowledge you might be busy. Given that you both ran into #103, I'd like to share that I've rewritten the example code and usage steps documented in the README.md of the Sentry Go SDK. I would appreciate feedback if you have any! The changes are live here: https://github.com/rhcarvalho/sentry-go/blob/readme/README.md#usage Hope to clear out any confusion with regards to Thanks a lot! |
@rhcarvalho Not a prbolem, is there a deadline on this PR? I can certainly find room for this this week! |
@mmacheerpuppy certainly not a deadline for you ;) Thanks ❤️ |
Documentation updates landed at
Considering this resolved. If anyone finds the updates unsatisfactory, please comment here or file a new issue and we'll iterate on it. |
The documentation in https://godoc.org/github.com/getsentry/sentry-go#Flush could be more specific to help users understand when
Flush
needs to be called, if at all.Similarly, the example code in https://docs.sentry.io/platforms/go/ can be improved to follow the same line.
Typically
Flush
should only be called once from the main goroutine when a program is terminating.Subtasks:
The text was updated successfully, but these errors were encountered: