Home / Companies / New Relic / Blog / Post Details
Content Deep Dive

How to monitor a Next.js application

Blog post from New Relic

Post Details
Company
Date Published
Author
Mat Wilk
Word Count
1,980
Language
English
Hacker News Points
-
Summary

Next.js, a modern JavaScript framework, enhances application speed and performance but requires monitoring to manage performance issues and errors effectively. This blog post explores setting up full-stack observability for Next.js applications using New Relic, beginning with backend monitoring through the New Relic Node.js agent and middleware, which is integrated by default in the agent's latest version. This integration focuses on server-side rendering and transaction monitoring, providing comprehensive observability of server-side activities. For frontend monitoring, the New Relic Browser agent is injected to gather browser-related metrics, enhancing insights into user behavior and performance. Additionally, error reporting is streamlined by configuring the _error.tsx file to send both backend and frontend error details to New Relic. Log contextualization is also supported, allowing automatic correlation of application logs with telemetry data using frameworks like Winston. The article highlights the importance of monitoring both server and client sides to ensure robust performance and user experience in Next.js applications.