-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The problem of combining the client and server agent - next.js #1370
Comments
Hi @belimposition, Thanks for the details provided! To make sure the web browser’s page load appears as the root of the trace of your backend transaction, you should do as indicated in the doc I linked below:
Since this works when generating HTML from the server, those values come from the backend APM agent you are using (node.js in your case) Example of this is from a Node.js webserver:
To execute the example you will need to have the following folder structure: Make sure you install express, elastic-apm-node, and ejs dependencies. Recording where you will see how the HTML is generated with those IDs: example-node-js-dynamic-html.mov-- If from your client-side you are performing http requests (XHR, Fetch) to your backend-side and you want the RUM agent to add the trace headers automatically, please read this: https://www.elastic.co/guide/en/apm/agent/rum-js/current/distributed-tracing-guide.html#distributed-tracing-guide Let me know if this helps you. Thanks, |
Thanks, I need some time to check and try it, I will write here next week |
@devcorpio On the client side, I make other requests based on the user data and the page to which he went So I did something different and returned pageLoadTraceId, pageLoadSpanId, pageLoadSampled In the end, integration seems to be successful, but there's no data https://monosnap.com/file/VBxMeUBdCs2NpiyF4q1JKqLfXagbsP What am I doing wrong? I passed the transactional data, it's something like this:
initialized - events go away the question still stands - how to merge client and server metrics? |
Hi. I use apm in my project to build project metrics. I use elastic-apm-node for the server part and @elastic/apm-rum for the client part.
In my next.js project, I initialize elastic-apm-node as follows in server.js
in the client part another agent is initialized, so
Then I put this client instance into the redux-saga context and use it where I need it.
The problem is that I don't know how to merge the client and server entries into a shared one. Right now I have them separated.
In documentation it says that in order to merge they need to specify additional keys
https://www.elastic.co/guide/en/apm/agent/nodejs/current/distributed-tracing.html#tracing-rum-correlation
But I don't understand where it's coming from, for
Please help - how to correctly merge client and server records
The text was updated successfully, but these errors were encountered: