Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#1,497 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react-native, typescript

調査の方向性

packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts における鍵の生成と resource のレポートを調査します。proxyOpen と reportXhr を追跡し、開かれた各 XHR に一意な resource 識別子を付与して、同じメソッドの並行リクエストに異なる RUM キーが割り当てられるようにします。既存の XHRProxy テスト、または 1 ミリ秒内の並列リクエストがすべて報告されることを確認するフォーカwhom不复な再現テストで検証してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
145
フォーク
65
平均マージ
2日 16時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/dd-sdk-reactnative のほかの issue

DataDog/dd-sdk-reactnative の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。