-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Revise Shutdown and Draining section #1512
Revise Shutdown and Draining section #1512
Conversation
f7a7ade
to
a540aa4
Compare
The only language I didn't touch was C#/.NET. This was intentional, as I believe @bruno-garcia would rather not mention Flush, and the current state seems to be accurate. The global changes would still take effect, and I think generally the edits make sense for C#:
BEFORE AFTER |
if sentry.Flush(time.Second * 2) { | ||
fmt.Println("All queued events delivered!") | ||
} else { | ||
fmt.Println("Flush timeout reached") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally omit checking on the return value of sentry.Flush
.
Printing debug messages is redundant, and the same visibility can be achieved by enabling debug logging on the SDK.
There's nothing useful users can do if Flush
times out. For instance, retrying is not an option because that could be replaced with a longer timeout to begin with, and typically Flush is called in a moment where the program should not hang indefinitely (and that's the very reason for having a timeout).
src/collections/_documentation/error-reporting/configuration/drain-example/javascript.md
Show resolved
Hide resolved
After calling `close` the current client cannot be used any more so make sure to | ||
only do that right before you shut down the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved here from the global context, with one important edit: "the client" => "the current client".
If you use multiple clients, arrange for each of them to be flushed as | ||
appropriate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to add a similar note for other languages?
src/collections/_documentation/error-reporting/configuration/drain-example/javascript.md
Show resolved
Hide resolved
```javascript | ||
```rust |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops 😄
After shutdown the current client cannot be used any more so make sure to only | ||
do that right before you shut down the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved here from the global context, with one important edit: "the client" => "the current client".
Typically SDKs provide two ways to shut down: a controlled shutdown where the system will wait up to about two | ||
seconds to flush out events (configurable) and an uncontrolled shutdown (also referred to as "killing" the | ||
client). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't sound useful to me. It is a generic statement, and unclear whether it applies to the SDK the user is interested in.
Each language/platform from the dropdown includes the relevant mechanisms that exist in that language/platform.
After shutdown the client cannot be used any more so make sure to only do that right before you shut down | ||
the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to the languages/platforms where it applies.
Most SDKs use a background queue to send out events. Because the queue sends asynchronously in the background | ||
it means that some events might be lost if the application shuts down unexpectedly. To prevent this all SDKs | ||
provide mechanisms to cope with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded.
src/collections/_documentation/error-reporting/configuration/drain-example/go.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small nitpick from me. Nicely done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving on this
@MimiDumpling could you please have a look? |
@rhcarvalho I'll try to have it done by EOD, if not tomorrow. :smile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple edits. 😸 Thanks for updating the docs!
src/collections/_documentation/error-reporting/configuration/drain-example/javascript.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/javascript.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/javascript.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/native.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/native.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/python.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/python.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/rust.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/configuration/drain-example/rust.md
Outdated
Show resolved
Hide resolved
Thanks @MimiDumpling!!! Amazing, thanks for your help! I do have a couple of questions before applying the suggestions, to make sure we stay both technically correct and with good prose :) (inline comments re: "only" and re: "right before") |
Happy to help! 😄 Made some alternate suggestions. Let me know if they work well with the technical accuracy. If not, we can try other sentence structures. |
Co-Authored-By: Kamil Ogórek <kamil.ogorek@gmail.com> Co-Authored-By: Tien "Mimi" Nguyen <tienmiminguyen@gmail.com>
3ce07b6
to
72cbdce
Compare
Applied suggestions from Mimi, merging this in. |
The original motivation was a continuation to getsentry/sentry-go#106, to clarify the usage of
Flush
in the Go SDK.I went ahead and revised the contents for other languages as well.