Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Ensure process itself is running at all times, or be notified if not
  • Ensure that events (receiving tweet) cause code to run all the way through (be notified if an error is thrown before completion and where)
  • Possibly ensure that some invariants are being held, or notified if not

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

like image 659
Pat Marx Avatar asked Feb 12 '14 18:02

Pat Marx


1 Answers

Check out God. There is even a nice Railscast about it.

Monit is also a good alternative.

like image 124
Agis Avatar answered Oct 12 '22 06:10

Agis