Abhinav Ramana
10/27/2022, 6:33 PMCMD ["uvicorn", "--workers", "2", "--host", "0.0.0.0", "--port", "8000", "--ws", "websockets", "--loop", "asyncio", "--ws-max-size", "100000", "--ws-ping-interval", "20.00", "--ws-ping-timeout", "20.00", "wombo.fastapi:app"]
However, Uvicorn can't be used because https://github.com/open-telemetry/opentelemetry-python-contrib/issues/385#issuecomment-1199088668, so as per your suggestion we migrated to
CMD opentelemetry-instrument --traces_exporter otlp_proto_grpc gunicorn wombo.fastapi:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000
But this forced us to disable
nest_asyncio.apply()
Which inturn breaks a lot of our operations. Do you have any suggestions? I tried into seeing if i could use other worker classes like gevent
or eventlet
for gunicorn https://docs.gunicorn.org/en/latest/design.html#async-workers However they are giving monkey_patch errors which I can't initialize beforeAbhinav Ramana
10/27/2022, 9:55 PM[2022-10-27 21:55:00 +0000] [20] [INFO] Worker exiting (pid: 20)
[2022-10-27 21:55:00 +0000] [12] [ERROR] Exception in gunicorn worker
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/aiohttp/worker.py", line 57, in run
self.loop.run_until_complete(self._task)
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/opt/venv/lib/python3.9/site-packages/aiohttp/worker.py", line 77, in _run
raise RuntimeError(
RuntimeError: wsgi app should be either Application or async function returning Application, got <opentelemetry.instrumentation.fastapi._InstrumentedFastAPI object at 0x7f3f5b212fa0>
Abhinav Ramana
10/27/2022, 11:19 PMAbhinav Ramana
10/27/2022, 11:19 PMAbhinav Ramana
10/27/2022, 11:20 PMPrashant Shahi
10/28/2022, 5:41 AMPrashant Shahi
10/28/2022, 5:42 AMSrikanth Chekuri
10/28/2022, 6:20 AMAbhinav Ramana
10/28/2022, 8:02 PMAbhinav Ramana
10/28/2022, 8:03 PMSrikanth Chekuri
10/28/2022, 8:34 PMif I understand problem properly maybe I can try a custom gunicorn class or somethingYou are the best person to do this because you work with the codebase and know why certain libraries were and how they are conflicting here.
whenever u are free LMKBefore we do this, if you can share me minimal app which has the problem I can probably spend some understanding what is happening and see what can be done about it.
Srikanth Chekuri
10/31/2022, 3:05 PM