Monday, September 23, 2013

Monitoring and profiling any application with New Relic and Java instrumentation

Hi everybody!

I recently got an email(with the link here if you are interested)  saying "Use New Relic and receive 3 months in code school ". It wasn't the first time I heard something similar from them, I used New Relic a long time ago and I was curious about how things have evolved. For those who doesn't know New Relic, it is a cloud tool that can help you to monitoring your application (with triggers and alerts), create profiles (get a Thread Dump, with the most called methods and time consumed in each method), count transactions, see the queries executed and MANY MANY more things.

In this post I will show some features and give some explanation of how does New Relic collect data in case of Java applications (but to make it clear, New Relic works with PHP, Node.js, Ruby, Python and other languages).

The key to make what New Relic does is in standard Java since JDK 1.5, which is known as Java Agent, which introduces the possibility to do instrumentation over the bytecode. In other words, before even your main method is called, a pre-main method implemented by the Agent is called where it can put some listeners to read the bytecode (the source code compiled) of the classes that you want to use/load and put some other code (even interrupt the flow of application). In the case of New Relic, it will feed the New Relic cloud system which will process that data to generate those cool charts on your window. To know more about New Relic, go to their web site and the price here (I think it is very cheap) . My girlfriend Hanneli have more experience with New Relic, hope she gives some lessons about it to us soon ; ) .  I will paste some picture for you have an idea how it looks like and the features it has:







Thank you for reading, have a good week =D

No comments:

Post a Comment