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

Auto-instrumentation not working #4101

Closed
diogobaeder opened this issue Aug 2, 2024 · 4 comments
Closed

Auto-instrumentation not working #4101

diogobaeder opened this issue Aug 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@diogobaeder
Copy link

Describe your environment

OS: Arch Linux
Python version: 3.12
SDK version: 1.26.0
API version: 1.26.0

What happened?

Auto-instrumentation with opentelemetry-instrument is not working for me anymore, even using examples from the project itself - for example, https://github.com/open-telemetry/opentelemetry-python/blob/main/docs/examples/auto-instrumentation/server_automatic.py . Only manual instrumentation is working and producing traces. I found this out because auto-instrumentation isn't working with a private project I have, either.

Steps to Reproduce

Install dependencies, run the auto-instrumentation above with opentelemetry-instrument --traces_exporter console --metrics_exporter none python server_automatic.py , then run the client from the same example folder with python client.py testing.

Expected Result

Traces being spit out to the console, like they do with the manual example.

Actual Result

No traces are being spit to the console.

Additional context

No response

Would you like to implement a fix?

None

@diogobaeder diogobaeder added the bug Something isn't working label Aug 2, 2024
@emdneto
Copy link
Member

emdneto commented Aug 2, 2024

Are you getting an error like this when running the opentelemetry-instrument --traces_exporter console --metrics_exporter none python server_automatic.py command?

    ) = lambda_handler.rsplit(".", 1)
        ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rsplit'

@diogobaeder
Copy link
Author

Oh, actually, I did, yeah... then I uninstalled the module that was throwing it and it works fine now. Well, I guess we can close this issue then, sorry for the hassle.

@emdneto
Copy link
Member

emdneto commented Aug 2, 2024

Just FYI, we fixed this in open-telemetry/opentelemetry-python-contrib#2750

@diogobaeder
Copy link
Author

Ah, nice, thanks man!

By the way, I spent hours trying to figure out why it wasn't working with an experiment I'm doing with FastAPI, but I finally figured it out: it doesn't work when running with fastapi dev, but it does work fine with uvicorn (which is what should be used in production anyway - but it's worth knowing in case someone wants to test this locally).

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

No branches or pull requests

2 participants