The latest Passenger release contains some exciting new monitoring features for Node.js applications. One of these is that Passenger can now deep-inspect applications to measure how long various function calls take, and log the results to Union Station.
Union Station is Phusion's brand new take on application analysis and monitoring for Passenger web apps. Union Station helps you identify performance bottlenecks in your Ruby web applications, and helps you to stay on top of any errors your application might be facing. If you're unfamiliar with Union Station check out our blog post on using Union Station to solve a production performance issue, and our product announcement.
Out-of-the-box: Express + MongoDB
If you are using Express and MongoDB, you will now be able to see all the Mongo queries in Union Station without changing anything in your application: which queries were performed, when they occurred, how long they took.
This makes it a lot easier to find performance bottlenecks and verify improvements. We will be extending this out-of-the-box logging to other commonly used frameworks and modules as well in the future. The way we set it up also makes it easy for contributors to add support for their favorite modules.
Another great feature is that it's possible to write your own custom log entries from anywhere in your Node.js application. If you are using Express, then you can access the new logging API with a few lines of code, time any function, and store the result with any additional information you desire:
This makes it easy, for example, to track requests to third-party services and see whether they are limiting your application. It can also be done with any other framework if you call a logging attach function for each request.
Have a look at the how to use the logging API page in the the Passenger Library for more details!
This is the first step we've made towards supporting advanced logging for Node.js applications, with more to come! Sign up for a free trial today, or sign up to our newsletter to stay in the loop on future Union Station development below. You can also follow us on @unionstationapp and @phusion_nl.