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

Unable to integrate Uvicorn (multiple workers) to SigNoz. #1113

Closed
nitin1993915 opened this issue May 10, 2022 · 6 comments
Closed

Unable to integrate Uvicorn (multiple workers) to SigNoz. #1113

nitin1993915 opened this issue May 10, 2022 · 6 comments
Assignees

Comments

@nitin1993915
Copy link

Bug description

*Below mentioned Docker CMDs work with single uvicorn worker to get the app traces but does not work with multiple uvicorn workers
["opentelemetry-instrument", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
-- worked
["opentelemetry-instrument", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", `"2"]
-- did not work
*

Expected behavior

Should be able to check the traces on UI with multiple unicorn workers

@welcome
Copy link

welcome bot commented May 10, 2022

Thanks for opening this issue. A team member should give feedback soon. In the meantime, feel free to check out the contributing guidelines.

@pranay01
Copy link
Collaborator

@srikanthccv do you have insights on this?

@srikanthccv
Copy link
Member

@nitin1993915 Which version of SDK are you using? Unlike gunicorn, uvicorn doesn't have any hooks that can be used to instantiate new span processor for each worker https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples/fork-process-model. The newer version of sdk attempt to fix this to certain extent but there might be some limitation with uvicorn.

@pranay01
Copy link
Collaborator

pranay01 commented Jun 5, 2022

@nitin1993915 Just checking if you are still facing this issue or this is solved. Please update here accordngly

@pranay01 pranay01 assigned nitin1993915 and unassigned srikanthccv Jun 5, 2022
@GokulNC
Copy link

GokulNC commented Oct 20, 2022

Hi @pranay01

I am still facing this same when using multiple workers. With single worker, it works fine.
I installed SigNoz by cloning the repo today, and I was following this guide to setup SigNoz with FastAPI:
https://signoz.io/blog/opentelemetry-fastapi/

@srikanthccv
Copy link
Member

You can get it to work using gunicorn + uvicorn.workers.UvicornWorker class but the uvicorn is directly not supported. Please follow up on the upstream repo for any updates open-telemetry/opentelemetry-python-contrib#385.

@srikanthccv srikanthccv closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants