Avoid Writing a Lot of Try Catch by Catching The ‘catch()’ Just Once. How annoying it is to write a lot of try-catch for each async function in an express app? What if you never need to write a try catch block for all async functions and still be able to handle the errors?
During the last few months, we've been working hard on improving our Node.js integration. We've released loads of quality fixes and improvements to our diagnose command, configuration, and general package structure. Today, we'd like to highlight some of the enhancements and fixes that we've recently released.
In this tutorial, we will go through a working example of a Node.js application auto-instrumented with OpenTelemetry. In our example we’ll use Express, the popular Node.js web application framework. Our example application is based on two locally hosted services sending data to each other. We will instrument this application with OpenTelemetry’s Node.js client library to generate trace data and send it to an OpenTelemetry Collector.
Node.js applications are those that are created on the Node.js platform, which is an event-driven I/O server-side JavaScript environment based on Google Chrome's V8 engine. Since both the server-side and client-side are written in JavaScript, Node.js allows for easier and faster code implementation, as well as processing requests quickly and simultaneously. This is especially useful for developing real-time applications, such as chat and streaming.
When your application starts to grow, one of the essential factors to consider while scaling is memory management. Poor memory management leads to memory leaks, thus affecting application performance. When the performance degrades, it will directly affect the business. So, it is essential to look out for and fix memory leaks in time. This blog post will look at what memory leaks are and how to avoid them in Node.js applications. Feel free to navigate the post using these links.