Several tools to monitor your Rails application

After your Rails application is deployed to server, there would be tons of things could happen to your app which you have never expected when running the app in your local environment. In that case, you definitely want to have a tool to support you monitoring the application and quickly let you know the status of your app in case it goes down. In this post, I would like to introduce to you a few tools which are useful for these kinds of work:

1. Pingdom

Do not wait until your clients shout at you because his application is down. It is best to quickly fix and bring the app LIVE again before your clients are aware of that major issue. Of course, you do not want to check you app every 1 minute to make sure it is still working. And here comes Pingdom, a service which could quickly let you know if your app is down. In addition, you can choose to a setting which let Pingdom send you an SMS so that you won't miss the alerts.

Pingdom is free with basic usage and you can purchase premium package if you want to experience with more advanced features such as SMS sending, multiple hosts, etc.

2. Exception Notification

One of my favorite tools to monitor your Rails application is exception_notification. I love this tool and have been using it for many projects so far.

Basically, what this tool does is it will send you an email whenever there is any exception occurs in your application, including some special exceptions which are unnoticeable by users. I myself found and fixed several major bugs on my projects thanks to this tool. Previously, I had no idea how to know if my app was running well unless some users reported bugs which they saw on their side, so exception_notification become my savior. This is also extremely useful because most of the times I can quickly resolve an issue without digging too much into the irrelevant code. Futher more, you can catch exception in your background workers such as delayed_job or sidekiq, which are normally hard to catch because they do not get logged in production.log

3. God

In a typical application, there is not just 1 process running to serve client requests. Usually, we have to run other processes to make our app faster or to do a specific task inside our app (ex: sending email in the background). And we have to make sure these processes keep running as we expected. Imagine that your application is using delayed job for sending email, if delayed_job process is not running because of certain reason, no emails will be sent out to users.

God is a useful tool which can help you on this. It keeps watching certain processes on behalf of you and in case these processes stop unexpectedly, God will automatically restart them for us.

What are your favorite tools? Or do you use any other great tools to monitor your Rails app?