Connect RUM and Traces
Kloudfuse RUM and APM can be linked together so that you can pivot from a frontend user session directly to the backend trace it generated.
Overview
When trace linking is enabled, every qualifying RUM resource and its corresponding backend trace share the same trace_id, which allows Kloudfuse to connect the two.
Under the hood, the RUM SDK injects standard tracing headers (such as W3C traceparent) onto qualifying outbound HTTP requests from the browser. The APM-instrumented backend reads those headers and continues the trace rather than starting a new one, so as long as both sides are configured correctly, RUM events and APM traces end up with matching trace_ids.
This gives you:
-
A way to pivot from a linked RUM resource to the backend trace it produced, and vice versa, directly in the UI.
-
End-to-end visibility from a real user’s browser request through every backend service that handled it.
-
Faster root-cause analysis when a user-reported slowdown or error originates server-side.
Prerequisites
To link RUM events to APM traces, both sides must be configured:
-
Frontend: the Kloudfuse RUM Web SDK must be installed and initialized in your application, with trace linking enabled. See Trace Linking for setup instructions.
-
Backend: the services your RUM application calls must be instrumented with an APM Agent. See APM Instrumentation.
-
Propagation: the backend tracer must be configured to read the W3C
tracecontext,b3ordatadogpropagation format.
View linked traces in the UI
Once trace linking is configured and traffic is flowing, Kloudfuse shows the link from both sides.
From RUM to APM:
-
In RUM > Explorer, set Event Type to Resources.
-
Click a resource to open its event detail panel.
-
Open the Trace tab. It appears only for resources that carry a trace ID. It shows the backend trace’s root service and span, its status and duration, how many spans and services it touched, and its
trace_id. -
Click View Trace in APM to open the full trace in the Traces Explorer.
From APM to RUM: open the trace in the Traces Explorer, select a span, and open the RUM tab of its span detail to see the RUM session, view, and resource that started the request.
Troubleshooting
No linked trace appears on a RUM event
-
Confirm the request URL matches an entry in the SDK’s
allowedTracingUrlsconfiguration. -
Confirm the backend service is APM-instrumented and reporting traces to the same Kloudfuse cluster.
-
Confirm the backend tracer is configured to read at least one of the propagation formats the SDK is injecting for that URL (see Supported propagators).
-
Check that the RUM session sample rate and the trace sample rate are both high enough that a given request is captured on both sides.
Browser blocks the tracing headers (CORS)
When the backend is on a different origin, the server must include the tracing header names in its Access-Control-Allow-Headers response. The exact header names depend on which propagators you have configured — see the Headers injected column in Supported propagators and add every header listed for each format you use.
Trace IDs do not match
-
Verify the backend tracer is configured to extract the same propagation format the SDK is injecting (see Supported propagators) rather than starting a new trace.