@W-18900367 Integration of opentelemetry for SSR Tracing#3133
@W-18900367 Integration of opentelemetry for SSR Tracing#3133jeremy-jung1 merged 142 commits intodevelopfrom
Conversation
…ct-sdk folder acting as a service provider
…ct-sdk folder acting as a service provider
…ith open telemetry dependencies
…telemetry-server.js @W-18759755 - Creating tests and a server for open telemetry within the pwa-kit-rea…
…s and metricsas well as creates a test file for it
Signed-off-by: Larnelle Ankunda <lankunda@salesforce.com>
Signed-off-by: jeremy-jung1 <140001271+jeremy-jung1@users.noreply.github.com>
…Cloud/pwa-kit into feature/opentelemetry
There was a problem hiding this comment.
went through all the tests and reviewed the commits after PR #3028 was merged.
Super cool feature!
|
|
||
| export const render = (req, res, next) => { | ||
| res.__performanceTimer = new PerformanceTimer({enabled: shouldTrackPerformance(req)}) | ||
| if (shouldTrackPerformance) { |
There was a problem hiding this comment.
Are we missing passing req as a parameter?
| if (shouldTrackPerformance) { | |
| if (shouldTrackPerformance(req)) { |
| initializeServerTracing() | ||
| } | ||
|
|
||
| const tracer = trace.getTracer(getServiceName()) |
There was a problem hiding this comment.
We are still creating a tracer even when shouldTrackPerformance is false.
See https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3133/files#r2294888717
There was a problem hiding this comment.
Ah thanks. Added it. Also now tracePerformance is only being called from react-rendering.js if shouldTrackPerformance is true. Otherwise performRender without the tracer creation is called.
adamraya
left a comment
There was a problem hiding this comment.
Great work, thanks for all the polishing! I tested by pushing a bundle to cloud production and things LGTM
| @@ -1,181 +1,182 @@ | |||
| name: SalesforceCommerceCloud/pwa-kit/e2e-pr | |||
There was a problem hiding this comment.
There's an issue with private client MRT deployment for E2E giving a 500 for other PRs. Commenting this out until it's fixed in this ticket
…Cloud/pwa-kit into feature/opentelemetry
Description
This feature allows for the tracing of rendering metrics to come up on Monitoring Cloud. When the configurations are set to be enabled, each step of the react rendering process is timed with a span. The spans are connected to a single trace that is visible on Monitoring Cloud after some time.
Merges in this PR + some more commits:
react-rendering.jsto trace the performance of the SSR process #2834Types of Changes
Changes
x-b3headerx-b3headers creationHow to Test-Drive This PR
On an environment with tracing enabled except SERVER_TIMING
x-b3-traceid-> Note: it may take some time for the traces to show up on monitoring cloud. Metrics get loaded one by one, so sometimes you might see some metrics missing. Search for the traceid again and it will show up
Find a Trace by traceidand paste the trace Id and searchOn an environment with tracing enabled, including SERVER_TIMING
x-b3-traceidheader-> Note: it may take some time for the traces to show up on monitoring cloud. Metrics get loaded one by one, so sometimes you might see some metrics missing. Search for the traceid again and it will show up
Find a Trace by traceidand paste the trace Id and searchOn an environment with tracing disabled
x-b3Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization