fix(instrumentation-fetch): removes CORS sub-span creation as it was not compliant with ResourceTiming spec #5130
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.
Which problem is this PR solving?
Fixes #5122
In
instrumentation-fetch
andinstrumentation-xhr
, we're including logic to find preflight requests and create (nested) spans for them.However, that is unnecessary complexity as OPTIONS/preflight calls for a cross-domain request are not added as an additional entry in the PerformanceEntry list and, much like redirects and other preconditions, are accounted for in the main resource entry (despite not being able to differentiate between one and the other).
A simple test can be done by executing the following:
Short description of the changes
Removed CORS child span creation, filtering and other logic.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
instrumentation-fetch
andinstrumentation-xhr
in: Google Chrome 130, Safari 18, Firefox 131. Noticed there were no child spans being created for OPTIONS/preflight requests norperformance
entries being added for CORS-enabled requests.performance
entries.Checklist: