Application performance monitoring in Node.js

Node Reaction
3 min readApr 2, 2018

--

Node.js is built utilizing two core technologies; the V8 engine and Libuv. The V8 engine is a C++ library that transforms Javascript language into machine code. Libuv, a C library, is the single threaded Node.js implementation of the event loop which enables asynchronous functionality. Libuv creates a 4 threaded pool by default which processes asynchronous calls. At any possible instance, Libuv will pass of the work to the operating system interface for processing.

“If you can’t measure it, you can’t manage it.” — Peter Drucker

Node.js has no built in way to access performance of the event loop, so developers lack an easy way in understanding the performance of their asynchronous functions. Traditional timing and tracing is difficult to set up and typically operating system dependent.

Introducing NodeReaction

NodeReaction is an open source performance monitoring framework (referred to as the Node Reaction Agent), which lives in user code to analyze HTTP requests and asynchronous operations while working in conjunction with a cloud service that processes and analyzes information the agent gathers. NodeReaction.com is the service that provides a detailed performance breakdown of a user’s Node.js web applications.

With a single line of code, users can see the performance and health of their Node server, and understand where bottlenecks exist in their application.

How it works…

Our framework works by installing our monitoring agent via NPM into your application and obtaining an API token provided from NodeReaction.com website. When your Node.js application launches, our agent scans your package.json and dynamically installs monitoring libraries that keep track of asynchronous operations within your HTTP requests.

At the beginning of each HTTP request, our Agent captures the context that specific HTTP request originated in, and creates a unique transaction that captures data from the request, which will remain in memory until the request is completed. During the HTTP request, any additional asynchronous operations that occur while the HTTP request is processed will create trace events with their own timing information on the current transaction.

Once request ends, the Agent ends the transaction and the gathered data is then processed by the agent and intelligently sent to our cloud service for processing and analysis.

Get Started

Interested? Well just head on over to nodereaction.com and NPM install our framework to take our project out for a spin.

npm install nodereactionagent

We’re always eager to hear any feedback you might have, so please email us at nodereaction@gmail.com. And don’t forget to show us some love by “clapping” this article 50 times, and supporting us with a well deserved star on our Github. Happy hacking friends!

NodeReaction is created by Chris Jeon, Eric Fileti, James Edwards, Kunal Patel, & Michael Dalton

--

--

Node Reaction

NodeReaction is a platform agnostic performance monitoring service, and installable framework that analyzes routes & asynchronous activity