Tag puma with application name instead of directory name

In the process list Puma shows up like this:

puma 6.4.0 (tcp://localhost:3000) [rails]

The name between square brackets is the name of the directory where the application is booted from. This is okay for most situations. With the default Dockerfile in Rails 7.1+ the directory name will always be “rails”.

If you run multiple containers (of different applications) on a single host the process list wil look something like this:

puma 6.4.0 (tcp://localhost:3000) [rails]
puma 6.4.0 (tcp://localhost:3000) [rails]
puma 6.4.0 (tcp://localhost:3000) [rails]

There’s no way to make a distinction between different applications.

My proposal is to update the default config/puma.rb file to tag Puma with the application name defined in config/application.rb.

# in config/puma.rb
tag Rails.application.class.module_parent_name.downcase

This would result in a process list looking like this:

puma 6.4.0 (tcp://localhost:3000) [foo]
puma 6.4.0 (tcp://localhost:3000) [bar]
puma 6.4.0 (tcp://localhost:3000) [xxx]
1 Like

Hi @jefvlamings. Welcome! Is this something you’ve figured out? Or is this something you’d like help with? It seems like a good idea to me.

I figured it out. Just trying to gauge if a PR would be accepted.

1 Like

I was just thinking…posting an issue on Github (Issues · rails/rails · GitHub) maybe the best way to get the feedback you’re wanting.

I’m running into the same issue. Is this configurable within Puma? Or did you have to patch it in?