ext/requests - crashes when used with socket-io #642
Labels
backlog
bug
Something isn't working
instrumentation
Related to the instrumentation of third party libraries or frameworks
Describe your environment
Python 3.8.2
opentelemetry-sdk==0.6b0
opentelemetry-ext-http-requests==0.6b0 (was able to reproduce on 0.7.dev0 as well)
requests==2.23.0
python-socketio==4.5.1
python-socketio-client==1.1
websocket-client==0.57.0
Steps to reproduce
After enabling requests ext, like this:
when using socketio client and connecting as follow:
From this line of code (
propagators.inject(type(headers).__setitem__, headers)
), the following errors is thrown:AttributeError("type object 'NoneType' has no attribute '__setitem__'")
This happens because for some reason the
headers
is None.A possible fix will be adding
if headers is not None:
before calling thepropagators.inject
.What is the expected behavior?
Expected to see the trace being sent.
What is the actual behavior?
app crashed.
Additional context
Happened on both 0.7.dev0 and 0.6b0 versions of the ext.
The text was updated successfully, but these errors were encountered: