-
-
Notifications
You must be signed in to change notification settings - Fork 149
Async submission by default #4
Comments
I'm quite happy with the explicitness of |
I can get behind that. Any purpose in keeping |
Do you mean |
I just figured out where some confusion is! It's based the truthiness of these statements: "A synchronous send to Sentry waits for the HTTP response and parses the returned However, I'm not convinced that's the way to think about it, and I'm feeling thorough: I've got 2️⃣ reasons Sentry isn't built this way, 3️⃣ examples of it not being built that way, and 1️⃣ demonstrated behavior of why the 3 examples work. Buckle your seat belts. 😉 Sentry isn't built this way
Examples of how the eventID is actually returnedThe first two have a form of Why this worksSentry doesn't prevent duplicate IDs. No really! I made this change, and every response I got back from the Sentry server was the ID I sent it, even if it was a duplicate. In other words, like the docs say, you only need to read the response code from the response: the ID it sends back will always be the one you sent it:
To conclude my novelI think we should mimic raven-python's architecture, since it's basically the golden master template for a Sentry client and it works:
This is exactly the way #2 works now, since our HTTP transport is async by default as given to us by the go std library. Whaddaya think, heavy reader? Fin |
Okay, so clients generate the ID if they want it? We should probably add that. I miscommunicated the asyncness of our current HTTP transport. The My inclination is to keep it close to the existing model of having the |
Hmm, we could do a wrapper transport that's async. |
Also solved by #2? |
Yeppers! |
Currently, the Sentry docs encourage you to do async submission whenever possible:
This is the desirable configuration in 99% of production cases, but it means that simple "hey look I can send" demos don't work if you don't make your goroutine sleep.
The raven-python client only has a send method, and automatically decides whether or not to send asynchronously based on the transport. I think we should do this as well. We could supply an option to disable it, but that would still trip up newbies just trying to send and oh-my-it-works.
I recommend making the change as a highly desirable default, and updating the docs and example. We could also consider making that example show up as a step-by-step demo in the README. I could do that.
Whatchya think?
The text was updated successfully, but these errors were encountered: