emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.67k stars 79 forks source link

Give the process a custom name for monitoring tools #191

Closed mikeckennedy closed 7 months ago

mikeckennedy commented 8 months ago

It would be great to have a command line arg to set the name of the process

granian webapp:app --name yoursite

And have the workers named granian-yoursite-worker and the main process just granian-yoursite-supervisor or something like that. All it needs is a call to setproctitle.setproctitle("yoursite") in the start up.

I can do this myself with setproctitle:

Screenshot 2024-01-25 at 4 23 28 PM

But two drawbacks. I can't number the workers (like worker 1 worker 2, etc) easily and I can't change the name of the supervisor process at all.

mikeckennedy commented 7 months ago

Excellent, thanks @gi0baro