Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#1,497 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@marco-saia-datadog đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #1505 của @marco-saia-datadog — đã merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react-native, typescript
Lĩnh vực
observability-sre

Hướng nghiên cứu

Kiểm tra việc tạo khóa và báo cáo resource trong packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts. Lần theo proxyOpen và reportXhr, sau đó để mỗi XHR được mở mang một mã định danh resource duy nhất để các yêu cầu đồng thời dùng cùng một phương thức nhận được các khóa RUM khác nhau. Xác minh bằng các bài kiểm thử XHRProxy hiện có hoặc một trường hợp tái hiện có mục tiêu, xác nhận rằng tất cả các yêu cầu song song trong một mili giây đều được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
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

Ngôn ngữ chính
TypeScript
Star
146
Fork
67
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DataDog/dd-sdk-reactnative

Tất cả issue của DataDog/dd-sdk-reactnative

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.