Implementing OpenTelemetry without Custom-Server in NextJS
TLDR Lex asked how to implement open telemetry without using custom-server in NextJS. vishal-signoz suggested importing and initializing tracing.js in the main file as the solution.
Powered by Struct AI
3
5mo
Jun 24, 2023 (5 months ago)
Lex
Lex
12:14 AMAccording to this post, after implementing OpenTelemetry, I can spin up the service with:
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:
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
can I achieve a similar goal with NextJS?
node 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?
Jun 27, 2023 (5 months ago)
vishal-signoz
vishal-signoz
03:20 AMYou can initialize tracing.js in your main file
03:21
vishal-signoz
03:21 AM> So you need to import
tracing.js
in your main application. The import ./tracing.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.SigNoz Community
Built with ClickHouse as datastore, SigNoz is an open-source APM to help you find issues in your deployed applications & solve them quickly | Knowledge Base powered by Struct.AI
Indexed 1023 threads (61% resolved)
Similar Threads
Error Installing SigNoz on NodeJS App on Graviton Server
abhinav faced errors installing SigNoz on a NodeJS app. vishal-signoz suggested following a workaround on an opentelemetry issue, which resolved the problem.
13
9mo
NodeJS App Integration with OpenTelemetry Issue
Vinay was having trouble integrating OpenTelemetry into a NodeJS app. Srikanth advised updating to the latest versions of the relevant npm packages, which resolved the issue.
6
2w
Troubleshooting Django App Instrumentation with Signoz
tim encountered issues instrumenting a Django app with Signoz. tim resolved the problem by identifying the need for a client to forward content to Signoz.
12
6mo