Lex Zhang
06/24/2023, 12:14 AMnode tracing.js
From this post, the custom-server method will remove important optimizations, that's why I am wondering if there is a way to implement open telemetry without this custom-server? Because for production, the app is running with:
next build
next start -p $PORT
How to build the app and use tracing.js as an entrypoint with the build version? For node-js, I can use the following code in node.js
node -r tracing.js index.js
can I achieve a similar goal with NextJS?Vishal Sharma
06/27/2023, 3:20 AMVishal Sharma
06/27/2023, 3:21 AMSo you need to importin your main application. Thetracing.js
should be the first line of your application code and initialize it before any other function. Here’s the sample github repo which shows the implementation.import ./tracing.js