RUM drops XHR resources when two requests with the same method start in the same millisecond (resource key collision)
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
- Ambito
- observability-sre
Direzione di ricerca
Esamina la generazione delle chiavi e la segnalazione di resource in packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts. Traccia proxyOpen e reportXhr, quindi fai in modo che ogni XHR aperto contenga un identificatore resource univoco, così che le richieste concorrenti con lo stesso metodo ricevano chiavi RUM distinte. Verifica con i test XHRProxy esistenti o con una riproduzione mirata che tutte le richieste parallele entro un millisecondo vengano segnalate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 146
- Fork
- 67
- Merge medio
- 2g 12h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataDog/dd-sdk-reactnative
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
DataDog/dd-sdk-reactnative#1499 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[actionNameAttribute] prop doesn't accept value with curly bracesForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
DataDog/dd-sdk-reactnative#1486 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Expose Android app startup Activity filtering in the React Native SDKForse già presa @sbarrio l’ha presa 12 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
DataDog/dd-sdk-reactnative#1485 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
GraphQL variables with non-ASCII contents will make Apollo Client request throw errorForse già presa @cdn34dd l’ha presa 14 giorni fa. Apertaawaiting response bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
DataDog/dd-sdk-reactnative#1482 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
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 callForse già presa @cdn34dd l’ha presa 12 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
DataDog/dd-sdk-reactnative#1377 · 1 commento · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di DataDog/dd-sdk-reactnative
Issue simili
-
Area/Cloud Needs Triage Type/Bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
wso2/product-integrator#2847 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
bluesky-social/social-app#12118 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
heygen-com/hyperframes#6021 ·
I maintainer di solito rispondono entro 1 giorno
-
Edit: Tele Posadas HDApertacheck:passed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno