Headers on your last request
These are the real values the browser agent attached. traceparent is the W3C standard header. tracestate and newrelic carry New Relic's account and app details so the trace is stitched together correctly.
Press a button and follow one request from this page, across the network, and into the services behind it. Every hop lands in the same trace, and so do the logs written along the way.
Each click is a browser interaction, and each request made during it gets its own trace. The inspector on the right shows the headers the agent added, whether the backend joined the trace, and the log this page wrote for it.
These are the real values the browser agent attached. traceparent is the W3C standard header. tracestate and newrelic carry New Relic's account and app details so the trace is stitched together correctly.
The agent puts trace headers on your requests automatically, but it does not add a trace ID to browser logs from newrelic.log() or wrapLogger(). Add it yourself as trace.id, the attribute New Relic uses to show logs on a trace. A key like traceId would be saved but not linked.
session, the browser session IDptid, the page view's trace IDpageUrl and your custom attributes, like demoCodetrace.id from the traceparent your request carried (this page captures it)x-trace-id, exposed through CORS// After a request: log with the same trace ID the request carried const traceId = traceparent.split('-')[1] // version-TRACEID-parentId-flags newrelic.log('GET /api/products 200', { level: 'info', customAttributes: { 'trace.id': traceId, requestUrl: '/api/products' } })
On the server, the Node.js agent's newrelic.recordLogEvent() adds trace.id and span.id for you, so checkout writes three backend logs (inventory, payment, checkout) onto your trace. Successful requests log at INFO, so set your app's manual log verbosity to INFO or lower in Application settings.
Both request styles are traced the same way. Compare their headers in the inspector.
One click, three requests in a row: cart, checkout, order. With the backend, checkout also calls internal inventory and payment services, which appear as child spans in the same trace.
Traces show you where the time went and which hop failed. Slow and server-error calls need the backend.
Browsers block custom headers on cross-origin requests unless the other server allows them. So the agent only adds trace headers to origins you list under CORS in Application settings.
Allow a minute or two for traces to arrive. The first query uses the trace IDs captured from your own requests, so it matches only your traces.
browserApp.name; backend spans show appName.Send a request above to fill in your trace IDs.
session; backend logs have a span.id.Send a request above to fill in your trace IDs.
Every request is also an AjaxRequest event tagged with your code.
With the backend connected, its transactions carry your code too.
backend/README.md to see the full path.