Skip to content

RUM drops XHR resources when two requests with the same method start in the same millisecond (resource key collision) #1497

Closed

Description

@giladna

Describe the bug

XHRProxy builds the RUM resource key from the start timestamp (millisecond precision) and the HTTP method only:

// packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts
const key = `${context.timer.startTime}/${context.method}`;

ResourceReporter then calls DdRum.startResource(key, …) / DdRum.stopResource(key, …) with that key. When two requests with the same method start in the same millisecond, which is common when a screen fires a burst of parallel GETs, they get the same key. Only one of them ends up as a RUM resource; the other is silently dropped.

The same logic is still on develop (checked October 2026), so newer releases up to 3.10.0 appear to have it too.

Reproduction steps

  1. Fire several GET requests in parallel through XHR (axios here) when a screen mounts. Some of them start in the same millisecond.
  2. Compare the RUM resources for the session with an independent network capture: the backend logs, or a second RUM tool capturing the same requests.
  3. Requests that share a start millisecond and method with another request are missing from Datadog.

SDK logs

One session, Android, ~68 requests, compared against a second RUM SDK capturing the same requests. Datadog missed 4, and each one started in the same millisecond as another GET that Datadog kept:

Missing in Datadog Start (ms) Same-ms GET that was recorded
GET /eds/v2/???/<id> .937 GET /api/2.0/???
GET /api/4.0/???/history .682 GET /api/4.0/???
GET /???/api/v1/???/settings .683 GET /api/2.0/???
GET /api/2.0/???? .931 GET /api/2.0/???/.../???

All 4 returned 200 in 0.4–1.0s. Nothing filters them (no resourceEventMapper). The loss repeats across sessions, roughly 4–6% of requests on screens that load many endpoints at once.

Expected behavior

Every completed XHR is reported as its own RUM resource, however many requests start in the same millisecond.

Make the key unique per request, e.g. by adding a module-level counter (or a random ID) when the XHR is opened:

let resourceSequence = 0;
// in proxyOpen, store a unique id on _datadog_xhr:
this._datadog_xhr = { /* … */, resourceId: ++resourceSequence };
// in reportXhr:
const key = `${context.timer.startTime}/${context.method}/${context.resourceId}`;

Affected SDK versions

@datadog/mobile-react-navigation: 3.5.3

Latest working SDK version

@datadog/mobile-react-navigation: 3.5.3

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

NPM

React Native Version

  • React Native 0.81.4, New Architecture (Fabric)

Package.json Contents

  • @datadog/mobile-react-navigation: 3.5.3

iOS Setup

No response

Android Setup

No response

Device Information

  • Android 16 (Samsung SM-S926B). Not yet verified on iOS, but the key logic is shared JS.

Other relevant information

No response

Activity

  1. marco-saia-datadog commented on Oct 19, 2026

    @marco-saia-datadog
    Member

    Hey @giladna 👋

    Thank you for reporting this issue! I have opened PR#1505 to address it.

    We will keep you posted here as soon as the PR is included in a new release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions