Replies: 2 comments
-
|
No, at present time there's no way to get the worker ID from within the worker process. Also not sure what changes would be required in Granian to support something like uwsgi, as I never thought about this functionality. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Would love to have this feature! When Starting granian, the worker indexes are already being logged, so I can imagine it wouldn't be that hard to expose these IDs as an environment variable specific to the respective worker process? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to get the current ID of a worker from within my app?
There's a scenario with the Python prometheus client and multi-processed wsgi servers that leads to inaccurate metrics if using
gunicornoruwsgiout of the box. But withuwsgithere's a way to retrieve the more "stable" worker ID to work around the issue.In transitioning to
granianI wonder if there's a similar path today, or would this require new functionality (if it's even possible without major architectural changes). The only clue I'm somewhat working off of is that the granian logs number workers in a similar way touwsgi:worker-1,worker-2, etc.Beta Was this translation helpful? Give feedback.
All reactions