-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add extra statsd metrics for normal and/or abnormal worker exits #2126
Comments
My understanding of that change is that the metrics should be sent regardless of enabled log level. Are you asking to log a message when the number of workers changes, or are you finding that StatsD metrics for |
There is an |
Weird... you seem to be correct, but...
Yes. 😐 I think I misinterpreted the code. It seems like you only log (and emit the metric) after you've spawned workers as needed, which is a bit puzzling to me (I haven't had time to look into commit history, which might explain this decision - sorry). Would it make more sense to log the number of workers before spawning needed workers? In this way, if some worker segfaulted and was re-spawned by the main master loop, I could get metrics before the process of restoring them kicks in.
Yes, indeed. These are useful when sporadically looking at logs. But it'd be ideal if this was mirrored as a metric that I can track as part of my monitoring dashboard (e.g., in Datadog) without having to parse the logs using some external process (in the administrative sense of the word). |
Ahh, yes. I don't recall the history, but it could be that the intention was to just log the number of configured workers. This number can change during a configuration reload or by using the
Maybe it would make sense to have extra guages for normal and/or abnormal worker exits. |
Indeed. I've changed the issue title to reflect that, and I'll try to take a look at a possible PR for it soon. Thanks for the feedback @tilgovi! 🙇 |
In hindsight, I think what I need is #2407, so closing this in detriment of that PR. |
Hey and thanks for all the hard work on gunicorn! ❤️
Would it be possible to have the metric for
gunicorn.workers
be brought back to INFO level instead of DEBUG? I'm very much interested in understanding the variations in number of workers my web server goes through while serving requests. Particularly, I'm interested in understanding when a given worker has been killed.Furthermore, I think this is a good monitoring practice that shouldn't be kept around just during debugging, hence my suggestion of increasing the log level for it.
Is there a better way to achieve this?
If the proposed change is considered interesting, I may take a stab at it. It should be just a matter of changing
info
todebug
. 🤔Thanks in advance! 🙇
The text was updated successfully, but these errors were encountered: