RUM drops XHR resources when two requests with the same method start in the same millisecond (resource key collision)
メンテナーはふだん 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 の本文から書いたものです。
説明
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
- Fire several GET requests in parallel through XHR (axios here) when a screen mounts. Some of them start in the same millisecond.
- Compare the RUM resources for the session with an independent network capture: the backend logs, or a second RUM tool capturing the same requests.
- 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataDog/dd-sdk-reactnative のほかの issue
-
clearUserInfo() doesn't clear the cached user id, so baggage keeps the previous user's id対応中かも @hippi345 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DataDog/dd-sdk-reactnative#1495 ·
メンテナーはふだん 2 日以内に返信
-
[actionNameAttribute] prop doesn't accept value with curly braces対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
DataDog/dd-sdk-reactnative#1486 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
Expose Android app startup Activity filtering in the React Native SDK対応中かも @sbarrio が 10 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
DataDog/dd-sdk-reactnative#1485 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
GraphQL variables with non-ASCII contents will make Apollo Client request throw error対応中かも @cdn34dd が 12 日前に担当しました。 オープンawaiting response bug
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
DataDog/dd-sdk-reactnative#1482 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Interaction tracking records nothing: the babel plugin's injected import makes Metro bundle a second copy of the SDK, so DdBabelInteractionTracking.config is set on a different class than instrumented handlers call対応中かも @cdn34dd が 10 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
DataDog/dd-sdk-reactnative#1377 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
DataDog/dd-sdk-reactnative の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jessepollak/home#2223 ·
メンテナーはふだん 1 日以内に返信
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
code-yeongyu/senpi#3756 ·
メンテナーはふだん 1 日以内に返信
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
langchain-ai/deepagents#7059 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
osmlab/name-suggestion-index#12992 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
hemilabs/ui-monorepo#2506 ·
メンテナーはふだん 1 日以内に返信