Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib3 does not work with boto3 #1235

Open
camerondavison opened this issue Aug 19, 2022 · 2 comments
Open

urllib3 does not work with boto3 #1235

camerondavison opened this issue Aug 19, 2022 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed instrumentation

Comments

@camerondavison
Copy link

I put the stack trace, my poetry file, and an example python script. but after instrumenting urllib3 boto3 does not work.

https://gist.github.com/camerondavison/010b2cad69dd4bf307a77fa1f0b2549e

It looks like

Traceback (most recent call last):
  File "/Users/cameron/Library/Caches/pypoetry/virtualenvs/instrument-play-SYEDf4cJ-py3.9/lib/python3.9/site-packages/botocore/httpsession.py", line 448, in send
    urllib_response = conn.urlopen(
  File "/Users/cameron/Library/Caches/pypoetry/virtualenvs/instrument-play-SYEDf4cJ-py3.9/lib/python3.9/site-packages/opentelemetry/instrumentation/urllib3/__init__.py", line 214, in instrumented_urlopen
    request_size = 0 if body is None else len(body)
TypeError: object of type '_io.BytesIO' has no len()

we just need to look at the body and call a different method for length if it is a BytesIO

@camerondavison camerondavison added the bug Something isn't working label Aug 19, 2022
@camerondavison
Copy link
Author

It seems like it works if i add botocore instrumentation, which I imagine is because it suppresses instrumentation after the top level boto call

@vishal-ramesh2
Copy link

I am also facing this issue. Is there a way to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed instrumentation
Projects
None yet
Development

No branches or pull requests

3 participants