ruby-on-railsherokumonitoringproduction-environmenttweetstream

Rails on Heroku how to monitor worker process


I have a critical worker process for my Rails app that is an event machine loop on twitter feed events (Someone tweets, it automatically processes the tweet and runs different code based on content, otherwise known as the tweetstream gem).

My issue is that I'm unaware of the correct/good ways to monitor a process in production, such that if the process goes down or isn't working correctly I want to be notified in some way or another so I can try to address it quickly. I have the NewRelic gem to monitor my web server, but haven't been sure if/how it applies to worker threads.

What I'm looking for:

It's possible what I'm looking for is part of the normal logger workflow, (using different log levels?) If so, confirmation of that would also be pretty helpful for me. Any advice is appreciated, thank you!

EDIT: Said NewEgg instead of NewRelic...oops


Solution

  • The latter two requirements could be done using logging, but it would require some work to send you email notifications when an event fails to run all the way through your code or is being held.

    You might want to check out the NewRelic plugin on Heroku - it's now free for a small number of dynos, and that can alert you if the process is running at all times and notify you if it is not.