Feature: Add trace_request_ctx for WS connections
What do these changes do?
Adding the possibility to pass trace_request_ctx when opening a Websocket connection. It's supported for all HTTP requests, but for some reason it was not an option for this method.
Are there changes in behavior for the user?
The argument is optional, so it shouldn't affect the current behavior of the method.
Related issue number
None
Checklist
- [x] I think the code is well written
- [ ] Unit tests for the changes exist
- [x] Documentation reflects the changes
- [x] If you provide code modification, please add yourself to
CONTRIBUTORS.txt - [x] Add a new news fragment into the
CHANGESfolder
I also need this feature. Because if there's an exception to the websocket request, there's no way to retrieve the response body. The only way is to send a mutable object with trace_request_ctx and retrieve the data from it.
Plus, since the trace configs that are passed with ClientSession work the same with ws_connect as normal http requests, ws_connect function not having trace_request_ctx param is clearly a missing implementation detail which needs a bug fix as soon as possible.
@bdraco I think you work with websockets regularly? Mind reviewing?
I'm traveling this week so I'm limited on time but I'll take a look at the end of the week or if I get some free time in between flights