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,759
Company Posts That Month
23
Language
English
Hacker News Points
-
Post removed?
No
Summary

Next.js is a modern JavaScript framework that optimizes page and application speed, development speed, and experience. To monitor its performance, you need to set up application performance monitoring for both the server side and browser monitoring. This involves installing the New Relic Node.js APM agent and middleware for Next.js, configuring your `newrelic.js` file, and integrating the New Relic Browser agent into your `_document.tsx` file. With this setup, you can view your application's performance data in New Relic, including server-side metrics such as Apdex score, throughput, and transactions, as well as browser-related metrics like largest contentful paint, input delay, AJAX requests, or page views. Additionally, you can send detailed error information to New Relic using the `_error.tsx` file, which captures both backend and frontend errors and sends them to New Relic's noticeError method. The setup also enables automatic logs in context options, allowing for correlated logging between transactions and logs. By following these steps, you can gain full-stack observability in your Next.js application and optimize its performance.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Observability 8 978 178 66 +53%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.