Open codecakes opened 2 years ago
I have two suggestions. a. use express to serve react-scripts build with the snippet you mentioned
b. migrate from create-react-app to next js with open telemetry
I have two suggestions. a. use express to serve react-scripts build with the snippet you mentioned
How will be serve this as static single page cdn if we use express?
b. migrate from create-react-app to next js with open telemetry
Why? What is the motivation (in a single line) to migrate the entire codebase to next js? What is the the investment cost of it vs incentive of doing so?
https://lightstep.com/opentelemetry/js
I don't take a deep dive into the source of lightstep-opentelemetry-launcher-node.
But if some stuffs related to require('lightstep-opentelemetry-launcher-node') can't be built as static file, sth like express will need to be used.
or if npm install @opentelemetry/api @opentelemetry/web @opentelemetry/tracing --save alone without express can successfully integrate this repo with opentelemetry, it would be great.
=> need time to survey
How will be serve this as static single page cdn if we use express?
can't be fully static. But cdn can also be used to cache the specific pattern of url.
What is the motivation (in a single line) to migrate the entire codebase to next js?
I think, if sth like express is needed or the project becomes more complicated, next.js may also be cool. https://www.reddit.com/r/reactjs/comments/s3k3xt/when_is_it_recommended_to_use_next_over_react/
I don't take a deep dive into the source of lightstep-opentelemetry-launcher-node.
But if some stuffs related to require('lightstep-opentelemetry-launcher-node') can't be built as static file, sth like express will need to be used.
or if npm install @opentelemetry/api @opentelemetry/web @opentelemetry/tracing --save alone without express can successfully integrate this repo with opentelemetry, it would be great.
Yes ofcourse this should be the way to go: https://opentelemetry.io/docs/instrumentation/js/getting-started/browser/ You can do some research on a simple hello world tracing as an exercise.
How will be serve this as static single page cdn if we use express?
can't be fully static. But cdn can also be used to cache the specific pattern of url.
If you build it in the distribution that is served like provided in above links :point_up: , it will be static.
I think, if sth like express is needed or the project becomes more complicated, next.js may also be cool. https://www.reddit.com/r/reactjs/comments/s3k3xt/when_is_it_recommended_to_use_next_over_react/
Changing frameworks does not automatically solve code complexity. Building with a clean design in mind solves for the complexity. We have different perspective screens in the website and they all run just fine. Just to introduce a telemetry package, changing the entire framework is an overkill.
@tim08094495757 I've updated the description.
UPDATED
We need a vendor-neutral open-source Observability framework for instrumenting, generating, collecting, and exporting telemetry data such as traces, metrics, logs.
The following code walkthrough is better suited for node driven service and is meant for reference. A good browser based example is given here:
LS_ACCESS_TOKEN
andLS_SERVICE_NAME
then setup the code like so:Start the OpenTelemetry SDK. All of your application code and imports need to be inside the then() block so that they run after OpenTelemetry has been setup.
Reference: