Open oavdeev opened 1 year ago
can you assign this to me? thanks :)
I was not able to reproduce this, it might have been fixed by the changes in https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1717 inadvertently.
Can you confirm this is working correctly now?
Describe your environment Using python 3.10 and
Steps to reproduce When you pass a custom header dictionary to requests, e.g.
requests.get("http://example.com", headers=myheaders)
, opentelemetry instrumentation code injects tracing headers into it. However it should create a copy of the dict instead of modifying it directly. It leads to subtle bugs when the header dictionary is a variable that is long lived and used elsewhere in the user code.Running the code below illustrates the problem.
What is the expected behavior? Instrumentation should not modify the dictionary. The code above should print
What is the actual behavior? Instead, the dictionary is modified and the code above prints something like