You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "Forstwith (via GitHub)" <gi...@apache.org> on 2023/04/11 07:56:31 UTC

[GitHub] [skywalking] Forstwith opened a new issue, #10669: [Bug]

Forstwith opened a new issue, #10669:
URL: https://github.com/apache/skywalking/issues/10669

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   Python Agent (apache/skywalking-python)
   
   ### What happened
   
   When I use skywalking in the project, I found that sw8 is not sent through the headers of aiohttp。
   
   Through the picture, you can see that there is sw8 in the headers.
   ![image](https://user-images.githubusercontent.com/22184723/231093255-57d829b5-9b4b-4c32-ad87-ee697872ef5b.png)
   But there is no sw8 in the parameters sent.
   ![image](https://user-images.githubusercontent.com/22184723/231093811-05561b14-c87b-4de3-a3c4-a6b7cdd7e2ef.png)
   
   By looking at the source code, I found that it is because my headers are not of MultiDictProxy, MultiDict type. 
   This was resolved by repackaging my headers as a MultiDict. 
   
   ### What you expected to happen
   
   I hope to use the ordinary dict type to encapsulate the header and also carry sw8.
   
   In /plugins/sw_aiohttp.py 
   When headers is not MultiDictProxy or MultiDict ,  headers = CIMultiDict(headers) make the headers not the same object as kwargs['headers'] . Therefore, the carrier information is not added to the actual sent headers
   ```python
   if headers is None:
       headers = kwargs['headers'] = CIMultiDict()
   elif not isinstance(headers, (MultiDictProxy, MultiDict)):
       headers = CIMultiDict(headers)
       # kwargs['headers'] = headers     Should add this line to add headers back.
   for item in carrier:
       headers.add(item.key, item.val)
   ```
   
   
   ### How to reproduce
   
   1Initiate a request through aiohttp, and set the header to a dict type.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] Superskyyy commented on issue #10669: [Bug] Loss sw8 when use aiohttp send dict headers

Posted by "Superskyyy (via GitHub)" <gi...@apache.org>.
Superskyyy commented on issue #10669:
URL: https://github.com/apache/skywalking/issues/10669#issuecomment-1503272154

   Thanks, I see you checked "I'm willing to submit a PR", please try make a PR for this bug soon as we plan to release Python agent 1.0.0 ASAP to address a critical performance regression introduced by 1.0.0 changes. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] TheDooctor commented on issue #10669: [Bug] Loss sw8 when use aiohttp send dict headers

Posted by "TheDooctor (via GitHub)" <gi...@apache.org>.
TheDooctor commented on issue #10669:
URL: https://github.com/apache/skywalking/issues/10669#issuecomment-1502877593

   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng closed issue #10669: [Bug] Loss sw8 when use aiohttp send dict headers

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10669: [Bug] Loss sw8 when use aiohttp send dict headers
URL: https://github.com/apache/skywalking/issues/10669


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org