Takipi is a really nice tool

There are great tools in the Java world. One of the is the exception monitoring tool called Takipi.

I have been following Takipi blog for quite some time, and finally started to really use it. It is awesome!

It starts simple - the tool is a javaagent, that attaches itself to a JVM and captures extra information every time an exception is thrown. It comes with a nice web interface to analyze captured data.

At this point you may start wondering - what is the point? - my exceptions are logged already, why would anyone need such tool?

The are two main reasons. First, Takipi captures a lot of information around the exception. You would never even think about logging that much. For example, imagine you have a logged exception "User not found by id [12345]" accompanied by the call stack. You know that this id is indeed invalid, but the code to get id looks something like

Long id = request.getParameter("userId");
if(id == null) {
    id = session.getParameter("userId");
if(id == null) {
    id = session.getParameter("adminId");
if(id == null) {
    id = goFindSomeUserInMemcached("random");

Now you have no idea - was that an incorrect parameter in request? Corrupted session? Something wrong with memcached? And so on... Takipi captures adjusted information. Of course, the request is captured in full. If session is a local variable, it will be captured as well. You have much more information about what exactly was executed this way.

Second reason, is that Takipi is smart in identifying "same" exceptions. Instead of thousands of log entries it will show one line and will keep just a few detailed captures. It will show you the number of occurrences, the first and the last time it happened. It will even plot a graph. You do not need thousands of identical stack traces in the log - you will focus on just one. Takipi provides that naturally.

I have seen one system that generated so many exceptions, its developers decided to log only 1% of them. I wish I had Takipi then...

The most value Takipi provides in eliminating the dreaded NullPointerException. I wish Java never had null to begin with... Whenever you see an NPE it is always almost too late. Something placed a null where it was not expected, and you need to track what that was with almost no information from the exception itself. It is a huge help to have extra information!

Also, you can never trust that every exception is logged. I have found several places where there was a TODO to log exception properly, but exception was just silently swallowed instead. If you are working in a big team, on a big project... Unfortunately you can not trust every developer to do the right thing all the time. Sometimes they just write a proof of concept sort of code to test an idea, and that PoC gets included in the core application. The developer is not at fault - she was writing a PoC code. The other developer, that plugged that code into the app is not at fault because she was not told the code needs polishing. But the end result can live in the application, evil and unnoticed for years.

In any case, it is great time to have all those tools available. And Takipi is one of the really useful out there.