Originally published at: http://www.sitepoint.com/integrate-apm-log-management-loggly-new-relic/
This article was sponsored by Loggly. Thank you for supporting the sponsors who make SitePoint possible.
When running an application or website, you’d be wise to not only keep track of your visitor statistics, but your performance as well. While we’re used to setting up downtime monitoring right after deployment, this isn’t always the case with performance monitoring. A slow site means a slow income, especially nowadays when visitors expect sites to load in just a couple of seconds.
With excellent tools like New Relic around, application performance monitoring and management shouldn’t be such a hassle anymore. Better yet, they recently teamed up with Loggly, a service that provides log management and analysis for an even better insight into your application or site’s performance. Now you can easily dive further from what happened into how it happened.
In this article I will show you how both New Relic and Loggly work as a combined tool. Once you get the basics I will show you how these two powerful tools combine into a developers dream for analyzing bad performance or downtime.
Why you should use Application Performance Management (APM)
You may have heard of New Relic before as they have had various great partnerships with SitePoint. They were also covered in detail by Darren Jones in his excellent article on real time Ruby monitoring.
New Relic offers several solutions for application performance management (APM). Whether you want to monitor your web application, mobile app or server, New Relic has the right tools for the job. They also have a free version of all of their products. For this article I will focus on New Relic APM, and let you have a look into its impressive dashboard.
For New Relic to work properly, you’ll need to have admin access to the server your app is running on. Once installed, your dashboard will come alive. After running a small load test you’ll get to see your app (a Magento webshop in my case) in action.
The dashboard shows you the average loading times for your PHP application, the database and external sources (DNS for example). You can also see your throughput (75 requests per minute in this screenshot) and APDEX score (which is basically a satisfaction rate based on an average loading time of 0.5 seconds as default).
You can then further zoom in on all of these parameters, like the external sources loading time or database calls.
There is also limited server information with CPU and memory usage, along with throughput and response time. For more extended server monitoring you should use New Relic Servers, but even in limited mode this is still valuable information.
Since New Relic gives you real time reporting, you can instantly see the effect of changes you make. When running a second load test I turned on Magento cache during the test, causing an instant drop in PHP load times as well as fewer database queries. New Relic gives you a nice view of the results right away.
Along with real time reporting there are tons of additional reports for you to run. You can also set up alerts for specific events like downtime or slowdowns.
All in all, New Relic is a great tool for performance testing, but in some cases you’ll want to dive in deeper and look at your logs for detailed analysis. This is where Loggly comes in. It has an integration for New Relic which makes it very convenient to jump from an event from New Relic into logs hosted by Loggly. Let’s have a look.