Restart heroku dyno on Error
There are schneems/puma_auto_tune or schneems/puma_worker_killer, but they does not work as intended on Heroku. (See zombocom/get_process_mem#7.)
So, We need another approach (for now).
Heroku: R14 Error - Memory quota exceeded log
↓
Papertrail | Add-ons | Heroku and send alert via webhook
↓
heroku-dyno-restarter (this repo)
↓
Restart web dyno via api (heroku ps:restart web.x
)
Press this button to deploy this app using your heroku account:
You will be asked to fill in a name for the app. Something like "my-company-dyno-restarter".
You will also be asked for your heroku api key. You can get this key here: https://dashboard.heroku.com/account#api-key
After deploy by Heroku button above, fetch your heroku-dyno-restarter app's token.
heroku config:get APP_API_TOKEN -a <your heroku-dyno-restarter app name>
- Remember the token.
- Set your papertrail's alert for your target app.
- Set webhook URL: https://.herokuapp.com/webhook?token=<APP_API_TOKEN>
Heroku Dyno Restarter will try to guess your app's name based on the papertrail alert. To override this guess,
you can set SOURCE_APP_NAME
:
heroku config:set SOURCE_APP_NAME=my-company-app -a <your heroku-dyno-restarter app name>