In Splunk RUM, using @splunk/otel-web 3.2.0, an application initialized inside a cross-origin iframe may not export a successful XHR span when the parent page removes the iframe shortly after the request completes and triggers window.pagehide.
For example, a successful payment API request can start normally but not appear in the RUM session timeline or dashboards if the iframe is destroyed before RUM completes asynchronous processing and exports the network span.
Splunk RUM processes network instrumentation asynchronously.
Although an XHR request has received its HTTP response, RUM can still be collecting timing data and completing the associated network span. RUM can export only spans that have ended.
When the parent page removes the iframe:
pagehide.This is expected behavior and is not classified as a product defect. A live page can continuously create new spans, so RUM does not provide a supported API to wait until all span processing has completed.
Keep the iframe active for a short period after the XHR response completes and before the parent page removes the iframe.
Example flow:
XHR response received
↓
Wait briefly (for example, 300 ms)
↓
Notify parent page
↓
Parent removes iframe
Do not rely on a manual flush or a “ready” check. Splunk RUM does not provide a supported public API to confirm that all in-progress spans have finished processing.