But when I go to the dashboard, I cannot see any RUM data
Just in case, I want to highlight the following:
Point 4 and point 5 are not related. What I mean here is that the Node.js agent is not the RUM agent.
The Node.js agent is needed for instrumenting the "server part" of Nextjs.
The RUM agent is needed for instrumenting the "client part" of Nextjs, in a nutshell, the activity that happens within a web browser
They are different agents as you can see. RUM data is only related to the activity that happens in the browser. I wanted to clarify this point in case it helps you.
(partly) answering my own question - so adding the following at the beginning on the pages/_app.js file does generate RUM data
I don't see any issue with that snippet (fair to say that I'm not aware of Nextjs "best practices" when it comes to where to add third-party code)
If you are seeing RUM data after doing that is because the client part of Nextjs is loading the RUM agent. So again, (being redundant, sorry for that, but I want to emphasize this), the most important thing here is to make sure that the client side is loading RUM, if that happens, then you will see data related to the page and user activity within the browser.
So, a good exercise would be:
Identify in your next app where the main entry for the server part is and load the Node.js agent there.
Identify in your next app where the main entry for the client part is and load the RUM agent there.
Thank you for the detailed explanation - yes you are right, I quoted the wrong document, it was rather RUM/APM than NodeJS/APM for the frontend
I did manage to figure it out - I guess you it changes for different versions of the framework and Node - I was using Node 16 and 18 an and I had to configure it via the initApm call in the _app.js file
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.