-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
gunicorn worker (uvicorn.workers.UvicornWorker) does not report request/s via statsd client #610
Comments
Hi! I've just ran into this issue myself. After delving a bit into the codes of gunicorn and uvicorn, I can say the problem is simple, but not very trivial to fix. The gunicorn statsd implementation is mixed with their logging facility. Which is a a little questionable, no wonder they have an issue to refactor it. Since uvicorn has its own logging system and does not reuse the logger instance from gunicorn (even though it inherits it by forking), the statsd codes are never invoked. I could not find an easy and nice way to make it work. The worker.log object would need to be accessible from the running http protocol, and even then the statsd logging could not be reused as-is since it's merged with the real logging. (it could lead to logging twice I think) Anyways, depending on what you're using this can be circumvented in the framework level. I'm using Starlette and there is an ASGI middleware to send request metrics to statsd. I know this is not a solution, but I wanted to write it down for future reference. Maybe someone will find it useful. |
im facing the same issue here. is there a workaround ? we are using fastapi |
Any updates please? ran into the same problem today. |
The gunicorn statsd reporting does not work with custom worker class. So let the API handler report each requests. The statsd key for this would be "machinetranslation.requests" See encode/uvicorn#610 Change-Id: I15be8fbc5f686bf5f3dc911516a473f7c6f56f53
Given that Gunicorn has the issue benoitc/gunicorn#1564, and we are deprecating the workers within Uvicorn (#2302).
|
Hi,
gunicorn worker (uvicorn.workers.UvicornWorker) does not report request/s via statsd client, like other gunicorn workers.
Regards,
Mehdi
Important
The text was updated successfully, but these errors were encountered: