Search code examples
heroku

Get name of running process (Procfile) inside heroku


My Rails app on Heroku has a number of processes defined in the Procfile

Is there a way for an app to know what process name started it?

e.g. for Procfile:

web: rails s
job: run jobs

Is there an ENV variable (or similar) available within the running process to know if its web or job?


Solution

  • Apparently Heroku sets up DYNO variable, as per https://devcenter.heroku.com/articles/dynos#local-environment-variables