Repository navigation
[NOJIRA] fix: resource key collision for same-millisecond requests - #1505
Merged
marco-saia-datadog merged 1 commit intoOct 19, 2026
Merged
Conversation
marco-saia-datadog
marked this pull request as ready for review
October 19, 2026 13:22
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The shared counter addresses collisions across both proxies, regression tests cover the reported scenario, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Fixes #1497 by preventing RUM resource-key collisions when requests share a method and start millisecond.
Changes:
- Adds a shared request counter and resource-key helper.
- Uses unique keys for XHR and Fetch reporting.
- Adds same-millisecond regression tests for both proxies.
| File | Description |
|---|---|
| packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts | Uses the shared resource-key helper. |
| packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts | Tests distinct keys and matching resource starts/stops. |
| packages/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.ts | Uses unique keys for successful and failed requests. |
| packages/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/__tests__/FetchProxy.test.ts | Tests same-millisecond key uniqueness. |
| packages/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.ts | Assigns request IDs and constructs unique keys. |
Review effort: Balanced
sbarrio
approved these changes
Oct 19, 2026
cdn34dd
approved these changes
Oct 19, 2026
marco-saia-datadog
deleted the
marco.saia/fix-xhr-resource-key-collision
branch
October 19, 2026 15:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes RUM resource keys unique per request. Each XHR and Fetch request now gets a counter-based ID, and the key becomes
startTime/method/id.Motivation
Fixes #1497.
The key used to be
startTime/method. Two requests with the same method that started in the same millisecond got the same key, and one of them was dropped. This is common when a screen fires parallel GETs.Additional Notes
XHRProxyandFetchProxy.startResource/stopResourceuse it, so nothing else changes.Date.nowand check that the two keys are different.Review checklist (to be filled by reviewers)