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, b3 or datadog propagation format.

View linked traces in the UI

Once trace linking is configured and traffic is flowing, Kloudfuse surfaces the link from both sides: a linked RUM resource lets you open its backend trace, and a backend trace whose root span originated from a RUM-instrumented client lets you pivot back to the originating RUM session, view, and resource.

Exact labels and layout for this linkage in the UI may vary by Kloudfuse version. Browse a Resources event in the Explorer and its corresponding trace in APM to see the linkage available in your cluster.

Troubleshooting

  • Confirm the request URL matches an entry in the SDK’s allowedTracingUrls configuration.

  • 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.