fix(instrumentation-xhr): resolve relative URLs before matching ignoreUrls#6551
Merged
pichlermarc merged 4 commits intoopen-telemetry:mainfrom Apr 23, 2026
Conversation
…eUrls The XHR instrumentation was matching the raw URL from XMLHttpRequest.open() against ignoreUrls patterns. When a relative URL like '/api/data' was used, domain-based regex patterns (e.g. /.*myapp.*/) would not match, even though the same pattern works correctly with the Fetch instrumentation. This aligns XHR behavior with Fetch by calling parseUrl() to resolve the URL to its absolute form before checking ignoreUrls. Fixes open-telemetry#5810
overbalance
approved these changes
Apr 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6551 +/- ##
=======================================
Coverage 95.74% 95.74%
=======================================
Files 375 375
Lines 12820 12820
Branches 3056 3056
=======================================
Hits 12274 12274
Misses 546 546
🚀 New features to boost your workflow:
|
overbalance
approved these changes
Apr 3, 2026
pichlermarc
reviewed
Apr 23, 2026
Member
|
Looks like this got stalled even though it had browser maintainer approval because browser maintainers were not listed as codeowners for the changelog file. I opened a PR to add them so that browser maintainers can independently merge these PRs in the future (#6622). |
pichlermarc
approved these changes
Apr 23, 2026
Contributor
|
Thank you for your contribution @Maximiliano-Zeballos! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
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.
Summary
XMLHttpRequest.open()againstignoreUrlspatterns/api/data) would not match domain-based regex patterns (e.g./.*myapp.*/)parseUrl()beforeisUrlIgnored()in XHR, aligning behavior with FetchTest plan
ignoreUrlsFixes #5810